diff --git a/asm/bard_music.s b/asm/bard_music.s new file mode 100644 index 000000000..0b622e1b4 --- /dev/null +++ b/asm/bard_music.s @@ -0,0 +1,130 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim.s b/asm/battle_anim.s new file mode 100644 index 000000000..e5c27293e --- /dev/null +++ b/asm/battle_anim.s @@ -0,0 +1,4205 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_80A3934 +sub_80A3934: @ 80A3934 + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, =gUnknown_020383FC + movs r1, 0 + strb r1, [r0] + ldr r0, =gUnknown_020383FD + strb r1, [r0] + ldr r0, =gUnknown_020383FE + strb r1, [r0] + ldr r0, =gUnknown_020383FF + strb r1, [r0] + ldr r0, =gUnknown_02038400 + movs r1, 0 + str r1, [r0] + ldr r0, =gUnknown_02038404 + str r1, [r0] + ldr r0, =gUnknown_02038408 + movs r2, 0 + strh r1, [r0] + ldr r0, =gUnknown_0203841A + strb r2, [r0] + ldr r4, =gUnknown_02038430 + ldr r5, =gUnknown_02038432 + ldr r6, =gUnknown_02038433 + ldr r7, =gUnknown_02038434 + ldr r0, =gUnknown_02038436 + mov r12, r0 + ldr r1, =gUnknown_02038437 + mov r8, r1 + ldr r0, =gUnknown_02038440 + mov r9, r0 + ldr r1, =0x0000ffff + adds r3, r1, 0 + ldr r1, =gUnknown_0203840A + movs r2, 0x7 +_080A397E: + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A397E + ldr r1, =gUnknown_0203841E + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3994: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3994 + movs r1, 0 + movs r0, 0xFF + strb r0, [r4] + movs r0, 0x1 + negs r0, r0 + strb r0, [r4, 0x1] + strb r1, [r5] + strb r1, [r6] + movs r0, 0 + strh r1, [r7] + mov r1, r12 + strb r0, [r1] + mov r1, r8 + strb r0, [r1] + mov r1, r9 + strb r0, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3934 + + thumb_func_start move_anim_start_t1 +move_anim_start_t1: @ 80A3A10 + push {lr} + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r2, =gUnknown_02038436 + ldr r0, =gUnknown_0202420B + ldrb r0, [r0] + strb r0, [r2] + ldr r2, =gUnknown_02038437 + ldr r0, =gUnknown_0202420C + ldrb r0, [r0] + strb r0, [r2] + ldr r0, =gUnknown_082C8D6C + movs r2, 0x1 + bl move_something + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_start_t1 + + thumb_func_start move_something +move_something: @ 80A3A48 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A3AE8 + bl sub_80A8278 + movs r0, 0 + bl sub_8072A88 + movs r4, 0 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r6, =gUnknown_0202406E + movs r7, 0x64 + ldr r5, =gUnknown_02038438 +_080A3A84: + lsls r0, r4, 24 + lsrs r0, 24 + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + beq _080A3AA8 + ldrh r0, [r6] + muls r0, r7 + ldr r1, =gUnknown_02024744 + b _080A3AAE + .pool +_080A3AA8: + ldrh r0, [r6] + muls r0, r7 + ldr r1, =gUnknown_020244EC +_080A3AAE: + adds r0, r1 + movs r1, 0xB + bl pokemon_getattr + strh r0, [r5] + adds r6, 0x2 + adds r5, 0x2 + adds r4, 0x1 + cmp r4, 0x3 + ble _080A3A84 + ldr r3, =gUnknown_02038434 + ldr r5, =gUnknown_02038430 + ldr r1, =gUnknown_020383FD + mov r12, r1 + ldr r7, =gUnknown_020383F8 + ldr r6, =move_anim_execute + b _080A3B10 + .pool +_080A3AE8: + ldr r3, =gUnknown_02038434 + ldr r5, =gUnknown_02038430 + mov r0, r8 + lsls r0, 2 + mov r10, r0 + ldr r1, =gUnknown_020383FD + mov r12, r1 + ldr r7, =gUnknown_020383F8 + ldr r6, =move_anim_execute + ldr r2, =gUnknown_02039F34 + ldr r1, =gUnknown_02038438 + movs r4, 0x3 +_080A3B00: + ldr r0, [r2] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B00 +_080A3B10: + mov r0, r9 + cmp r0, 0 + bne _080A3B38 + strh r0, [r3] + b _080A3B3C + .pool +_080A3B38: + mov r1, r8 + strh r1, [r3] +_080A3B3C: + ldr r1, =gUnknown_0203841E + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xE +_080A3B44: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A3B44 + movs r0, 0xFF + strb r0, [r5] + movs r0, 0x1 + negs r0, r0 + strb r0, [r5, 0x1] + ldr r0, [sp] + add r0, r10 + ldr r0, [r0] + ldr r1, =gUnknown_020383F0 + str r0, [r1] + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + movs r0, 0 + ldr r1, =gUnknown_020383FC + strb r0, [r1] + str r6, [r7] + ldr r0, =0x0000ffff + adds r2, r0, 0 + ldr r1, =gUnknown_0203840A + movs r4, 0x7 +_080A3B76: + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A3B76 + mov r1, r9 + cmp r1, 0 + beq _080A3BC2 + movs r4, 0 + ldr r2, =gUnknown_082C8D64 + b _080A3BAA + .pool +_080A3BA8: + adds r4, 0x1 +_080A3BAA: + lsls r0, r4, 1 + adds r0, r2 + ldrh r0, [r0] + ldr r1, =0x0000ffff + cmp r0, r1 + beq _080A3BC2 + cmp r8, r0 + bne _080A3BA8 + ldr r0, =gMPlay_BGM + movs r2, 0x80 + bl m4aMPlayVolumeControl +_080A3BC2: + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E26 + strh r1, [r0] + ldr r0, =gUnknown_02022E28 + strh r1, [r0] + ldr r0, =gUnknown_02022E2A + strh r1, [r0] + 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 move_something + + thumb_func_start move_anim_8072740 +move_anim_8072740: @ 80A3BFC + push {r4,lr} + adds r4, r0, 0 + bl obj_free_rotscale_entry + adds r0, r4, 0 + bl RemoveObjectAndFreeTiles + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_8072740 + + thumb_func_start move_anim_task_del +move_anim_task_del: @ 80A3C1C + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_task_del + + thumb_func_start move_anim_related_task_del +move_anim_related_task_del: @ 80A3C38 + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_related_task_del + + thumb_func_start sub_80A3C54 +sub_80A3C54: @ 80A3C54 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r4, =0x0000ffff + ldr r1, =gUnknown_0203840A +_080A3C60: + ldrh r0, [r1] + cmp r0, r4 + bne _080A3C74 + strh r3, [r1] + b _080A3C7C + .pool +_080A3C74: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C60 +_080A3C7C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C54 + + thumb_func_start sub_80A3C84 +sub_80A3C84: @ 80A3C84 + push {r4,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r0, =0x0000ffff + adds r4, r0, 0 + ldr r1, =gUnknown_0203840A +_080A3C92: + ldrh r0, [r1] + cmp r0, r3 + bne _080A3CA8 + orrs r0, r4 + strh r0, [r1] + b _080A3CB0 + .pool +_080A3CA8: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + ble _080A3C92 +_080A3CB0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A3C84 + + thumb_func_start move_anim_waiter +move_anim_waiter: @ 80A3CB8 + push {lr} + ldr r2, =gUnknown_020383FC + ldrb r1, [r2] + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + bgt _080A3CDC + ldr r0, =gUnknown_020383F8 + ldr r1, =move_anim_execute + str r1, [r0] + movs r0, 0 + b _080A3CDE + .pool +_080A3CDC: + subs r0, r1, 0x1 +_080A3CDE: + strb r0, [r2] + pop {r0} + bx r0 + thumb_func_end move_anim_waiter + + thumb_func_start move_anim_execute +move_anim_execute: @ 80A3CE4 + push {r4,lr} + ldr r4, =gUnknown_08525E98 +_080A3CE8: + ldr r0, =gUnknown_020383F0 + ldr r0, [r0] + ldrb r0, [r0] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + bl _call_via_r0 + ldr r0, =gUnknown_020383FC + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bne _080A3D0C + ldr r0, =gUnknown_020383FD + ldrb r0, [r0] + cmp r0, 0 + bne _080A3CE8 +_080A3D0C: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end move_anim_execute + + thumb_func_start ma00_load_graphics +ma00_load_graphics: @ 80A3D24 + push {r4-r6,lr} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + lsls r5, r4, 3 + ldr r0, =gUnknown_085112C4 + adds r0, r5, r0 + bl LoadCompressedObjectPicUsingHeap + ldr r0, =gUnknown_08511BCC + adds r5, r0 + adds r0, r5, 0 + bl LoadCompressedObjectPaletteUsingHeap + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C54 + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma00_load_graphics + + thumb_func_start ma01_080728D0 +@ void ma01_080728D0() +ma01_080728D0: @ 80A3D8C + push {r4-r6,lr} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + ldr r1, =gUnknown_08524B44 + ldr r0, =0xffffd8f0 + adds r4, r0 + lsls r0, r4, 3 + adds r0, r1 + ldrh r5, [r0, 0x6] + adds r0, r5, 0 + bl FreeObjectTilesByTag + adds r0, r5, 0 + bl FreeObjectPaletteByTag + ldr r0, [r6] + adds r0, 0x2 + str r0, [r6] + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_80A3C84 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma01_080728D0 + + thumb_func_start ma02_instanciate_template +ma02_instanciate_template: @ 80A3DD8 + push {r4-r7,lr} + ldr r5, =gUnknown_020383F0 + ldr r1, [r5] + adds r3, r1, 0x1 + str r3, [r5] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r7, r2, r0 + adds r0, r1, 0x5 + str r0, [r5] + ldrb r4, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r5] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r5] + cmp r0, 0 + beq _080A3E28 + adds r6, r5, 0 + ldr r5, =gUnknown_0203841E + adds r3, r0, 0 +_080A3E10: + ldr r2, [r6] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r5] + adds r2, 0x2 + str r2, [r6] + adds r5, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3E10 +_080A3E28: + movs r0, 0x80 + ands r0, r4 + cmp r0, 0 + beq _080A3E58 + movs r0, 0x80 + eors r4, r0 + cmp r4, 0x3F + bls _080A3E48 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E4A + .pool +_080A3E48: + negs r0, r4 +_080A3E4A: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02038437 + b _080A3E6A + .pool +_080A3E58: + cmp r4, 0x3F + bls _080A3E62 + adds r0, r4, 0 + subs r0, 0x40 + b _080A3E64 +_080A3E62: + negs r0, r4 +_080A3E64: + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, =gUnknown_02038436 +_080A3E6A: + ldrb r0, [r0] + bl sub_80A82E4 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r4, 24 + asrs r1, 24 + adds r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + lsls r0, r6, 16 + asrs r0, 16 + cmp r0, 0x2 + bgt _080A3E88 + movs r6, 0x3 +_080A3E88: + ldr r5, =gUnknown_02038437 + 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 + lsls r3, r6, 24 + lsrs r3, 24 + adds r0, r7, 0 + adds r1, r4, 0 + bl AddObjectAndAnimateForOneFrame + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end ma02_instanciate_template + + thumb_func_start sub_80A3ECC +sub_80A3ECC: @ 80A3ECC + push {r4-r7,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r7, [r1, 0x5] + adds r0, r1, 0x6 + str r0, [r4] + ldrb r0, [r1, 0x6] + adds r1, 0x7 + str r1, [r4] + cmp r0, 0 + beq _080A3F1C + adds r5, r4, 0 + ldr r4, =gUnknown_0203841E + adds r3, r0, 0 +_080A3F04: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3F04 +_080A3F1C: + adds r0, r6, 0 + adds r1, r7, 0 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3ECC + + thumb_func_start ma04_wait_countdown +ma04_wait_countdown: @ 80A3F48 + push {r4,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r2, r0, 0x1 + str r2, [r1] + ldr r3, =gUnknown_020383FC + ldrb r0, [r0, 0x1] + strb r0, [r3] + lsls r0, 24 + cmp r0, 0 + bne _080A3F66 + movs r4, 0x1 + negs r4, r4 + adds r0, r4, 0 + strb r0, [r3] +_080A3F66: + adds r0, r2, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma04_wait_countdown + + thumb_func_start sub_80A3F88 +sub_80A3F88: @ 80A3F88 + push {lr} + ldr r0, =gUnknown_020383FE + ldrb r2, [r0] + cmp r2, 0 + bne _080A3FAC + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =gUnknown_020383FC + strb r2, [r0] + b _080A3FB2 + .pool +_080A3FAC: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] +_080A3FB2: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3F88 + + thumb_func_start nullsub_6 +nullsub_6: @ 80A3FBC + bx lr + thumb_func_end nullsub_6 + + thumb_func_start nullsub_7 +nullsub_7: @ 80A3FC0 + bx lr + thumb_func_end nullsub_7 + + thumb_func_start sub_80A3FC4 +sub_80A3FC4: @ 80A3FC4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r0, =gUnknown_020383FE + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r0, =gUnknown_020383FF + ldrb r0, [r0] + cmp r0, 0 + bne _080A3FEC + ldr r1, =gUnknown_02038430 + ldrb r0, [r1] + cmp r0, 0xFF + bne _080A3FEC + ldrb r0, [r1, 0x1] + cmp r0, 0xFF + beq _080A4004 +_080A3FEC: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] + b _080A401E + .pool +_080A4004: + bl mplay_has_finished_maybe + lsls r0, 24 + cmp r0, 0 + beq _080A403C + ldr r1, =gUnknown_0203842E + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bhi _080A4030 +_080A401E: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + b _080A40A2 + .pool +_080A4030: + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop +_080A403C: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] + movs r5, 0 + ldr r7, =0x0000ffff + ldr r6, =gUnknown_08524B44 + ldr r4, =gUnknown_0203840A +_080A404A: + ldrh r0, [r4] + cmp r0, r7 + beq _080A406E + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectTilesByTag + ldrh r0, [r4] + lsls r0, 3 + adds r0, r6 + ldrh r0, [r0, 0x6] + bl FreeObjectPaletteByTag + ldrh r1, [r4] + adds r0, r7, 0 + orrs r0, r1 + strh r0, [r4] +_080A406E: + adds r4, 0x2 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A404A + mov r1, r8 + cmp r1, 0 + bne _080A40A2 + ldr r0, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A409C + bl sub_80A8278 + movs r0, 0x1 + bl sub_8072A88 +_080A409C: + ldr r0, =gUnknown_020383FD + mov r1, r8 + strb r1, [r0] +_080A40A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A3FC4 + + thumb_func_start ma09_play_sound +ma09_play_sound: @ 80A40CC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + adds r1, r0, 0x1 + str r1, [r4] + ldrb r0, [r0, 0x1] + ldrb r1, [r1, 0x1] + lsls r1, 8 + orrs r0, r1 + bl audio_play + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma09_play_sound + + thumb_func_start sub_80A40F4 +sub_80A40F4: @ 80A40F4 + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r7, r0, 24 + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + mov r8, r1 + adds r6, r0, r1 + ldr r1, =gUnknown_020241E4 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r0, r1 + ldrb r5, [r0] + ldr r1, =gUnknown_02020630 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r4, r0, r1 + adds r2, r4, 0 + adds r2, 0x3E + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] + movs r3, 0x4 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4148 + adds r0, r7, 0 + bl move_anim_task_del + b _080A41BE + .pool +_080A4148: + ldr r0, =task_pA_ma0A_obj_to_bg_pal + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + mov r1, r8 + subs r1, 0x8 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r1, r0, r1 + strh r5, [r1, 0x8] + ldrh r0, [r4, 0x24] + ldrh r3, [r4, 0x20] + adds r0, r3 + strh r0, [r1, 0xA] + ldrh r0, [r4, 0x26] + ldrh r4, [r4, 0x22] + adds r0, r4 + strh r0, [r1, 0xC] + movs r3, 0x2 + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _080A4190 + ldr r0, =gUnknown_02022E18 + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =gUnknown_02022E1A + b _080A4198 + .pool +_080A4190: + ldr r0, =gUnknown_02022E1C + ldrh r0, [r0] + strh r0, [r1, 0xE] + ldr r0, =gUnknown_02022E1E +_080A4198: + ldrh r0, [r0] + strh r0, [r1, 0x10] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r6, 0x2] + strh r1, [r0, 0x12] + ldrh r1, [r6] + strh r1, [r0, 0x14] + ldr r1, =gUnknown_02038430 + movs r3, 0x6 + ldrsh r0, [r6, r3] + adds r0, r1 + strb r2, [r0] + adds r0, r7, 0 + bl move_anim_task_del +_080A41BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A40F4 + + thumb_func_start sub_80A41D8 +sub_80A41D8: @ 80A41D8 + push {r4,r5,lr} + ldr r1, =gUnknown_020383F0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r0, [r2, 0x1] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A41F8 + ldr r0, =gUnknown_02038437 + b _080A41FA + .pool +_080A41F8: + ldr r0, =gUnknown_02038436 +_080A41FA: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4266 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4226 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4230 +_080A4226: + movs r5, 0 + b _080A4232 + .pool +_080A4230: + movs r5, 0x1 +_080A4232: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + movs r2, 0 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r2, [r0, 0xE] +_080A4266: + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A42D8 + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4294 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A42A4 +_080A4294: + movs r5, 0 + b _080A42A6 + .pool +_080A42A4: + movs r5, 0x1 +_080A42A6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A438C + ldr r0, =sub_80A40F4 + movs r1, 0xA + bl CreateTask + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, =gUnknown_020383FE + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + strh r4, [r0, 0x8] + strh r5, [r0, 0xA] + movs r1, 0x1 + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] +_080A42D8: + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + ldr r1, =gUnknown_020383F8 + ldr r0, =move_anim_waiter + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A41D8 + + thumb_func_start b_side_obj__get_some_boolean +b_side_obj__get_some_boolean: @ 80A4310 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4330 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + cmp r4, r0 + beq _080A4374 + b _080A4384 + .pool +_080A4330: + adds r0, r4, 0 + bl sub_80A6A90 + lsls r0, 24 + cmp r0, 0 + beq _080A4384 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4374 + ldr r0, =gUnknown_020244D0 + ldr r0, [r0] + ldr r1, [r0] + lsls r0, r5, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4374 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r5, 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, 29 + cmp r0, 0 + blt _080A4384 +_080A4374: + movs r0, 0x1 + b _080A4386 + .pool +_080A4384: + movs r0, 0 +_080A4386: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end b_side_obj__get_some_boolean + + thumb_func_start sub_80A438C +sub_80A438C: @ 80A438C + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r5, r0, 24 + adds r6, r5, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + cmp r1, 0 + beq _080A43AA + b _080A455E +_080A43AA: + bl sub_80A4DF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A43DC + ldr r1, =0x06008000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill + b _080A43F8 + .pool +_080A43DC: + ldr r1, =0x06004000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600e000 + movs r2, 0x80 + lsls r2, 5 + movs r0, 0xFF + movs r3, 0 + bl RequestDma3Fill +_080A43F8: + add r0, sp, 0x10 + bl sub_80A6B30 + add r0, sp, 0x20 + movs r1, 0 + strh r1, [r0] + ldr r1, [sp, 0x10] + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x22 + movs r1, 0xFF + strh r1, [r0] + ldr r1, [sp, 0x14] + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =gUnknown_020241E4 + adds r0, r6, r0 + ldrb r4, [r0] + ldr r5, =gUnknown_02022E18 + ldr r0, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A447A + ldrh r0, [r5] + subs r0, 0x1 + strh r0, [r5] +_080A447A: + ldr r5, =gUnknown_02022E1A + ldr r2, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + mov r0, r9 + cmp r0, 0 + beq _080A44B0 + ldr r0, =gUnknown_020241E4 + adds r0, r6, 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] +_080A44B0: + ldr r0, =gUnknown_02022E18 + ldrh r1, [r0] + movs r0, 0x14 + bl SetGpuReg + ldrh r1, [r5] + movs r0, 0x16 + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =gUnknown_02037914 + adds r4, r0 + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0x20 + bl gpu_pal_apply + add r0, sp, 0x10 + ldrb r1, [r0, 0x8] + lsls r1, 5 + movs r0, 0xA0 + lsls r0, 19 + adds r1, r0 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4524 + movs r3, 0 + b _080A452E + .pool +_080A4524: + adds r0, r6, 0 + bl battle_get_per_side_status + lsls r0, 24 + lsrs r3, r0, 24 +_080A452E: + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A4558 + b _080A4666 +_080A4558: + bl sub_80A46A0 + b _080A4666 +_080A455E: + ldr r1, =0x06006000 + movs r2, 0x80 + lsls r2, 6 + movs r0, 0 + movs r3, 0x1 + bl RequestDma3Fill + ldr r1, =0x0600f000 + movs r7, 0x80 + lsls r7, 5 + movs r0, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl RequestDma3Fill + add r0, sp, 0x10 + movs r1, 0x2 + bl sub_80A6B90 + add r0, sp, 0x24 + movs r4, 0 + strh r4, [r0] + ldr r1, [sp, 0x10] + adds r1, r7 + ldr r2, =0x01000800 + bl CpuSet + mov r0, sp + adds r0, 0x26 + strh r4, [r0] + ldr r1, [sp, 0x14] + movs r2, 0x80 + lsls r2, 4 + mov r8, r2 + add r1, r8 + ldr r2, =0x01000400 + bl CpuSet + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x1 + movs r2, 0 + bl lcd_bg_operations + ldr r0, =gUnknown_020241E4 + adds r2, r5, r0 + ldrb r4, [r2] + ldr r5, =gUnknown_02022E1C + ldr r3, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r3 + ldrh r0, [r1, 0x24] + ldrh r4, [r1, 0x20] + adds r0, r4 + negs r0, r0 + adds r0, 0x20 + strh r0, [r5] + ldr r4, =gUnknown_02022E1E + ldrh r0, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r0, r1 + negs r0, r0 + adds r0, 0x20 + strh r0, [r4] + mov r0, r9 + cmp r0, 0 + beq _080A460E + 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] +_080A460E: + ldrh r1, [r5] + movs r0, 0x18 + bl SetGpuReg + ldrh r1, [r4] + movs r0, 0x1A + bl SetGpuReg + lsls r4, r6, 5 + ldr r0, =gUnknown_02037914 + adds r4, r0 + adds r0, r4, 0 + movs r1, 0x90 + movs r2, 0x20 + bl gpu_pal_apply + ldr r1, =0x05000120 + ldr r2, =0x04000008 + adds r0, r4, 0 + bl CpuSet + adds r0, r6, 0 + bl battle_get_per_side_status + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + add r0, sp, 0x10 + ldrb r0, [r0, 0x8] + str r0, [sp] + ldr r0, [sp, 0x10] + adds r0, r7 + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + add r0, r8 + str r0, [sp, 0x8] + add r0, sp, 0x10 + ldrh r0, [r0, 0xA] + str r0, [sp, 0xC] + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_8118FBC +_080A4666: + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A438C + + thumb_func_start sub_80A46A0 +sub_80A46A0: @ 80A46A0 + push {r4-r7,lr} + sub sp, 0x10 + ldr r0, =gUnknown_02039F34 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrh r0, [r0] + bl sub_80DB2A8 + lsls r0, 24 + cmp r0, 0 + beq _080A4712 + mov r0, sp + bl sub_80A6B30 + ldr r6, [sp, 0x4] + movs r5, 0 + movs r0, 0x7 + mov r12, r0 + movs r7, 0 +_080A46C6: + movs r4, 0 + adds r3, r7, r6 + mov r1, r12 + lsls r0, r1, 1 + adds r2, r0, r6 +_080A46D0: + 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 _080A46D0 + movs r0, 0x20 + add r12, r0 + adds r7, 0x40 + adds r5, 0x1 + cmp r5, 0x7 + ble _080A46C6 + movs r5, 0 + movs r1, 0x80 + lsls r1, 3 + adds r3, r1, 0 +_080A46F6: + adds r2, r5, 0x1 + lsls r0, r5, 6 + adds r1, r0, r6 + movs r4, 0x7 +_080A46FE: + ldrh r0, [r1] + eors r0, r3 + strh r0, [r1] + adds r1, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _080A46FE + adds r5, r2, 0 + cmp r5, 0x7 + ble _080A46F6 +_080A4712: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A46A0 + + thumb_func_start sub_80A4720 +sub_80A4720: @ 80A4720 + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r6, r2, 0 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r3, 24 + movs r0, 0x40 + mov r12, r0 + cmp r3, 0 + bne _080A473C + movs r1, 0x20 + mov r12, r1 +_080A473C: + lsls r0, r5, 28 + lsrs r5, r0, 16 + movs r0, 0 + cmp r0, r12 + bge _080A476C + ldr r7, =0x00000fff +_080A4748: + adds r4, r0, 0x1 + lsls r0, 6 + mov r1, r8 + adds r3, r0, r1 + movs r2, 0x1F +_080A4752: + ldrh r1, [r3] + adds r0, r7, 0 + ands r0, r1 + orrs r0, r5 + adds r0, r6 + strh r0, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A4752 + adds r0, r4, 0 + cmp r0, r12 + blt _080A4748 +_080A476C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4720 + + thumb_func_start sub_80A477C +sub_80A477C: @ 80A477C + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + mov r0, sp + bl sub_80A6B30 + cmp r4, 0 + beq _080A479C + bl sub_80A4DF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080A47B8 +_080A479C: + movs r0, 0x1 + bl sub_80A6C68 + ldr r0, =gUnknown_02022E18 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E1A + strh r1, [r0] + b _080A47C6 + .pool +_080A47B8: + movs r0, 0x2 + bl sub_80A6C68 + ldr r0, =gUnknown_02022E1C + strh r4, [r0] + ldr r0, =gUnknown_02022E1E + strh r4, [r0] +_080A47C6: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A477C + + thumb_func_start task_pA_ma0A_obj_to_bg_pal +@ void task_pA_ma0A_obj_to_bg_pal(int task_id) +task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r5, r1, r2 + ldrb r4, [r5, 0x8] + ldrb r6, [r5, 0x14] + mov r0, sp + bl sub_80A6B30 + ldr r0, =gUnknown_02020630 + lsls r1, r4, 4 + adds r1, r4 + lsls r1, 2 + adds r1, r0 + ldrh r2, [r1, 0x24] + ldrh r0, [r1, 0x20] + adds r2, r0 + ldrh r0, [r5, 0xA] + subs r0, r2 + lsls r0, 16 + lsrs r3, r0, 16 + ldrh r2, [r1, 0x26] + ldrh r1, [r1, 0x22] + adds r2, r1 + ldrh r0, [r5, 0xC] + subs r0, r2 + lsls r0, 16 + lsrs r2, r0, 16 + movs r1, 0x12 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080A4870 + ldr r1, =gUnknown_02022E18 + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r2, =gUnknown_02037D14 + adds r0, r2 + mov r1, sp + ldrb r1, [r1, 0x8] + lsls r1, 5 + ldr r3, =0xfffffe00 + adds r2, r3 + adds r1, r2 + ldr r2, =0x04000008 + bl CpuSet + b _080A4896 + .pool +_080A4870: + ldr r1, =gUnknown_02022E1C + lsls r0, r3, 16 + asrs r0, 16 + ldrh r3, [r5, 0xE] + adds r0, r3 + strh r0, [r1] + ldr r1, =gUnknown_02022E1E + lsls r0, r2, 16 + asrs r0, 16 + ldrh r5, [r5, 0x10] + adds r0, r5 + strh r0, [r1] + lsls r0, r6, 5 + ldr r1, =gUnknown_02037D14 + adds r0, r1 + subs r1, 0xE0 + ldr r2, =0x04000008 + bl CpuSet +_080A4896: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end task_pA_ma0A_obj_to_bg_pal + + thumb_func_start ma0B_0807324C +ma0B_0807324C: @ 80A48B0 + push {r4,r5,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r4, [r2, 0x1] + cmp r4, 0 + bne _080A48C8 + movs r4, 0x2 + b _080A48D2 + .pool +_080A48C8: + cmp r4, 0x1 + bne _080A48CE + movs r4, 0x3 +_080A48CE: + cmp r4, 0 + beq _080A48D6 +_080A48D2: + cmp r4, 0x2 + bne _080A48E0 +_080A48D6: + ldr r0, =gUnknown_02038436 + b _080A48E2 + .pool +_080A48E0: + ldr r0, =gUnknown_02038437 +_080A48E2: + ldrb r5, [r0] + ldr r3, =gUnknown_02038430 + ldrb r0, [r3] + cmp r0, 0xFF + beq _080A4908 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r5, 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] +_080A4908: + cmp r4, 0x1 + bls _080A4948 + ldrb r0, [r3, 0x1] + cmp r0, 0xFF + beq _080A4948 + ldr r3, =gUnknown_02020630 + ldr r2, =gUnknown_020241E4 + movs r1, 0x2 + adds r0, r5, 0 + eors r0, r1 + adds r0, r2 + 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] + b _080A494A + .pool +_080A4948: + movs r4, 0 +_080A494A: + ldr r0, =sub_80A4980 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + strh r5, [r1, 0xC] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0B_0807324C + + thumb_func_start sub_80A4980 +sub_80A4980: @ 80A4980 + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4A0A + ldrb r0, [r1, 0xC] + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A49BC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A49C4 +_080A49BC: + movs r4, 0 + b _080A49C6 + .pool +_080A49C4: + movs r4, 0x1 +_080A49C6: + ldr r6, =gUnknown_02038430 + ldrb r0, [r6] + cmp r0, 0xFF + beq _080A49DE + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6] + bl DestroyTask + movs r0, 0xFF + strb r0, [r6] +_080A49DE: + ldr r0, =gTasks + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4A04 + movs r0, 0x1 + eors r4, r0 + adds r0, r4, 0 + bl sub_80A477C + ldrb r0, [r6, 0x1] + bl DestroyTask + movs r0, 0xFF + strb r0, [r6, 0x1] +_080A4A04: + adds r0, r5, 0 + bl DestroyTask +_080A4A0A: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4980 + + thumb_func_start sub_80A4A18 +sub_80A4A18: @ 80A4A18 + push {r4,r5,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4A30 + movs r5, 0x2 + b _080A4A3A + .pool +_080A4A30: + cmp r5, 0x1 + bne _080A4A36 + movs r5, 0x3 +_080A4A36: + cmp r5, 0 + beq _080A4A3E +_080A4A3A: + cmp r5, 0x2 + bne _080A4A48 +_080A4A3E: + ldr r0, =gUnknown_02038436 + b _080A4A4A + .pool +_080A4A48: + ldr r0, =gUnknown_02038437 +_080A4A4A: + ldrb r4, [r0] + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4A8A + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4A76 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4A80 +_080A4A76: + movs r1, 0 + b _080A4A82 + .pool +_080A4A80: + movs r1, 0x1 +_080A4A82: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4A8A: + movs r0, 0x2 + eors r4, r0 + cmp r5, 0x1 + bls _080A4ACA + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4ACA + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4ABC + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4AC0 +_080A4ABC: + movs r1, 0 + b _080A4AC2 +_080A4AC0: + movs r1, 0x1 +_080A4AC2: + adds r0, r4, 0 + movs r2, 0 + bl sub_80A438C +_080A4ACA: + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4A18 + + thumb_func_start ma23_8073484 +ma23_8073484: @ 80A4ADC + push {r4-r6,lr} + ldr r0, =gUnknown_020383F0 + ldr r2, [r0] + adds r1, r2, 0x1 + str r1, [r0] + ldrb r5, [r2, 0x1] + cmp r5, 0 + bne _080A4AF4 + movs r5, 0x2 + b _080A4AFE + .pool +_080A4AF4: + cmp r5, 0x1 + bne _080A4AFA + movs r5, 0x3 +_080A4AFA: + cmp r5, 0 + beq _080A4B02 +_080A4AFE: + cmp r5, 0x2 + bne _080A4B0C +_080A4B02: + ldr r0, =gUnknown_02038436 + b _080A4B0E + .pool +_080A4B0C: + ldr r0, =gUnknown_02038437 +_080A4B0E: + ldrb r6, [r0] + adds r0, r6, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B38 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + adds r0, r6, 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] +_080A4B38: + cmp r5, 0x1 + bls _080A4B78 + movs r0, 0x2 + adds r4, r6, 0 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4B78 + ldr r2, =gUnknown_02020630 + ldr r0, =gUnknown_020241E4 + 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] + b _080A4B7A + .pool +_080A4B78: + movs r5, 0 +_080A4B7A: + ldr r0, =sub_80A4BB0 + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + strh r6, [r1, 0xC] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma23_8073484 + + thumb_func_start sub_80A4BB0 +sub_80A4BB0: @ 80A4BB0 + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r1, r0, r1 + ldrh r0, [r1, 0xA] + adds r0, 0x1 + strh r0, [r1, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + beq _080A4C3E + ldrb r4, [r1, 0xC] + adds r0, r4, 0 + bl battle_get_per_side_status + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + adds r0, r1 + lsrs r0, 24 + cmp r0, 0x1 + bls _080A4BEE + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4BF8 +_080A4BEE: + movs r5, 0 + b _080A4BFA + .pool +_080A4BF8: + movs r5, 0x1 +_080A4BFA: + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C0C + adds r0, r5, 0 + bl sub_80A477C +_080A4C0C: + ldr r0, =gTasks + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + adds r1, r0 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _080A4C38 + movs r0, 0x2 + eors r4, r0 + adds r0, r4, 0 + bl b_side_obj__get_some_boolean + lsls r0, 24 + cmp r0, 0 + beq _080A4C38 + movs r0, 0x1 + eors r5, r0 + adds r0, r5, 0 + bl sub_80A477C +_080A4C38: + adds r0, r6, 0 + bl DestroyTask +_080A4C3E: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4BB0 + + thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument +ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 + push {r4,r5,lr} + ldr r2, =gUnknown_020383F0 + ldr r0, [r2] + adds r1, r0, 0x1 + str r1, [r2] + ldrb r5, [r0, 0x1] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r4, [r1, 0x1] + lsls r4, 8 + adds r0, 0x1 + str r0, [r2] + movs r1, 0xFD + lsls r1, 6 + movs r0, 0x50 + bl SetGpuReg + orrs r5, r4 + movs r0, 0x52 + adds r1, r5, 0 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument + + thumb_func_start ma1E_set_BLDCNT +ma1E_set_BLDCNT: @ 80A4C80 + push {lr} + ldr r3, =gUnknown_020383F0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + adds r0, r2, 0x1 + str r0, [r3] + ldrb r2, [r2, 0x1] + lsls r2, 8 + adds r0, 0x1 + str r0, [r3] + orrs r1, r2 + movs r0, 0x50 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma1E_set_BLDCNT + + thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA +ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 + push {lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x50 + movs r1, 0 + bl SetGpuReg + movs r0, 0x52 + movs r1, 0 + bl SetGpuReg + pop {r0} + bx r0 + .pool + thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA + + thumb_func_start ma0E_call +ma0E_call: @ 80A4CCC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldr r2, =gUnknown_020383F4 + adds r0, r1, 0x5 + str r0, [r2] + ldrb r1, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma0E_call + + thumb_func_start sub_80A4D00 +sub_80A4D00: @ 80A4D00 + ldr r0, =gUnknown_020383F0 + ldr r1, =gUnknown_020383F4 + ldr r1, [r1] + str r1, [r0] + bx lr + .pool + thumb_func_end sub_80A4D00 + + thumb_func_start ma10_080736AC +ma10_080736AC: @ 80A4D14 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r1, [r5] + adds r0, r1, 0x1 + str r0, [r5] + ldrb r2, [r1, 0x1] + adds r3, r0, 0x1 + str r3, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + orrs r4, r0 + adds r1, 0x4 + str r1, [r5] + ldr r0, =gUnknown_0203841E + lsls r2, 1 + adds r2, r0 + strh r4, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma10_080736AC + + thumb_func_start ma11_if_else +ma11_if_else: @ 80A4D48 + push {lr} + ldr r3, =gUnknown_020383F0 + ldr r2, [r3] + adds r0, r2, 0x1 + str r0, [r3] + ldr r0, =gUnknown_02038432 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A4D62 + adds r0, r2, 0x5 + str r0, [r3] +_080A4D62: + ldr r2, [r3] + 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] + pop {r0} + bx r0 + .pool + thumb_func_end ma11_if_else + + thumb_func_start ma12_cond_if +ma12_cond_if: @ 80A4D88 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r4, [r5] + adds r2, r4, 0x1 + str r2, [r5] + ldrb r1, [r4, 0x1] + adds r3, r2, 0x1 + str r3, [r5] + ldr r0, =gUnknown_02038432 + ldrb r0, [r0] + cmp r1, r0 + bne _080A4DC0 + ldrb r1, [r2, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A4DC4 + .pool +_080A4DC0: + adds r0, r4, 0x6 + str r0, [r5] +_080A4DC4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end ma12_cond_if + + thumb_func_start ma13_goto +ma13_goto: @ 80A4DCC + ldr r3, =gUnknown_020383F0 + ldr r0, [r3] + adds r2, r0, 0x1 + str r2, [r3] + ldrb r1, [r0, 0x1] + 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] + bx lr + .pool + thumb_func_end ma13_goto + + thumb_func_start sub_80A4DF0 +sub_80A4DF0: @ 80A4DF0 + push {lr} + ldr r0, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A4E10 + movs r0, 0 + b _080A4E12 + .pool +_080A4E10: + movs r0, 0x1 +_080A4E12: + pop {r1} + bx r1 + thumb_func_end sub_80A4DF0 + + thumb_func_start ma14_load_background +ma14_load_background: @ 80A4E18 + push {r4,lr} + ldr r1, =gUnknown_020383F0 + ldr r2, [r1] + adds r0, r2, 0x1 + str r0, [r1] + ldrb r4, [r2, 0x1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma14_load_background + + thumb_func_start sub_80A4E5C +sub_80A4E5C: @ 80A4E5C + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r2, =gUnknown_020383F0 + ldr r1, [r2] + adds r0, r1, 0x1 + str r0, [r2] + ldrb r3, [r1, 0x1] + mov r8, r3 + ldrb r7, [r0, 0x1] + ldrb r6, [r0, 0x2] + adds r1, 0x4 + str r1, [r2] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A4EA8 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r6, [r0, 0x8] + b _080A4EDA + .pool +_080A4EA8: + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A4ECC + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + strh r7, [r0, 0x8] + b _080A4EDA + .pool +_080A4ECC: + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + mov r1, r8 + strh r1, [r0, 0x8] +_080A4EDA: + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4E5C + + thumb_func_start task_p5_load_battle_screen_elements +task_p5_load_battle_screen_elements: @ 80A4EF4 + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r4, r0, r1 + ldrh r6, [r4, 0x1C] + movs r0, 0x1C + ldrsh r3, [r4, r0] + adds r7, r1, 0 + cmp r3, 0 + bne _080A4F2C + str r3, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0 + movs r3, 0x10 + bl sub_80A27B0 + ldrh r0, [r4, 0x1C] + adds r0, 0x1 + strh r0, [r4, 0x1C] + b _080A4FBC + .pool +_080A4F2C: + ldr r2, =gUnknown_02037FD4 + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080A4FBC + cmp r3, 0x1 + bne _080A4F50 + adds r0, r6, 0x1 + strh r0, [r4, 0x1C] + ldr r1, =gUnknown_02038433 + movs r0, 0x2 + strb r0, [r1] + b _080A4F94 + .pool +_080A4F50: + cmp r3, 0x2 + bne _080A4F94 + ldrh r0, [r4, 0x8] + lsls r2, r0, 16 + asrs r1, r2, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A4F68 + bl dp01t_11_3_message_for_player_only + b _080A4F6E +_080A4F68: + lsrs r0, r2, 16 + bl sub_80A4FC8 +_080A4F6E: + movs r0, 0x1 + str r0, [sp] + movs r0, 0xE8 + movs r1, 0 + movs r2, 0x10 + movs r3, 0 + bl sub_80A27B0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0, 0x1C] + adds r1, 0x1 + strh r1, [r0, 0x1C] + b _080A4FBC + .pool +_080A4F94: + ldrb r1, [r2, 0x7] + movs r0, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080A4FBC + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r0, r7 + movs r1, 0x1C + ldrsh r0, [r0, r1] + cmp r0, 0x3 + bne _080A4FBC + adds r0, r5, 0 + bl DestroyTask + ldr r0, =gUnknown_02038433 + strb r4, [r0] +_080A4FBC: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end task_p5_load_battle_screen_elements + + thumb_func_start sub_80A4FC8 +sub_80A4FC8: @ 80A4FC8 + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5050 + ldr r6, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r6, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r5, =0x0201c000 + adds r1, r5, 0 + bl LZDecompressWram + bl sub_80A6D94 + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x80 + lsls r2, 1 + adds r1, r5, 0 + movs r3, 0 + bl sub_80A4720 + ldr r1, =0x0600d000 + ldr r0, =0x040000d4 + str r5, [r0] + str r1, [r0, 0x4] + ldr r1, =0x84000200 + str r1, [r0, 0x8] + ldr r0, [r0, 0x8] + adds r0, r4, r6 + ldr r0, [r0] + ldr r1, =0x06002000 + bl LZDecompressVram + adds r6, 0x4 + adds r4, r6 + ldr r4, [r4] + bl sub_80A6D94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 20 + adds r0, r4, 0 + movs r2, 0x20 + bl decompress_palette + b _080A507E + .pool +_080A5050: + ldr r5, =gUnknown_08525D54 + lsls r4, r7, 1 + adds r4, r7 + lsls r4, 2 + adds r0, r5, 0 + adds r0, 0x8 + adds r0, r4, r0 + ldr r0, [r0] + ldr r1, =0x0600d000 + bl LZDecompressVram + adds r0, r4, r5 + ldr r0, [r0] + ldr r1, =0x06008000 + bl LZDecompressVram + adds r5, 0x4 + adds r4, r5 + ldr r0, [r4] + movs r1, 0x20 + movs r2, 0x20 + bl decompress_palette +_080A507E: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A4FC8 + + thumb_func_start dp01t_11_3_message_for_player_only +dp01t_11_3_message_for_player_only: @ 80A5090 + push {lr} + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A50A2 + bl sub_80D7724 + b _080A50A6 +_080A50A2: + bl load_battle_oval_graphics +_080A50A6: + pop {r0} + bx r0 + thumb_func_end dp01t_11_3_message_for_player_only + + thumb_func_start ma15_load_battle_screen_elements +ma15_load_battle_screen_elements: @ 80A50AC + push {lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =task_p5_load_battle_screen_elements + movs r1, 0x5 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =0x0000ffff + strh r0, [r1, 0x8] + ldr r1, =gUnknown_02038433 + movs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma15_load_battle_screen_elements + + thumb_func_start ma16_wait_for_battle_screen_elements_s2 +ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 + push {lr} + ldr r0, =gUnknown_02038433 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080A5114 + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, =gUnknown_020383FC + movs r0, 0 + b _080A5118 + .pool +_080A5114: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 +_080A5118: + strb r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma16_wait_for_battle_screen_elements_s2 + + thumb_func_start sub_80A5124 +sub_80A5124: @ 80A5124 + push {lr} + ldr r0, =gUnknown_02038433 + ldrb r2, [r0] + cmp r2, 0 + bne _080A5148 + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + ldr r0, =gUnknown_020383FC + strb r2, [r0] + b _080A514E + .pool +_080A5148: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] +_080A514E: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5124 + + thumb_func_start ma18_load_background_probably +ma18_load_background_probably: @ 80A5158 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + ldrb r0, [r1, 0x1] + bl sub_80A4FC8 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma18_load_background_probably + + thumb_func_start sub_80A5178 +sub_80A5178: @ 80A5178 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A51C0 + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gUnknown_02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A51C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A51C0: + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A51E8 + ldr r0, =gUnknown_02038436 + ldr r1, =gUnknown_02038437 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _080A524C + cmp r0, 0x2 + bne _080A524C + cmp r4, 0x3F + beq _080A525E + b _080A524C + .pool +_080A51E8: + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5226 + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A5252 + lsls r0, r4, 24 + asrs r1, r0, 24 + cmp r1, 0x3F + bne _080A5218 + movs r4, 0xC0 + b _080A5252 + .pool +_080A5218: + movs r0, 0x40 + negs r0, r0 + cmp r1, r0 + beq _080A5252 + negs r0, r1 + lsls r0, 24 + b _080A5250 +_080A5226: + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080A524C + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bne _080A5252 + movs r4, 0x3F + b _080A5252 + .pool +_080A524C: + lsls r0, r4, 24 + negs r0, r0 +_080A5250: + lsrs r4, r0, 24 +_080A5252: + lsls r0, r4, 24 + asrs r0, 24 + cmp r0, 0x3F + ble _080A525E + movs r4, 0x3F + b _080A526C +_080A525E: + lsls r0, r4, 24 + asrs r0, 24 + movs r1, 0x40 + negs r1, r1 + cmp r0, r1 + bge _080A526C + movs r4, 0xC0 +_080A526C: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A5178 + + thumb_func_start sub_80A5278 +sub_80A5278: @ 80A5278 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A52C0 + ldr r0, =gUnknown_020244D0 + ldr r1, [r0] + ldr r0, =gUnknown_02038436 + ldrb r2, [r0] + ldr r1, [r1, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A52C0 + adds r0, r2, 0 + bl battle_side_get_owner + lsls r0, 24 + movs r4, 0xC0 + cmp r0, 0 + beq _080A52DE + movs r4, 0x3F + b _080A52DE + .pool +_080A52C0: + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + cmp r0, 0 + bne _080A52D8 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A52DE +_080A52D8: + lsls r0, r4, 24 + negs r0, r0 + lsrs r4, r0, 24 +_080A52DE: + lsls r0, r4, 24 + asrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A5278 + + thumb_func_start sub_80A52EC +sub_80A52EC: @ 80A52EC + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + asrs r2, r0, 16 + cmp r2, 0x3F + ble _080A52FC + movs r1, 0x3F + b _080A5306 +_080A52FC: + movs r0, 0x40 + negs r0, r0 + cmp r2, r0 + bge _080A5306 + ldr r1, =0x0000ffc0 +_080A5306: + lsls r0, r1, 16 + asrs r0, 16 + pop {r1} + bx r1 + .pool + thumb_func_end sub_80A52EC + + thumb_func_start sub_80A5314 +sub_80A5314: @ 80A5314 + push {lr} + lsls r2, 16 + lsrs r2, 16 + adds r3, r2, 0 + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + cmp r0, r1 + bge _080A5332 + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5342 + b _080A5340 +_080A5332: + cmp r0, r1 + ble _080A5348 + lsls r0, r3, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A5340 + negs r0, r0 +_080A5340: + negs r0, r0 +_080A5342: + lsls r0, 16 + lsrs r0, 16 + b _080A534A +_080A5348: + movs r0, 0 +_080A534A: + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_80A5314 + + thumb_func_start ma19_08073BC8 +ma19_08073BC8: @ 80A5354 + push {r4,r5,lr} + ldr r5, =gUnknown_020383F0 + ldr r0, [r5] + adds r1, r0, 0x1 + str r1, [r5] + ldrb r4, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r4, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl audio_play_and_stuff + ldr r0, [r5] + adds r0, 0x3 + str r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma19_08073BC8 + + thumb_func_start ma1A_8073C00 +ma1A_8073C00: @ 80A538C + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r0, r1, 0x1 + str r0, [r4] + movs r0, 0x1 + ldrsb r0, [r1, r0] + bl sub_80A5178 + lsls r0, 24 + asrs r0, 24 + bl sub_80A3870 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma1A_8073C00 + + thumb_func_start ma1B_8073C2C +ma1B_8073C2C: @ 80A53B8 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_020383F0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5178 + mov r8, r0 + lsls r5, 24 + asrs r5, 24 + mov r0, r8 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + lsls r6, 24 + asrs r6, 24 + adds r0, r5, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_80A5314 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + mov r2, r8 + strh r2, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r5, [r1, 0x10] + mov r0, r9 + adds r1, r5, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r10 + ldr r0, [r1] + adds r0, 0x6 + 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 ma1B_8073C2C + + thumb_func_start c3_08073CEC +c3_08073CEC: @ 80A5478 + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xE + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A54FC + strh r7, [r2, 0x18] + ldrh r6, [r2, 0x8] + ldrh r3, [r2, 0xA] + movs r4, 0x10 + ldrsh r0, [r2, r4] + movs r4, 0xC + ldrsh r1, [r2, r4] + adds r0, r1 + lsls r0, 16 + lsrs r4, r0, 16 + strh r4, [r2, 0x10] + cmp r1, 0 + bne _080A54C0 + lsls r2, r3, 16 + b _080A54E4 + .pool +_080A54C0: + lsls r1, r6, 16 + lsls r0, r3, 16 + asrs r3, r0, 16 + adds r2, r0, 0 + cmp r1, r2 + bge _080A54D6 + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + blt _080A54E0 + b _080A54E4 +_080A54D6: + lsls r0, r4, 16 + asrs r0, 16 + cmp r0, r3 + bgt _080A54E0 + movs r7, 0x1 +_080A54E0: + cmp r7, 0 + beq _080A54F4 +_080A54E4: + lsrs r4, r2, 16 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A54F4: + lsls r0, r4, 24 + asrs r0, 24 + bl sub_80A3870 +_080A54FC: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end c3_08073CEC + + thumb_func_start sub_80A5508 +sub_80A5508: @ 80A5508 + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + ldr r0, =gUnknown_020383F0 + mov r9, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r9 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r8, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r8 + orrs r2, r0 + mov r8, r2 + ldrb r4, [r1, 0x2] + ldrb r5, [r1, 0x3] + ldrb r6, [r1, 0x4] + ldrb r1, [r1, 0x5] + mov r10, r1 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0xC] + mov r0, r10 + strh r0, [r1, 0xE] + strh r4, [r1, 0x10] + mov r0, r8 + adds r1, r4, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r1, r9 + ldr r0, [r1] + adds r0, 0x6 + str r0, [r1] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5508 + + thumb_func_start sub_80A559C +sub_80A559C: @ 80A559C + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, =gUnknown_020383F0 + mov r10, r0 + ldr r0, [r0] + adds r1, r0, 0x1 + mov r2, r10 + str r1, [r2] + ldrb r0, [r0, 0x1] + mov r9, r0 + ldrb r0, [r1, 0x1] + lsls r0, 8 + mov r2, r9 + orrs r2, r0 + mov r9, r2 + ldrb r4, [r1, 0x3] + ldrb r0, [r1, 0x4] + mov r8, r0 + ldrb r7, [r1, 0x5] + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5278 + adds r6, r0, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r4, 24 + asrs r4, 24 + adds r0, r4, 0 + bl sub_80A5278 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + mov r1, r8 + lsls r1, 24 + asrs r1, 24 + mov r8, r1 + mov r0, r8 + bl sub_80A5278 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =c3_08073CEC + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + lsls r6, 24 + asrs r6, 24 + strh r6, [r1, 0x8] + lsls r5, 24 + asrs r5, 24 + strh r5, [r1, 0xA] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xC] + strh r7, [r1, 0xE] + strh r6, [r1, 0x10] + mov r0, r9 + adds r1, r6, 0 + bl audio_play_and_stuff + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + mov r2, r10 + ldr r0, [r2] + adds r0, 0x6 + str 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_80A559C + + thumb_func_start ma1C_8073ED0 +ma1C_8073ED0: @ 80A565C + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + ldrb r2, [r1, 0x4] + mov r9, r2 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A56E4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r2, r8 + strh r2, [r1, 0xC] + mov r2, r9 + strh r2, [r1, 0xE] + mov r2, r8 + strh r2, [r1, 0x18] + ldr r1, [r1] + bl _call_via_r1 + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x5 + str r0, [r6] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1C_8073ED0 + + thumb_func_start sub_80A56E4 +sub_80A56E4: @ 80A56E4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + ldr r1, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0x18] + adds r1, r0, 0x1 + strh r1, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _080A5732 + movs r0, 0 + strh r0, [r2, 0x18] + ldrh r0, [r2, 0x8] + ldrb r1, [r2, 0xA] + ldrh r4, [r2, 0xE] + subs r4, 0x1 + strh r4, [r2, 0xE] + lsls r4, 24 + lsrs r4, 24 + lsls r1, 24 + asrs r1, 24 + bl audio_play_and_stuff + cmp r4, 0 + bne _080A5732 + adds r0, r5, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A5732: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A56E4 + + thumb_func_start ma1D_08073FB4 +ma1D_08073FB4: @ 80A5740 + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r6, =gUnknown_020383F0 + ldr r0, [r6] + adds r1, r0, 0x1 + str r1, [r6] + ldrb r5, [r0, 0x1] + ldrb r0, [r1, 0x1] + lsls r0, 8 + orrs r5, r0 + ldrb r0, [r1, 0x3] + mov r8, r0 + movs r0, 0x2 + ldrsb r0, [r1, r0] + bl sub_80A5178 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, =sub_80A57B4 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + ldr r2, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r5, [r1, 0x8] + lsls r4, 24 + asrs r4, 24 + strh r4, [r1, 0xA] + mov r0, r8 + strh r0, [r1, 0xC] + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + ldr r0, [r6] + adds r0, 0x4 + str r0, [r6] + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end ma1D_08073FB4 + + thumb_func_start sub_80A57B4 +sub_80A57B4: @ 80A57B4 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r1 + ldrh r0, [r2, 0xC] + subs r1, r0, 0x1 + strh r1, [r2, 0xC] + lsls r0, 16 + cmp r0, 0 + bgt _080A57E8 + ldrh r0, [r2, 0x8] + movs r1, 0xA + ldrsb r1, [r2, r1] + bl audio_play_and_stuff + adds r0, r4, 0 + bl DestroyTask + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] +_080A57E8: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57B4 + + thumb_func_start sub_80A57F8 +sub_80A57F8: @ 80A57F8 + push {r4-r6,lr} + ldr r4, =gUnknown_020383F0 + ldr r1, [r4] + adds r3, r1, 0x1 + str r3, [r4] + ldrb r2, [r1, 0x1] + ldrb r0, [r3, 0x1] + lsls r0, 8 + adds r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 16 + adds r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 24 + adds r6, r2, r0 + adds r0, r1, 0x5 + str r0, [r4] + ldrb r0, [r1, 0x5] + adds r1, 0x6 + str r1, [r4] + cmp r0, 0 + beq _080A5842 + adds r5, r4, 0 + ldr r4, =gUnknown_0203841E + adds r3, r0, 0 +_080A582A: + ldr r2, [r5] + ldrb r1, [r2] + ldrb r0, [r2, 0x1] + lsls r0, 8 + orrs r1, r0 + strh r1, [r4] + adds r2, 0x2 + str r2, [r5] + adds r4, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080A582A +_080A5842: + adds r0, r6, 0 + movs r1, 0x1 + bl CreateTask + lsls r0, 24 + lsrs r0, 24 + bl _call_via_r6 + ldr r1, =gUnknown_020383FF + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A57F8 + + thumb_func_start ma20_wait_for_something +ma20_wait_for_something: @ 80A586C + push {r4,r5,lr} + ldr r0, =gUnknown_020383FF + ldrb r5, [r0] + cmp r5, 0 + bne _080A58B4 + bl mplay_has_finished_maybe + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A58CC + ldr r4, =gUnknown_0203842E + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x5A + bls _080A58BA + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop + strh r5, [r4] + b _080A58DE + .pool +_080A58B4: + ldr r1, =gUnknown_0203842E + movs r0, 0 + strh r0, [r1] +_080A58BA: + ldr r1, =gUnknown_020383FC + movs r0, 0x1 + strb r0, [r1] + b _080A58DE + .pool +_080A58CC: + ldr r0, =gUnknown_0203842E + movs r2, 0 + strh r1, [r0] + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, =gUnknown_020383FC + strb r2, [r0] +_080A58DE: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end ma20_wait_for_something + + thumb_func_start ma21_08074164 +ma21_08074164: @ 80A58F0 + push {r4-r6,lr} + ldr r5, =gUnknown_020383F0 + ldr r4, [r5] + adds r3, r4, 0x1 + str r3, [r5] + ldrb r2, [r4, 0x1] + ldrb r1, [r3, 0x1] + ldrb r0, [r3, 0x2] + lsls r0, 8 + orrs r1, r0 + ldr r0, =gUnknown_0203841E + lsls r2, 1 + adds r2, r0 + lsls r1, 16 + asrs r1, 16 + movs r6, 0 + ldrsh r0, [r2, r6] + cmp r1, r0 + bne _080A5938 + ldrb r1, [r3, 0x3] + ldrb r0, [r3, 0x4] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r3, 0x5] + lsls r0, 16 + adds r1, r0 + ldrb r0, [r3, 0x6] + lsls r0, 24 + adds r1, r0 + str r1, [r5] + b _080A593E + .pool +_080A5938: + adds r0, r4, 0 + adds r0, 0x8 + str r0, [r5] +_080A593E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end ma21_08074164 + + thumb_func_start sub_80A5944 +sub_80A5944: @ 80A5944 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + beq _080A5978 + ldr r2, [r4] + 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, [r4] + b _080A597E + .pool +_080A5978: + ldr r0, [r4] + adds r0, 0x4 + str r0, [r4] +_080A597E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A5944 + + thumb_func_start sub_80A5984 +sub_80A5984: @ 80A5984 + push {r4,lr} + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + ldrb r2, [r1, 0x1] + adds r1, 0x2 + str r1, [r0] + cmp r2, 0 + beq _080A59A0 + ldr r0, =gUnknown_02038437 + b _080A59A2 + .pool +_080A59A0: + ldr r0, =gUnknown_02038436 +_080A59A2: + ldrb r0, [r0] + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A59D2 + cmp r4, 0 + beq _080A59BE + cmp r4, 0x3 + bne _080A59D2 +_080A59BE: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A59D2: + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5984 + + thumb_func_start sub_80A59DC +sub_80A59DC: @ 80A59DC + push {lr} + ldr r0, =gUnknown_020383F0 + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A04 + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A04: + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A59DC + + thumb_func_start sub_80A5A0C +sub_80A5A0C: @ 80A5A0C + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r6, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + ldr r7, =gUnknown_02038436 + ldrb r0, [r7] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + beq _080A5A78 + cmp r6, 0 + beq _080A5A48 + ldrb r0, [r5] + b _080A5A4A + .pool +_080A5A48: + ldrb r0, [r7] +_080A5A4A: + bl battle_get_per_side_status + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5A78 + cmp r4, 0 + beq _080A5A64 + cmp r4, 0x3 + bne _080A5A78 +_080A5A64: + movs r0, 0x1 + movs r1, 0x4 + movs r2, 0x1 + bl lcd_bg_operations + movs r0, 0x2 + movs r1, 0x4 + movs r2, 0x2 + bl lcd_bg_operations +_080A5A78: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5A0C + + thumb_func_start ma2B_make_side_invisible +ma2B_make_side_invisible: @ 80A5A80 + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AA8 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] +_080A5AA8: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2B_make_side_invisible + + thumb_func_start ma2C_make_side_visible +ma2C_make_side_visible: @ 80A5ABC + push {r4,lr} + ldr r4, =gUnknown_020383F0 + ldr r0, [r4] + ldrb r0, [r0, 0x1] + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5AE6 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + adds r0, 0x3E + ldrb r2, [r0] + movs r1, 0x5 + negs r1, r1 + ands r1, r2 + strb r1, [r0] +_080A5AE6: + ldr r0, [r4] + adds r0, 0x2 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end ma2C_make_side_visible + + thumb_func_start sub_80A5AFC +sub_80A5AFC: @ 80A5AFC + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5BA6 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5BA6 + ldr r6, =gUnknown_02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5BA6 + cmp r7, 0 + bne _080A5B54 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5B60 + .pool +_080A5B54: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5B60: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5BA6 + ldr r1, =gUnknown_02020630 + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + 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] + cmp r4, 0x2 + bne _080A5B90 + ldrb r0, [r2, 0x5] + movs r1, 0xC + orrs r0, r1 + strb r0, [r2, 0x5] +_080A5B90: + cmp r4, 0x1 + bne _080A5BA0 + movs r0, 0 + bl sub_80A477C + b _080A5BA6 + .pool +_080A5BA0: + movs r0, 0x1 + bl sub_80A477C +_080A5BA6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A5AFC + + thumb_func_start sub_80A5BAC +sub_80A5BAC: @ 80A5BAC + push {r4-r7,lr} + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + ldrb r7, [r0, 0x1] + adds r0, 0x2 + str r0, [r1] + bl sub_80A4DF0 + lsls r0, 24 + cmp r0, 0 + bne _080A5C38 + bl battle_type_is_double + lsls r0, 24 + cmp r0, 0 + beq _080A5C38 + ldr r6, =gUnknown_02038436 + ldrb r0, [r6] + bl battle_side_get_owner + adds r4, r0, 0 + ldr r5, =gUnknown_02038437 + ldrb r0, [r5] + bl battle_side_get_owner + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _080A5C38 + cmp r7, 0 + bne _080A5C04 + ldrb r0, [r6] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + b _080A5C10 + .pool +_080A5C04: + ldrb r0, [r5] + bl battle_get_per_side_status_permutated + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0x1 +_080A5C10: + bl obj_id_for_side_relative_to_move + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0xFF + beq _080A5C38 + cmp r4, 0x2 + bne _080A5C38 + ldr r1, =gUnknown_02020630 + 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 + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0, 0x5] +_080A5C38: + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80A5BAC + + thumb_func_start ma2F_stop_music +ma2F_stop_music: @ 80A5C44 + push {lr} + ldr r0, =gMPlay_SE1 + bl m4aMPlayStop + ldr r0, =gMPlay_SE2 + bl m4aMPlayStop + ldr r1, =gUnknown_020383F0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .pool + thumb_func_end ma2F_stop_music + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s new file mode 100644 index 000000000..84f9e7c85 --- /dev/null +++ b/asm/battle_anim_8170478.s @@ -0,0 +1,5832 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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, =gUnknown_02038436 + ldrb r4, [r0] + ldr r0, =gUnknown_02022E24 + movs r1, 0 + strh r1, [r0] + ldr r0, =gUnknown_02022E26 + 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, =gUnknown_03005D70 + adds r4, r0 + ldrb r0, [r4] + ldr r1, =gUnknown_02020630 + 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 CreateInvisibleSpriteWithCallback + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + ldr r0, =DummyObjectCallback + bl CreateInvisibleSpriteWithCallback + 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, =gUnknown_02022E18 + ldrh r0, [r7, 0x20] + negs r0, r0 + adds r0, 0x20 + strh r0, [r1] + ldr r1, =gUnknown_02022E1A + ldrh r0, [r7, 0x22] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1] + ldr r1, =gTasks + 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, =gUnknown_02038436 + ldrb r0, [r0] + mov r8, r0 + ldr r1, =gTasks + 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, =gUnknown_02022E1A + 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, =gUnknown_02022E24 + strh r4, [r0] + ldr r0, =gUnknown_02022E26 + 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, =gUnknown_02020630 + 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, =gUnknown_03005D70 + 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, =gUnknown_03005D70 + adds r2, r0 + ldrb r0, [r2] + lsls r5, r0, 4 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02020630 + adds r6, r2 + ldrb r4, [r6, 0x5] + lsrs r4, 4 + lsls r4, 4 + orrs r4, r3 + lsls r0, 1 + ldr r1, =gUnknown_02037714 + 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, =gUnknown_02020630 + 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, =gUnknown_02038436 + 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, =gUnknown_03005D70 + adds r0, r1 + ldrb r0, [r0] + ldr r1, =gUnknown_02020630 + 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, =gUnknown_02038436 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =gUnknown_0203841E + 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, =gTasks + 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 BlendPalette + 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 BlendPalette + 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, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + adds r0, r1 + ldrb r5, [r0] + ldr r1, =gTasks + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 3 + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 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, =gUnknown_02020630 + 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, =gUnknown_020241E4 + ldr r4, =gUnknown_02038436 + 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, =gUnknown_0202406E + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gUnknown_020244EC + b _08170C08 + .pool +_08170BF8: + ldr r1, =gUnknown_0202406E + ldrb r0, [r4] + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + movs r0, 0x64 + muls r0, r1 + ldr r1, =gUnknown_02024744 +_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, =gTasks + 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, =gUnknown_02038436 + 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, =gUnknown_02020630 + 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, =gUnknown_02024208 + 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, =gUnknown_02024208 + 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, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrb r0, [r0, 0x8] + cmp r0, 0x5 + bne _08170D70 + ldr r1, =gUnknown_0203841E + ldr r0, =0x0000ffff + b _08170D74 + .pool +_08170D70: + ldr r1, =gUnknown_0203841E + 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, =gUnknown_02024208 + 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, =gUnknown_02020630 + 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, =gUnknown_02038437 + 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, =gUnknown_020244D0 + ldr r0, [r0] + ldr r3, [r0, 0x8] + ldr r1, =gUnknown_020241E4 + 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, =gTasks + 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, =gTasks + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + ldr r2, =gUnknown_02020630 + 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, =gUnknown_02022FEC + 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, =gUnknown_02024208 + 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, =gUnknown_02020630 + 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, =gUnknown_02038437 + 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, =gUnknown_020241E4 + 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, =gTasks + 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, =gUnknown_02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_020241E4 + 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, =gTasks + 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, =gUnknown_02020630 + movs r0, 0 + bl battle_get_side_with_given_state + ldr r4, =gUnknown_020241E4 + 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, =gUnknown_020244D0 + 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, =gUnknown_02024208 + 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, =gUnknown_02038437 + 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, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038437 + 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, =gUnknown_020241E4 + ldr r0, =gUnknown_02038437 + ldrb r0, [r0] + adds r0, r1 + ldrb r4, [r0] + ldrh r0, [r7, 0x38] + lsls r0, 24 + lsrs r6, r0, 24 + ldr r1, =gTasks + 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, =gUnknown_030062DC + movs r0, 0x1C + str r0, [r1] + ldr r2, =gUnknown_030062E4 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_030062E0 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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 Cos + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + movs r0, 0x36 + ldrsh r1, [r4, r0] + movs r0, 0 + bl Cos + 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 Cos + 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 Cos + 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 Cos + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + strh r5, [r4, 0x26] + ldr r0, =gUnknown_020244D0 + 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, =gUnknown_020244D0 + 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, =gUnknown_020244D0 + 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, =gUnknown_020244D0 + 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, =gUnknown_020244D0 + 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, =gUnknown_020244D0 + 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, =gUnknown_02038437 + 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, =gUnknown_020244B9 + 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, =gUnknown_02020630 + ldr r4, =gUnknown_020241E4 + 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, =gUnknown_02037FD4 + 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, =gUnknown_02020630 + 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, =gUnknown_02024208 + 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, =gUnknown_02038437 + ldrb r1, [r0] + movs r0, 0x1 + movs r2, 0xE + adds r3, r5, 0 + bl sub_81729E8 +_08171B36: + ldr r6, =gUnknown_02020630 + ldr r5, =gUnknown_020241E4 + ldr r4, =gUnknown_02038437 + 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, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038437 + 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, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038437 + 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, =gUnknown_020244D0 + 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, =gUnknown_020244B9 + 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, =gUnknown_020244B9 + 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, =gTasks + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08171E3E + ldr r0, =gUnknown_020244D0 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_030022C0 + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08171F22 + ldr r0, =gUnknown_02020630 + 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 Sin + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x30 + ldrsh r1, [r4, r2] + bl Cos + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172092 + ldr r0, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172196 + ldr r0, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172296 + ldr r0, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0817239E + ldr r0, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gTasks + 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, =gUnknown_030022C0 + ldr r4, =0x00000439 + adds r0, r4 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _081724D0 + ldr r0, =gUnknown_02020630 + 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 Sin + strh r0, [r4, 0x24] + movs r1, 0x2E + ldrsh r0, [r4, r1] + movs r2, 0x32 + ldrsh r1, [r4, r2] + bl Cos + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08172626 + ldr r0, =gUnknown_02020630 + 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 Sin + strh r0, [r5, 0x24] + movs r0, 0x2E + ldrsh r4, [r5, r0] + movs r2, 0x32 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl Sin + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl Cos + 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, =gTasks + 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, =gUnknown_02020630 + adds r5, r4, r0 + ldr r0, =gUnknown_085E51B4 + add r0, r9 + ldrb r1, [r0] + adds r0, r5, 0 + bl StartObjectImageAnim + ldr r1, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r2, =0x00000439 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081727C4 + ldr r0, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_030022C0 + ldr r1, =0x00000439 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _081728A8 + ldr r0, =gUnknown_02020630 + 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 Sin + 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 Sin + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl Cos + 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, =gUnknown_030022C0 + 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, =gUnknown_020244D0 + 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, =gTasks + 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 BlendPalette + 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 BlendPalette + 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, =gTasks + 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 BlendPalette + 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, =gUnknown_02037FD4 + 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, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08172B78 + ldr r0, =gTasks + 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, =gTasks + 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 BlendPalette + 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, =gUnknown_020241E4 + ldr r3, =gUnknown_02038436 + ldrb r2, [r3] + adds r0, r2, r0 + ldrb r6, [r0] + ldr r1, =gTasks + 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, =gUnknown_0203841E + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0x8] + strh r1, [r0, 0x8] + ldr r0, =gUnknown_02038436 + ldrb r0, [r0] + bl battle_side_get_owner + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08172D68 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02038436 + 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, =gTasks + 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, =gUnknown_020241E4 + ldr r4, =gUnknown_02038436 + ldrb r0, [r4] + adds r0, r1 + ldrb r1, [r0] + ldr r2, =gUnknown_02020630 + 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, =gUnknown_0203841E + ldr r1, =gUnknown_020244D0 + ldr r2, [r1] + ldr r1, =gUnknown_02038436 + 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, =gUnknown_02038437 + ldr r1, =gUnknown_0202420E + 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, =gUnknown_020244D0 + 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, =gTasks + 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, =gUnknown_020244D0 + 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, =gTasks + 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, =gUnknown_020244D0 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + adds r0, r4, r5 + lsls r0, 2 + adds r0, r1 + strh r7, [r0, 0x2E] + ldr r1, =gTasks + 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, =gTasks + 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, =gUnknown_020244D0 + 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 Sin + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x18 + bl Cos + 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, =gTasks + 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, =gTasks + 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, =gUnknown_0203841E + 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, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + 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, =gUnknown_02020630 + ldr r1, =gUnknown_020241E4 + ldr r0, =gUnknown_02038436 + 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, =gUnknown_02020630 + ldr r3, =gUnknown_020241E4 + ldr r2, =gUnknown_02038436 + 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, =gUnknown_0203841E + 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, =gUnknown_02038436 + strb r0, [r1] + movs r0, 0x1 + b _08173498 + .pool +_0817348C: + movs r0, 0x1 + bl battle_get_side_with_given_state + ldr r1, =gUnknown_02038436 + strb r0, [r1] + movs r0, 0 +_08173498: + bl battle_get_side_with_given_state + ldr r1, =gUnknown_02038437 + 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, =gUnknown_020244D0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + ldrh r1, [r0] + cmp r1, 0x53 + bne _081734D4 + ldr r1, =gUnknown_0203841E + movs r0, 0x1 + b _0817350C + .pool +_081734D4: + cmp r1, 0xFA + bne _081734E4 + ldr r1, =gUnknown_0203841E + movs r0, 0x2 + b _0817350C + .pool +_081734E4: + cmp r1, 0x80 + bne _081734F4 + ldr r1, =gUnknown_0203841E + movs r0, 0x3 + b _0817350C + .pool +_081734F4: + movs r0, 0xA4 + lsls r0, 1 + cmp r1, r0 + bne _08173508 + ldr r1, =gUnknown_0203841E + movs r0, 0x4 + b _0817350C + .pool +_08173508: + ldr r1, =gUnknown_0203841E + 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, =gUnknown_02038436 + ldr r1, =gUnknown_020244D0 + ldr r2, [r1] + ldr r1, [r2, 0x8] + ldrh r1, [r1] + strb r1, [r3] + ldr r3, =gUnknown_02038437 + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/braille_puzzles.s b/asm/braille_puzzles.s new file mode 100644 index 000000000..4a49f3308 --- /dev/null +++ b/asm/braille_puzzles.s @@ -0,0 +1,627 @@ + .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, =gSaveBlock1Ptr + 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, =gUnknown_020244EC + 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, =gUnknown_020244E9 + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gSaveBlock1Ptr + 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, =gUnknown_0203BD14 + 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, =gUnknown_02038C08 + 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, =gSaveBlock1Ptr + 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, =gUnknown_0203BD14 + 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, =gUnknown_02038C08 + 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, =gUnknown_0203BD14 + ldrb r0, [r0] + cmp r0, 0x1 + bne _081799E4 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldr r2, =sub_8179934 + b _081799F0 + .pool +_081799E4: + ldr r1, =gTasks + 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, =gSaveBlock1Ptr + 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, =gSaveBlock1Ptr + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/clock.s b/asm/clock.s new file mode 100644 index 000000000..21b7a18c2 --- /dev/null +++ b/asm/clock.s @@ -0,0 +1,175 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809E778 +sub_809E778: @ 809E778 + push {lr} + ldr r0, =0x00000895 + bl FlagSet + bl GameFreakRTC_CalcLocalDateTime + ldr r0, =gSaveBlock2Ptr + ldr r2, [r0] + adds r2, 0xA0 + ldr r3, =gUnknown_03005CF8 + 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, =gUnknown_03005CF8 + 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, =gSaveBlock2Ptr + 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, =gUnknown_030022C0 + 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/coord_event_weather.s b/asm/coord_event_weather.s new file mode 100644 index 000000000..7c1188ad6 --- /dev/null +++ b/asm/coord_event_weather.s @@ -0,0 +1,156 @@ + .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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/credits.s b/asm/credits.s new file mode 100644 index 000000000..88c8739e4 --- /dev/null +++ b/asm/credits.s @@ -0,0 +1,3903 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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, =gUnknown_030022C0 + ldrh r1, [r0, 0x2C] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08175522 + ldr r0, =gUnknown_0203BCE4 + ldrb r0, [r0] + cmp r0, 0 + beq _08175522 + ldr r2, =gTasks + ldr r0, =gUnknown_0203BCE2 + 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, =gUnknown_0203BCE5 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_0203BCE5 + mov r1, r8 + strb r1, [r0] + ldr r4, =gUnknown_0203BCE8 + 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, =gUnknown_0203BCE2 + 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, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175764 + ldr r0, =gTasks + 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, =gTasks + 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, =gUnknown_0203BCE0 + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gUnknown_030022C0 + 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, =gUnknown_0300301C + 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, =gUnknown_030022C0 + 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, =gTasks + 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, =gUnknown_0203BD28 + 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, =gTasks + 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, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175B0A + adds r0, r4, 0 + bl sub_8176CA0 + ldr r0, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08175CB8 + ldr r1, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r4, r0, r1 + movs r0, 0x8 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _08175C62 + ldr r0, =gUnknown_030022C0 + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gUnknown_02037FD4 + 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, =gUnknown_0203BCE0 + 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, =gTasks + 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, =gUnknown_02037FD4 + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gUnknown_0203BCE8 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_0203BCE8 + 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, =gUnknown_0203BCE8 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_0203BCE8 + 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, =gTasks + 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, =gTasks + 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 Sin + ldr r1, =gUnknown_0203BD26 + strh r0, [r1] + b _08176390 + .pool +_0817636C: + ldr r7, =gUnknown_0203BD26 + 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 Sin + strh r0, [r7] +_08176390: + ldrh r0, [r4, 0x12] + adds r0, 0x1 + strh r0, [r4, 0x12] + b _08176514 + .pool +_0817639C: + ldr r3, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 Sin + ldr r1, =gUnknown_0203BD26 + strh r0, [r1] + b _08176514 + .pool +_08176464: + ldr r2, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02020630 + ldr r0, =gTasks + 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, =gUnknown_02020630 + ldr r0, =gTasks + 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, =gUnknown_02020630 + ldr r0, =gTasks + 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, =gUnknown_02020630 + ldr r0, =gTasks + 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, =gUnknown_02020630 + ldr r0, =gTasks + 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, =gTasks + 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, =gUnknown_030022C0 + 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, =gUnknown_0203BD24 + movs r0, 0x22 + strh r0, [r1] + ldr r1, =gUnknown_0203BD26 + 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, =gSaveBlock2Ptr + 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, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =gUnknown_02020630 + 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, =gTasks + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 3 + adds r4, r0 + strh r2, [r4, 0x12] + ldr r6, =gUnknown_02020630 + 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, =gUnknown_030022C0 + 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, =gTasks + 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, =gUnknown_0203BD28 + 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, =gUnknown_0203BD28 + 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, =gUnknown_0203BD28 + 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, =gUnknown_0203BD26 + 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, =gUnknown_0203BD28 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_0203BD28 + 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, =gUnknown_0203BCE8 + 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, =gUnknown_0203BCE8 + 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, =gUnknown_0203BCE8 + mov r9, r0 + ldr r1, =0x0000039a + mov r8, r1 + movs r7, 0 + b _08177450 + .pool +_0817744C: + cmp r6, 0x46 + bhi _081774AC +_08177450: + bl Random + 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, =gUnknown_0203BCE8 + 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/event_data.s b/asm/event_data.s new file mode 100644 index 000000000..0ae8b4eb7 --- /dev/null +++ b/asm/event_data.s @@ -0,0 +1,565 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_809D300 +sub_809D300: @ 809D300 + push {r4,lr} + ldr r4, =gSaveBlock1Ptr + 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, =gUnknown_020375FC + 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, =gSaveBlock1Ptr + 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, =gSaveBlock1Ptr + 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, =gSaveBlock2Ptr + 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, =gSaveBlock2Ptr + 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, =gSaveBlock2Ptr + 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, =gSaveBlock1Ptr + 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, =gSaveBlock1Ptr + 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, =gUnknown_020375FC +_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/evolution_graphics.s b/asm/evolution_graphics.s new file mode 100644 index 000000000..600363266 --- /dev/null +++ b/asm/evolution_graphics.s @@ -0,0 +1,1751 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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 Sin + 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 Cos + 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, =gUnknown_02020630 + 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 Sin + 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 Cos + strh r0, [r4, 0x24] + movs r1, 0x3C + ldrsh r0, [r4, r1] + lsls r0, 26 + lsrs r0, 24 + movs r1, 0x28 + bl Sin + 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, =gUnknown_02020630 + 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 Sin + strh r0, [r4, 0x26] + ldrh r0, [r4, 0x3A] + lsls r0, 24 + lsrs r0, 24 + movs r2, 0x38 + ldrsh r1, [r4, r2] + bl Cos + 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, =gUnknown_02020630 + 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 Sin + 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 Random + ldr r6, =gUnknown_02020630 + 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 Random + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =gUnknown_02037B54 + ldr r1, =gUnknown_02037754 + 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, =gTasks + 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 Random + 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, =gTasks + 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, =gUnknown_02037FD4 + 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, =gTasks + 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, =gTasks + lsls r5, r4, 2 + adds r5, r4 + lsls r5, 3 + adds r5, r0 + movs r0, 0 + strh r0, [r5, 0x26] + ldr r0, =gUnknown_02037B54 + ldr r1, =gUnknown_02037754 + 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, =gTasks + 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 Random + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_02037D14 + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02020630 + mov r8, r1 + ldr r1, =gTasks + 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, =gUnknown_02020630 + mov r8, r1 + ldr r1, =gTasks + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_809BEDC.s b/asm/field_control_avatar.s similarity index 88% rename from asm/rom_809BEDC.s rename to asm/field_control_avatar.s index 65280e6ce..7cae1d1ad 100644 --- a/asm/rom_809BEDC.s +++ b/asm/field_control_avatar.s @@ -2509,346 +2509,4 @@ sub_809D2BC: @ 809D2BC .pool thumb_func_end sub_809D2BC - thumb_func_start sub_809D300 -sub_809D300: @ 809D300 - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - 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, =gUnknown_020375FC - 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, =gSaveBlock1Ptr - 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, =gSaveBlock1Ptr - 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, =gSaveBlock2Ptr - 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, =gSaveBlock2Ptr - 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, =gSaveBlock2Ptr - 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/field_effect.s b/asm/field_effect.s index aa3359a7d..cb549efed 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -498,4 +498,8036 @@ _080B5E68: 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, =gUnknown_02037714 + 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, =gUnknown_02037B14 + 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, =gUnknown_02037714 + 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, =gUnknown_02037B14 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_03005DAC + 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, =gUnknown_03005DAC + 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, =gTasks + 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, =gUnknown_02038C08 + 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, =gUnknown_03005DAC + 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, =gUnknown_02037350 + ldr r3, =gUnknown_02037590 + 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, =gUnknown_03005DAC + 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, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _080B6B3E + ldr r0, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r0, [r6, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02037350 + mov r8, r0 + add r5, r8 + ldrb r0, [r6, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r0, [r6, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02021BBE + 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, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_02037590 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl Sin + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl Sin + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gUnknown_03005DAC + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x84 + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x94 + bl Sin + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x84 + bl Cos + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x94 + bl Sin + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + adds r4, r0 + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x7C + bl Cos + strh r0, [r4, 0x24] + movs r0, 0xA + ldrsh r1, [r5, r0] + movs r0, 0x76 + bl Sin + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + adds r5, r0, r1 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x7C + bl Cos + strh r0, [r5, 0x24] + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x76 + bl Sin + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r2, =gUnknown_02038C08 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02037350 + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02037590 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r3, =gUnknown_02038C08 + 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, =gTasks + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + 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, =gTasks + ldr r5, =gUnknown_02037590 + 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, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02021BBE + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gUnknown_03005DAC + 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, =gTasks + ldr r5, =gUnknown_02037590 + 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, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02020630 + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02020630 + 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, =gTasks + ldr r5, =gUnknown_02037590 + 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, =gUnknown_02037350 + adds r1, r0 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + 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, =gUnknown_02038C08 + 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, =gUnknown_02020630 + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gUnknown_02038C08 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r3, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DAC + 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, =gUnknown_03005DAC + movs r0, 0 + str r0, [r1] + ldr r2, =gUnknown_02037350 + ldr r0, =gUnknown_02037590 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r0, [r5, 0x4] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02021BBE + adds r1, r4 + ldrh r3, [r3] + adds r1, r3 + asrs r0, 16 + adds r0, r1 + negs r0, r0 + strh r0, [r2, 0x26] + ldr r3, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r2, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r6, r0, r1 + ldrb r1, [r2, 0x4] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02038C08 + ldr r0, [r2] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + bl sub_80B8C60 + ldr r2, =gTasks + 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, =gUnknown_02038C08 + 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, =gUnknown_020244EC + 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, =gTasks + 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, =gUnknown_030022C0 + ldr r1, [r1, 0xC] + bl StoreWordInTwoHalfwords + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 LoadWordFromTwoHalfwords + 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, =gUnknown_02020630 + 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, =gTasks + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl LoadWordFromTwoHalfwords + 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, =gTasks + 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, =gUnknown_030022C0 + ldr r1, [r1, 0xC] + bl StoreWordInTwoHalfwords + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 LoadWordFromTwoHalfwords + 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, =gUnknown_02020630 + 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, =gTasks + adds r4, r0 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, sp + bl LoadWordFromTwoHalfwords + 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, =gUnknown_02020630 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =gUnknown_02038C08 + 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, =gTasks + 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, =gUnknown_02037590 + 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, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + bl FieldObjectCheckIfSpecialAnimFinishedOrInactive + lsls r0, 24 + cmp r0, 0 + beq _080B8E96 + ldr r2, =gUnknown_02038C08 + 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, =gUnknown_02037590 + ldrb r0, [r5, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + 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, =gUnknown_02038C08 + 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, =gUnknown_02037590 + ldrb r1, [r5, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02038C08 + 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 Cos + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl Sin + 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, =gUnknown_02020630 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, =gUnknown_02038C08 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02038C08 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02037350 + 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, =gUnknown_02037FD4 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl Sin + 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 Cos + movs r5, 0 + strh r0, [r4, 0x24] + movs r2, 0x32 + ldrsh r0, [r4, r2] + movs r1, 0x48 + bl Sin + 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, =gUnknown_02020630 + 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 Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x78 + bl Sin + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + adds r0, r1 + ldrb r0, [r0, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x4] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r0, [r0, 0x5] + lsls r5, r0, 3 + adds r5, r0 + lsls r5, 2 + ldr r0, =gUnknown_02037350 + adds r5, r0 + ldrb r0, [r5, 0x4] + lsls r4, r0, 4 + adds r4, r0 + lsls r4, 2 + ldr r0, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r1, [r0, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02020630 + 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, =gUnknown_02037590 + ldrb r1, [r6, 0x5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02037350 + 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, =gUnknown_02038C08 + 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, =gTasks + 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, =gTasks + 0x8 + 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, =gTasks + 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, =gTasks + 0x8 + 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, =gUnknown_02037350 + 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, =gUnknown_02020630 + 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, =gUnknown_02037FD4 + 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, =gUnknown_03005DEC + 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, =gUnknown_03005DE8 + 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, =gUnknown_02020630 + 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, =gUnknown_02038C08 + 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, =gUnknown_02037350 + 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, =gTasks + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 3 + adds r2, r1 + ldrb r0, [r4, 0x4] + strh r0, [r2, 0xA] + ldr r3, =gUnknown_02020630 + 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, =gTasks + 0x8 + adds r5, r0, r1 + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_02037350 + 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 + .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_region_map.s b/asm/field_region_map.s new file mode 100644 index 000000000..67fc08a2b --- /dev/null +++ b/asm/field_region_map.s @@ -0,0 +1,325 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817018C +sub_817018C: @ 817018C + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0 + bl SetVBlankCallback + ldr r4, =gUnknown_0203BCD0 + 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, =gUnknown_0203BCD0 + 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, =gUnknown_0203BCD0 + ldr r1, [r0] + ldr r0, =0x0000088c + adds r1, r0 + b _081703D8 + .pool +_08170380: + ldr r0, =gUnknown_02037FD4 + 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, =gUnknown_0203BCD0 + 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, =gUnknown_0203BCD0 + 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, =gUnknown_02037FD4 + 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, =gUnknown_0203BCD0 + 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, =gUnknown_0203BCD0 + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_809D7BC.s b/asm/field_tasks.s similarity index 85% rename from asm/rom_809D7BC.s rename to asm/field_tasks.s index bad71b8fa..bee4df22d 100644 --- a/asm/rom_809D7BC.s +++ b/asm/field_tasks.s @@ -5,154 +5,6 @@ .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} @@ -2066,171 +1918,4 @@ _0809E762: 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, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xA0 - ldr r3, =gUnknown_03005CF8 - 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, =gUnknown_03005CF8 - 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, =gSaveBlock2Ptr - 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, =gUnknown_030022C0 - 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/flag.s b/asm/flag.s deleted file mode 100644 index 9919e0442..000000000 --- a/asm/flag.s +++ /dev/null @@ -1,126 +0,0 @@ - .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, =gSaveBlock1Ptr - 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, =gUnknown_020375FC -_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_teleport.s b/asm/fldeff_teleport.s new file mode 100644 index 000000000..4648c2e51 --- /dev/null +++ b/asm/fldeff_teleport.s @@ -0,0 +1,84 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start sub_817C8BC +sub_817C8BC: @ 817C8BC + push {lr} + ldr r0, =gUnknown_02037318 + ldrb r0, [r0, 0x17] + bl is_light_level_1_2_3_or_6 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0817C8D8 + movs r0, 0 + b _0817C8E6 + .pool +_0817C8D8: + ldr r1, =gUnknown_03005DB0 + ldr r0, =hm_add_c3_launch_phase_2 + str r0, [r1] + ldr r1, =gUnknown_0203CEEC + 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, =gUnknown_02038C08 + 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, =gTasks + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s new file mode 100644 index 000000000..58f1812d2 --- /dev/null +++ b/asm/hall_of_fame.s @@ -0,0 +1,3603 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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, =gUnknown_030022C0 + 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, =gUnknown_0203BCDC + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =gUnknown_030022C0 + 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, =gUnknown_0203BCDC + 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, =gUnknown_030022C0 + 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, =gUnknown_02037FD4 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + strh r4, [r1, 0x8] + ldr r4, =gUnknown_0203BCD8 + 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, =gTasks + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r0, 0x1 + strh r0, [r1, 0x8] + ldr r4, =gUnknown_0203BCD8 + 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, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0xC] + movs r7, 0 + ldr r0, =gUnknown_0203BCD8 + mov r9, r0 +_08173740: + movs r0, 0x64 + adds r1, r7, 0 + muls r1, r0 + ldr r0, =gUnknown_020244EC + 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, =gUnknown_0203BCD8 +_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, =gTasks + 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, =gUnknown_0203BCD4 + movs r3, 0 + str r3, [r0] + ldr r4, =gTasks + 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, =gUnknown_0203BCE4 + 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, =gUnknown_0203BCD8 + 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, =gTasks + 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, =gUnknown_03006214 + 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, =gUnknown_030061FC + ldr r0, [r0] + cmp r0, 0 + beq _08173A34 + movs r0, 0x1 + bl UnsetBgTilemapBuffer + movs r0, 0x3 + bl UnsetBgTilemapBuffer + bl FreeAllWindowBuffers + ldr r5, =gUnknown_0203BCDC + ldr r0, [r5] + cmp r0, 0 + beq _08173A06 + bl Free + movs r0, 0 + str r0, [r5] +_08173A06: + ldr r5, =gUnknown_0203BCD8 + 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, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gTasks + mov r2, r8 + lsls r1, r2, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + ldrh r6, [r1, 0xA] + ldr r2, =gUnknown_0203BCD8 + 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, =gUnknown_02020630 + 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, =gTasks + 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, =gTasks + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 3 + adds r5, r3, r4 + ldrh r0, [r5, 0xA] + ldr r2, =gUnknown_0203BCD8 + 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, =gUnknown_02020630 + 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, =gTasks + lsls r0, r5, 2 + adds r0, r5 + lsls r6, r0, 3 + adds r4, r6, r2 + ldrh r3, [r4, 0xA] + ldr r1, =gUnknown_0203BCD8 + 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, =gUnknown_0203BCD4 + ldr r0, =gUnknown_02020630 + 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, =gTasks + 0x8 + mov r12, r0 + mov r8, r1 + ldr r6, =gUnknown_02020630 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_0203BCD4 + mov r10, r0 + adds r4, r5, 0 + adds r7, 0x8 + mov r8, r7 + ldr r7, =gUnknown_02020630 + 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, =gTasks + 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, =gTasks + 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, =gSaveBlock2Ptr + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gUnknown_030022C0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0817404E + movs r0, 0x4 + bl play_sound_effect + ldr r0, =gTasks + 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, =gUnknown_02037B14 + ldr r1, =gUnknown_02037714 + 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, =gTasks + 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, =gUnknown_02037FD4 + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08174164 + lsls r0, r7, 2 + mov r8, r0 + ldr r1, =gTasks + adds r0, r7 + lsls r0, 3 + adds r1, 0x12 + adds r5, r0, r1 + ldr r2, =gUnknown_02020630 + 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, =gTasks + 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, =gUnknown_0203BCDC + ldr r0, [r4] + cmp r0, 0 + beq _08174150 + bl Free + movs r0, 0 + str r0, [r4] +_08174150: + ldr r4, =gUnknown_0203BCD8 + 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, =gUnknown_030022C0 + 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, =gUnknown_0203BCDC + ldr r0, =0x00002014 + bl AllocZeroed + str r0, [r4] + ldr r0, =gUnknown_030022C0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _08174308 + .pool +_08174200: + bl sub_8174F70 + ldr r1, =gUnknown_030022C0 + 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, =gUnknown_030022C0 + 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, =gUnknown_030022C0 + 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, =gUnknown_030022C0 + 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, =gTasks + 0x8 + 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, =gUnknown_0203BCD8 + 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, =gTasks + 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, =gUnknown_0203BCD8 + 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, =gTasks + adds r1, r5, r6 + lsls r1, 3 + adds r1, r0 + subs r0, r2, 0x1 + b _081743C6 + .pool +_081743BC: + ldr r0, =gTasks + 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, =gTasks + 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, =gUnknown_0203BCD8 + ldr r3, [r0] + movs r5, 0 + ldr r1, =gTasks + 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, =gUnknown_0203BCD4 + 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, =gTasks + 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, =gUnknown_02020630 + 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, =gTasks + 0x8 + adds r1, r2 + strh r0, [r1] + b _0817454E + .pool +_08174540: + adds r0, r5, 0x5 + lsls r0, 1 + add r0, r9 + ldr r4, =gTasks + 0x8 + 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, =gStringVar1 + ldr r1, =gTasks + 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 ConvertIntToDecimalStringN + ldr r5, =gStringVar4 + ldr r1, =gUnknown_085E8C00 + adds r0, r5, 0 + bl StringExpandPlaceholders + 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, =gTasks + 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, =gUnknown_0203BCD8 + ldr r5, [r0] + movs r3, 0 + ldr r1, =gTasks + 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, =gTasks + 0x8 + mov r10, r0 + ldr r1, =gUnknown_02020630 + 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, =gTasks + adds r6, r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, 0x5 + lsls r0, 1 + adds r0, r1 + ldr r1, =gTasks + adds r1, 0x8 + adds r0, r1 + ldrh r1, [r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + ldr r1, =gUnknown_02020630 + 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, =gUnknown_0203BCD4 + 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, =gUnknown_030022C0 + ldrh r2, [r1, 0x2E] + movs r0, 0x1 + ands r0, r2 + adds r3, r1, 0 + cmp r0, 0 + beq _081747E4 + ldr r0, =gTasks + 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, =gTasks + 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, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_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, =gMPlay_BGM + ldr r1, =0x0000ffff + movs r2, 0x80 + lsls r2, 1 + bl m4aMPlayVolumeControl +_08174806: + ldr r0, =gTasks + 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, =gTasks + 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, =gTasks + 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, =gUnknown_02037B14 + ldr r1, =gUnknown_02037714 + 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, =gTasks + 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, =gTasks + 0x8 + 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, =gUnknown_0203BCDC + ldr r0, [r4] + cmp r0, 0 + beq _08174974 + bl Free + movs r0, 0 + str r0, [r4] +_08174974: + ldr r4, =gUnknown_0203BCD8 + 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, =gTasks + 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, =gUnknown_030022C0 + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08174A28 + ldr r0, =gTasks + 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 StringCopy + 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 StringCopy + 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 StringCopy + adds r6, r0, 0 + ldrb r1, [r7, 0x9] + lsrs r1, 1 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + 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 StringCopy + adds r6, r0, 0 + ldrh r1, [r7] + movs r2, 0x2 + movs r3, 0x5 + bl ConvertIntToDecimalStringN + 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, =gSaveBlock2Ptr + 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, =gSaveBlock2Ptr + 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, =gUnknown_0300301C + 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, =gUnknown_0203BCDC + 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, =gUnknown_0203BCDC + 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, =gUnknown_0203BCDC + ldr r1, [r0] + movs r0, 0 + strh r0, [r1] + b _08175114 + .pool +_08175108: + ldr r0, =gUnknown_0203BCDC + 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 Random + 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 Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl Random + 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, =gUnknown_02020630 + adds r4, r1, r0 + bl Random + 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 Random + 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, =gUnknown_020375E0 + 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, =gTasks + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r4] + strh r1, [r0, 0xA] + ldr r0, =gUnknown_020375E2 + 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, =gTasks + 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 Random + 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, =gTasks + 0x8 + 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, =gUnknown_020375E0 + strh r7, [r0] + ldr r1, =gUnknown_020375E2 + 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 Random + lsls r0, 16 + lsrs r0, 16 + movs r1, 0xF0 + bl __umodsi3 + adds r5, r0, 0 + lsls r5, 16 + asrs r5, 16 + bl Random + 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 Random + 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 Random + 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, =gUnknown_020375E0 + strh r7, [r0] + ldr r1, =gUnknown_020375E2 + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro.s b/asm/intro.s index f56b179a6..c2459326a 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -4487,4 +4487,1784 @@ sub_816F2A8: @ 816F2A8 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_0202064C + 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, =gUnknown_0202064C + 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, =gUnknown_030062A0 + 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, =gUnknown_030062A0 + 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, =gUnknown_030062A0 + 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 Random + 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 Sin + ldr r1, =gUnknown_0203BCCC + 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, =gUnknown_030062A0 + 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, =gUnknown_02037D52 + 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, =gUnknown_02037D52 + 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, =gUnknown_02037D52 + 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, =gUnknown_030062A0 + 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, =gUnknown_030062A0 + 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, =gUnknown_030062A0 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 Sin + negs r0, r0 + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x78 + bl Sin + 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 Sin + strh r0, [r4, 0x24] + ldrh r0, [r4, 0x34] + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x3C + bl Cos + 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 + .align 2, 0 @ Don't pad with nop. diff --git a/asm/intro_credits_graphics.s b/asm/intro_credits_graphics.s new file mode 100644 index 000000000..2503767c9 --- /dev/null +++ b/asm/intro_credits_graphics.s @@ -0,0 +1,1077 @@ + .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, =gUnknown_0203BD28 + movs r0, 0 + strh r0, [r1] + ldr r1, =gUnknown_0300301C + 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, =gUnknown_0300301C + movs r0, 0x8 + strb r0, [r1] + ldr r1, =gUnknown_0203BD28 + 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, =gTasks + 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, =gTasks + 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, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + 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, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + 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, =gUnknown_0203BD24 + ldrh r1, [r0] + movs r0, 0x1A + bl SetGpuReg +_0817B4FA: + ldr r0, =gTasks + 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, =gUnknown_0203BD24 + 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, =gUnknown_030022C0 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =gUnknown_02037FD4 + 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, =gUnknown_02037714 + ldrh r1, [r2, 0x12] + mov r0, sp + strh r1, [r0] + ldrh r1, [r2, 0x14] + b _0817B596 + .pool +_0817B58C: + ldr r2, =gUnknown_02037714 + 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, =gUnknown_030022C0 + ldr r2, [r0, 0x20] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0 + bne _0817B620 + ldr r0, =gUnknown_02037FD4 + 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, =gUnknown_0203BD28 + 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, =gUnknown_0203BD24 + ldr r0, =gUnknown_0203BD26 + ldrh r0, [r0] + ldrh r1, [r1] + adds r0, r1 + b _0817B68C + .pool +_0817B688: + ldr r0, =gUnknown_0203BD24 + 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, =gUnknown_02020630 + 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, =gUnknown_02020638 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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, =gUnknown_02020630 + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_81795E8.s b/asm/pokeblock_feed.s similarity index 75% rename from asm/rom_81795E8.s rename to asm/pokeblock_feed.s index 297741afd..5842d18b8 100644 --- a/asm/rom_81795E8.s +++ b/asm/pokeblock_feed.s @@ -5,625 +5,6 @@ .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, =gSaveBlock1Ptr - 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, =gUnknown_020244EC - 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, =gUnknown_020244E9 - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gSaveBlock1Ptr - 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, =gUnknown_0203BD14 - 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, =gUnknown_02038C08 - 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, =gSaveBlock1Ptr - 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, =gUnknown_0203BD14 - 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, =gUnknown_02038C08 - 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, =gUnknown_0203BD14 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081799E4 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldr r2, =sub_8179934 - b _081799F0 - .pool -_081799E4: - ldr r1, =gTasks - 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, =gSaveBlock1Ptr - 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, =gSaveBlock1Ptr - 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} diff --git a/asm/rom_806BD04.s b/asm/pokemon_3.s similarity index 100% rename from asm/rom_806BD04.s rename to asm/pokemon_3.s diff --git a/asm/rom_80A3934.s b/asm/rom_80A5C6C.s similarity index 60% rename from asm/rom_80A3934.s rename to asm/rom_80A5C6C.s index f150be3ea..7382ec1bb 100644 --- a/asm/rom_80A3934.s +++ b/asm/rom_80A5C6C.s @@ -5,4203 +5,6 @@ .text - thumb_func_start sub_80A3934 -sub_80A3934: @ 80A3934 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gUnknown_020383FC - movs r1, 0 - strb r1, [r0] - ldr r0, =gUnknown_020383FD - strb r1, [r0] - ldr r0, =gUnknown_020383FE - strb r1, [r0] - ldr r0, =gUnknown_020383FF - strb r1, [r0] - ldr r0, =gUnknown_02038400 - movs r1, 0 - str r1, [r0] - ldr r0, =gUnknown_02038404 - str r1, [r0] - ldr r0, =gUnknown_02038408 - movs r2, 0 - strh r1, [r0] - ldr r0, =gUnknown_0203841A - strb r2, [r0] - ldr r4, =gUnknown_02038430 - ldr r5, =gUnknown_02038432 - ldr r6, =gUnknown_02038433 - ldr r7, =gUnknown_02038434 - ldr r0, =gUnknown_02038436 - mov r12, r0 - ldr r1, =gUnknown_02038437 - mov r8, r1 - ldr r0, =gUnknown_02038440 - mov r9, r0 - ldr r1, =0x0000ffff - adds r3, r1, 0 - ldr r1, =gUnknown_0203840A - movs r2, 0x7 -_080A397E: - ldrh r0, [r1] - orrs r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A397E - ldr r1, =gUnknown_0203841E - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3994: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3994 - movs r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r0, 0x1 - negs r0, r0 - strb r0, [r4, 0x1] - strb r1, [r5] - strb r1, [r6] - movs r0, 0 - strh r1, [r7] - mov r1, r12 - strb r0, [r1] - mov r1, r8 - strb r0, [r1] - mov r1, r9 - strb r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3934 - - thumb_func_start move_anim_start_t1 -move_anim_start_t1: @ 80A3A10 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =gUnknown_02038436 - ldr r0, =gUnknown_0202420B - ldrb r0, [r0] - strb r0, [r2] - ldr r2, =gUnknown_02038437 - ldr r0, =gUnknown_0202420C - ldrb r0, [r0] - strb r0, [r2] - ldr r0, =gUnknown_082C8D6C - movs r2, 0x1 - bl move_something - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_start_t1 - - thumb_func_start move_something -move_something: @ 80A3A48 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - str r0, [sp] - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A3AE8 - bl sub_80A8278 - movs r0, 0 - bl sub_8072A88 - movs r4, 0 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r6, =gUnknown_0202406E - movs r7, 0x64 - ldr r5, =gUnknown_02038438 -_080A3A84: - lsls r0, r4, 24 - lsrs r0, 24 - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - beq _080A3AA8 - ldrh r0, [r6] - muls r0, r7 - ldr r1, =gUnknown_02024744 - b _080A3AAE - .pool -_080A3AA8: - ldrh r0, [r6] - muls r0, r7 - ldr r1, =gUnknown_020244EC -_080A3AAE: - adds r0, r1 - movs r1, 0xB - bl pokemon_getattr - strh r0, [r5] - adds r6, 0x2 - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _080A3A84 - ldr r3, =gUnknown_02038434 - ldr r5, =gUnknown_02038430 - ldr r1, =gUnknown_020383FD - mov r12, r1 - ldr r7, =gUnknown_020383F8 - ldr r6, =move_anim_execute - b _080A3B10 - .pool -_080A3AE8: - ldr r3, =gUnknown_02038434 - ldr r5, =gUnknown_02038430 - mov r0, r8 - lsls r0, 2 - mov r10, r0 - ldr r1, =gUnknown_020383FD - mov r12, r1 - ldr r7, =gUnknown_020383F8 - ldr r6, =move_anim_execute - ldr r2, =gUnknown_02039F34 - ldr r1, =gUnknown_02038438 - movs r4, 0x3 -_080A3B00: - ldr r0, [r2] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B00 -_080A3B10: - mov r0, r9 - cmp r0, 0 - bne _080A3B38 - strh r0, [r3] - b _080A3B3C - .pool -_080A3B38: - mov r1, r8 - strh r1, [r3] -_080A3B3C: - ldr r1, =gUnknown_0203841E - movs r2, 0 - adds r0, r1, 0 - adds r0, 0xE -_080A3B44: - strh r2, [r0] - subs r0, 0x2 - cmp r0, r1 - bge _080A3B44 - movs r0, 0xFF - strb r0, [r5] - movs r0, 0x1 - negs r0, r0 - strb r0, [r5, 0x1] - ldr r0, [sp] - add r0, r10 - ldr r0, [r0] - ldr r1, =gUnknown_020383F0 - str r0, [r1] - movs r0, 0x1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - ldr r1, =gUnknown_020383FC - strb r0, [r1] - str r6, [r7] - ldr r0, =0x0000ffff - adds r2, r0, 0 - ldr r1, =gUnknown_0203840A - movs r4, 0x7 -_080A3B76: - ldrh r0, [r1] - orrs r0, r2 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A3B76 - mov r1, r9 - cmp r1, 0 - beq _080A3BC2 - movs r4, 0 - ldr r2, =gUnknown_082C8D64 - b _080A3BAA - .pool -_080A3BA8: - adds r4, 0x1 -_080A3BAA: - lsls r0, r4, 1 - adds r0, r2 - ldrh r0, [r0] - ldr r1, =0x0000ffff - cmp r0, r1 - beq _080A3BC2 - cmp r8, r0 - bne _080A3BA8 - ldr r0, =gMPlay_BGM - movs r2, 0x80 - bl m4aMPlayVolumeControl -_080A3BC2: - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E26 - strh r1, [r0] - ldr r0, =gUnknown_02022E28 - strh r1, [r0] - ldr r0, =gUnknown_02022E2A - strh r1, [r0] - 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 move_something - - thumb_func_start move_anim_8072740 -move_anim_8072740: @ 80A3BFC - push {r4,lr} - adds r4, r0, 0 - bl obj_free_rotscale_entry - adds r0, r4, 0 - bl RemoveObjectAndFreeTiles - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_8072740 - - thumb_func_start move_anim_task_del -move_anim_task_del: @ 80A3C1C - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_task_del - - thumb_func_start move_anim_related_task_del -move_anim_related_task_del: @ 80A3C38 - push {lr} - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_related_task_del - - thumb_func_start sub_80A3C54 -sub_80A3C54: @ 80A3C54 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r4, =0x0000ffff - ldr r1, =gUnknown_0203840A -_080A3C60: - ldrh r0, [r1] - cmp r0, r4 - bne _080A3C74 - strh r3, [r1] - b _080A3C7C - .pool -_080A3C74: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C60 -_080A3C7C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C54 - - thumb_func_start sub_80A3C84 -sub_80A3C84: @ 80A3C84 - push {r4,lr} - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r0, =0x0000ffff - adds r4, r0, 0 - ldr r1, =gUnknown_0203840A -_080A3C92: - ldrh r0, [r1] - cmp r0, r3 - bne _080A3CA8 - orrs r0, r4 - strh r0, [r1] - b _080A3CB0 - .pool -_080A3CA8: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x7 - ble _080A3C92 -_080A3CB0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A3C84 - - thumb_func_start move_anim_waiter -move_anim_waiter: @ 80A3CB8 - push {lr} - ldr r2, =gUnknown_020383FC - ldrb r1, [r2] - movs r0, 0 - ldrsb r0, [r2, r0] - cmp r0, 0 - bgt _080A3CDC - ldr r0, =gUnknown_020383F8 - ldr r1, =move_anim_execute - str r1, [r0] - movs r0, 0 - b _080A3CDE - .pool -_080A3CDC: - subs r0, r1, 0x1 -_080A3CDE: - strb r0, [r2] - pop {r0} - bx r0 - thumb_func_end move_anim_waiter - - thumb_func_start move_anim_execute -move_anim_execute: @ 80A3CE4 - push {r4,lr} - ldr r4, =gUnknown_08525E98 -_080A3CE8: - ldr r0, =gUnknown_020383F0 - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r4 - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gUnknown_020383FC - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bne _080A3D0C - ldr r0, =gUnknown_020383FD - ldrb r0, [r0] - cmp r0, 0 - bne _080A3CE8 -_080A3D0C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end move_anim_execute - - thumb_func_start ma00_load_graphics -ma00_load_graphics: @ 80A3D24 - push {r4-r6,lr} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - lsls r5, r4, 3 - ldr r0, =gUnknown_085112C4 - adds r0, r5, r0 - bl LoadCompressedObjectPicUsingHeap - ldr r0, =gUnknown_08511BCC - adds r5, r0 - adds r0, r5, 0 - bl LoadCompressedObjectPaletteUsingHeap - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C54 - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma00_load_graphics - - thumb_func_start ma01_080728D0 -@ void ma01_080728D0() -ma01_080728D0: @ 80A3D8C - push {r4-r6,lr} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - ldr r1, =gUnknown_08524B44 - ldr r0, =0xffffd8f0 - adds r4, r0 - lsls r0, r4, 3 - adds r0, r1 - ldrh r5, [r0, 0x6] - adds r0, r5, 0 - bl FreeObjectTilesByTag - adds r0, r5, 0 - bl FreeObjectPaletteByTag - ldr r0, [r6] - adds r0, 0x2 - str r0, [r6] - lsls r4, 16 - lsrs r4, 16 - adds r0, r4, 0 - bl sub_80A3C84 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma01_080728D0 - - thumb_func_start ma02_instanciate_template -ma02_instanciate_template: @ 80A3DD8 - push {r4-r7,lr} - ldr r5, =gUnknown_020383F0 - ldr r1, [r5] - adds r3, r1, 0x1 - str r3, [r5] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r7, r2, r0 - adds r0, r1, 0x5 - str r0, [r5] - ldrb r4, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r5] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r5] - cmp r0, 0 - beq _080A3E28 - adds r6, r5, 0 - ldr r5, =gUnknown_0203841E - adds r3, r0, 0 -_080A3E10: - ldr r2, [r6] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r5] - adds r2, 0x2 - str r2, [r6] - adds r5, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3E10 -_080A3E28: - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _080A3E58 - movs r0, 0x80 - eors r4, r0 - cmp r4, 0x3F - bls _080A3E48 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E4A - .pool -_080A3E48: - negs r0, r4 -_080A3E4A: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_02038437 - b _080A3E6A - .pool -_080A3E58: - cmp r4, 0x3F - bls _080A3E62 - adds r0, r4, 0 - subs r0, 0x40 - b _080A3E64 -_080A3E62: - negs r0, r4 -_080A3E64: - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_02038436 -_080A3E6A: - ldrb r0, [r0] - bl sub_80A82E4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 24 - asrs r1, 24 - adds r0, r1 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r0, r6, 16 - asrs r0, 16 - cmp r0, 0x2 - bgt _080A3E88 - movs r6, 0x3 -_080A3E88: - ldr r5, =gUnknown_02038437 - 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 - lsls r3, r6, 24 - lsrs r3, 24 - adds r0, r7, 0 - adds r1, r4, 0 - bl AddObjectAndAnimateForOneFrame - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end ma02_instanciate_template - - thumb_func_start sub_80A3ECC -sub_80A3ECC: @ 80A3ECC - push {r4-r7,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r7, [r1, 0x5] - adds r0, r1, 0x6 - str r0, [r4] - ldrb r0, [r1, 0x6] - adds r1, 0x7 - str r1, [r4] - cmp r0, 0 - beq _080A3F1C - adds r5, r4, 0 - ldr r4, =gUnknown_0203841E - adds r3, r0, 0 -_080A3F04: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A3F04 -_080A3F1C: - adds r0, r6, 0 - adds r1, r7, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3ECC - - thumb_func_start ma04_wait_countdown -ma04_wait_countdown: @ 80A3F48 - push {r4,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r2, r0, 0x1 - str r2, [r1] - ldr r3, =gUnknown_020383FC - ldrb r0, [r0, 0x1] - strb r0, [r3] - lsls r0, 24 - cmp r0, 0 - bne _080A3F66 - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - strb r0, [r3] -_080A3F66: - adds r0, r2, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma04_wait_countdown - - thumb_func_start sub_80A3F88 -sub_80A3F88: @ 80A3F88 - push {lr} - ldr r0, =gUnknown_020383FE - ldrb r2, [r0] - cmp r2, 0 - bne _080A3FAC - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =gUnknown_020383FC - strb r2, [r0] - b _080A3FB2 - .pool -_080A3FAC: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] -_080A3FB2: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3F88 - - thumb_func_start nullsub_6 -nullsub_6: @ 80A3FBC - bx lr - thumb_func_end nullsub_6 - - thumb_func_start nullsub_7 -nullsub_7: @ 80A3FC0 - bx lr - thumb_func_end nullsub_7 - - thumb_func_start sub_80A3FC4 -sub_80A3FC4: @ 80A3FC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r0, 0 - mov r8, r0 - ldr r0, =gUnknown_020383FE - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r0, =gUnknown_020383FF - ldrb r0, [r0] - cmp r0, 0 - bne _080A3FEC - ldr r1, =gUnknown_02038430 - ldrb r0, [r1] - cmp r0, 0xFF - bne _080A3FEC - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - beq _080A4004 -_080A3FEC: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] - b _080A401E - .pool -_080A4004: - bl mplay_has_finished_maybe - lsls r0, 24 - cmp r0, 0 - beq _080A403C - ldr r1, =gUnknown_0203842E - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bhi _080A4030 -_080A401E: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - b _080A40A2 - .pool -_080A4030: - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop -_080A403C: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] - movs r5, 0 - ldr r7, =0x0000ffff - ldr r6, =gUnknown_08524B44 - ldr r4, =gUnknown_0203840A -_080A404A: - ldrh r0, [r4] - cmp r0, r7 - beq _080A406E - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectTilesByTag - ldrh r0, [r4] - lsls r0, 3 - adds r0, r6 - ldrh r0, [r0, 0x6] - bl FreeObjectPaletteByTag - ldrh r1, [r4] - adds r0, r7, 0 - orrs r0, r1 - strh r0, [r4] -_080A406E: - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A404A - mov r1, r8 - cmp r1, 0 - bne _080A40A2 - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A409C - bl sub_80A8278 - movs r0, 0x1 - bl sub_8072A88 -_080A409C: - ldr r0, =gUnknown_020383FD - mov r1, r8 - strb r1, [r0] -_080A40A2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A3FC4 - - thumb_func_start ma09_play_sound -ma09_play_sound: @ 80A40CC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - adds r1, r0, 0x1 - str r1, [r4] - ldrb r0, [r0, 0x1] - ldrb r1, [r1, 0x1] - lsls r1, 8 - orrs r0, r1 - bl audio_play - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma09_play_sound - - thumb_func_start sub_80A40F4 -sub_80A40F4: @ 80A40F4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - mov r8, r1 - adds r6, r0, r1 - ldr r1, =gUnknown_020241E4 - movs r2, 0 - ldrsh r0, [r6, r2] - adds r0, r1 - ldrb r5, [r0] - ldr r1, =gUnknown_02020630 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r4, r0, r1 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - movs r3, 0x4 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4148 - adds r0, r7, 0 - bl move_anim_task_del - b _080A41BE - .pool -_080A4148: - ldr r0, =task_pA_ma0A_obj_to_bg_pal - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - mov r1, r8 - subs r1, 0x8 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r5, [r1, 0x8] - ldrh r0, [r4, 0x24] - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r1, 0xA] - ldrh r0, [r4, 0x26] - ldrh r4, [r4, 0x22] - adds r0, r4 - strh r0, [r1, 0xC] - movs r3, 0x2 - ldrsh r0, [r6, r3] - cmp r0, 0 - bne _080A4190 - ldr r0, =gUnknown_02022E18 - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =gUnknown_02022E1A - b _080A4198 - .pool -_080A4190: - ldr r0, =gUnknown_02022E1C - ldrh r0, [r0] - strh r0, [r1, 0xE] - ldr r0, =gUnknown_02022E1E -_080A4198: - ldrh r0, [r0] - strh r0, [r1, 0x10] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r6, 0x2] - strh r1, [r0, 0x12] - ldrh r1, [r6] - strh r1, [r0, 0x14] - ldr r1, =gUnknown_02038430 - movs r3, 0x6 - ldrsh r0, [r6, r3] - adds r0, r1 - strb r2, [r0] - adds r0, r7, 0 - bl move_anim_task_del -_080A41BE: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A40F4 - - thumb_func_start sub_80A41D8 -sub_80A41D8: @ 80A41D8 - push {r4,r5,lr} - ldr r1, =gUnknown_020383F0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r0, [r2, 0x1] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A41F8 - ldr r0, =gUnknown_02038437 - b _080A41FA - .pool -_080A41F8: - ldr r0, =gUnknown_02038436 -_080A41FA: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4266 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4226 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4230 -_080A4226: - movs r5, 0 - b _080A4232 - .pool -_080A4230: - movs r5, 0x1 -_080A4232: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r2, 0 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r2, [r0, 0xE] -_080A4266: - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A42D8 - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4294 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A42A4 -_080A4294: - movs r5, 0 - b _080A42A6 - .pool -_080A42A4: - movs r5, 0x1 -_080A42A6: - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0 - bl sub_80A438C - ldr r0, =sub_80A40F4 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gUnknown_020383FE - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r4, [r0, 0x8] - strh r5, [r0, 0xA] - movs r1, 0x1 - strh r1, [r0, 0xC] - strh r1, [r0, 0xE] -_080A42D8: - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - ldr r1, =gUnknown_020383F8 - ldr r0, =move_anim_waiter - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A41D8 - - thumb_func_start b_side_obj__get_some_boolean -b_side_obj__get_some_boolean: @ 80A4310 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4330 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - cmp r4, r0 - beq _080A4374 - b _080A4384 - .pool -_080A4330: - adds r0, r4, 0 - bl sub_80A6A90 - lsls r0, 24 - cmp r0, 0 - beq _080A4384 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4374 - ldr r0, =gUnknown_020244D0 - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r5, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4374 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r5, 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, 29 - cmp r0, 0 - blt _080A4384 -_080A4374: - movs r0, 0x1 - b _080A4386 - .pool -_080A4384: - movs r0, 0 -_080A4386: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end b_side_obj__get_some_boolean - - thumb_func_start sub_80A438C -sub_80A438C: @ 80A438C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r1, 24 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - cmp r1, 0 - beq _080A43AA - b _080A455E -_080A43AA: - bl sub_80A4DF0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A43DC - ldr r1, =0x06008000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill - b _080A43F8 - .pool -_080A43DC: - ldr r1, =0x06004000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600e000 - movs r2, 0x80 - lsls r2, 5 - movs r0, 0xFF - movs r3, 0 - bl RequestDma3Fill -_080A43F8: - add r0, sp, 0x10 - bl sub_80A6B30 - add r0, sp, 0x20 - movs r1, 0 - strh r1, [r0] - ldr r1, [sp, 0x10] - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x22 - movs r1, 0xFF - strh r1, [r0] - ldr r1, [sp, 0x14] - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =gUnknown_020241E4 - adds r0, r6, r0 - ldrb r4, [r0] - ldr r5, =gUnknown_02022E18 - ldr r0, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A447A - ldrh r0, [r5] - subs r0, 0x1 - strh r0, [r5] -_080A447A: - ldr r5, =gUnknown_02022E1A - ldr r2, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - mov r0, r9 - cmp r0, 0 - beq _080A44B0 - ldr r0, =gUnknown_020241E4 - adds r0, r6, 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] -_080A44B0: - ldr r0, =gUnknown_02022E18 - ldrh r1, [r0] - movs r0, 0x14 - bl SetGpuReg - ldrh r1, [r5] - movs r0, 0x16 - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =gUnknown_02037914 - adds r4, r0 - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 4 - adds r0, r4, 0 - movs r2, 0x20 - bl gpu_pal_apply - add r0, sp, 0x10 - ldrb r1, [r0, 0x8] - lsls r1, 5 - movs r0, 0xA0 - lsls r0, 19 - adds r1, r0 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4524 - movs r3, 0 - b _080A452E - .pool -_080A4524: - adds r0, r6, 0 - bl battle_get_per_side_status - lsls r0, 24 - lsrs r3, r0, 24 -_080A452E: - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A4558 - b _080A4666 -_080A4558: - bl sub_80A46A0 - b _080A4666 -_080A455E: - ldr r1, =0x06006000 - movs r2, 0x80 - lsls r2, 6 - movs r0, 0 - movs r3, 0x1 - bl RequestDma3Fill - ldr r1, =0x0600f000 - movs r7, 0x80 - lsls r7, 5 - movs r0, 0 - adds r2, r7, 0 - movs r3, 0x1 - bl RequestDma3Fill - add r0, sp, 0x10 - movs r1, 0x2 - bl sub_80A6B90 - add r0, sp, 0x24 - movs r4, 0 - strh r4, [r0] - ldr r1, [sp, 0x10] - adds r1, r7 - ldr r2, =0x01000800 - bl CpuSet - mov r0, sp - adds r0, 0x26 - strh r4, [r0] - ldr r1, [sp, 0x14] - movs r2, 0x80 - lsls r2, 4 - mov r8, r2 - add r1, r8 - ldr r2, =0x01000400 - bl CpuSet - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0 - bl lcd_bg_operations - ldr r0, =gUnknown_020241E4 - adds r2, r5, r0 - ldrb r4, [r2] - ldr r5, =gUnknown_02022E1C - ldr r3, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r1, 0x24] - ldrh r4, [r1, 0x20] - adds r0, r4 - negs r0, r0 - adds r0, 0x20 - strh r0, [r5] - ldr r4, =gUnknown_02022E1E - ldrh r0, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r0, r1 - negs r0, r0 - adds r0, 0x20 - strh r0, [r4] - mov r0, r9 - cmp r0, 0 - beq _080A460E - 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] -_080A460E: - ldrh r1, [r5] - movs r0, 0x18 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x1A - bl SetGpuReg - lsls r4, r6, 5 - ldr r0, =gUnknown_02037914 - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x90 - movs r2, 0x20 - bl gpu_pal_apply - ldr r1, =0x05000120 - ldr r2, =0x04000008 - adds r0, r4, 0 - bl CpuSet - adds r0, r6, 0 - bl battle_get_per_side_status - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0x10 - ldrb r0, [r0, 0x8] - str r0, [sp] - ldr r0, [sp, 0x10] - adds r0, r7 - str r0, [sp, 0x4] - ldr r0, [sp, 0x14] - add r0, r8 - str r0, [sp, 0x8] - add r0, sp, 0x10 - ldrh r0, [r0, 0xA] - str r0, [sp, 0xC] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl sub_8118FBC -_080A4666: - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A438C - - thumb_func_start sub_80A46A0 -sub_80A46A0: @ 80A46A0 - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =gUnknown_02039F34 - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl sub_80DB2A8 - lsls r0, 24 - cmp r0, 0 - beq _080A4712 - mov r0, sp - bl sub_80A6B30 - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_080A46C6: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_080A46D0: - 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 _080A46D0 - movs r0, 0x20 - add r12, r0 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _080A46C6 - movs r5, 0 - movs r1, 0x80 - lsls r1, 3 - adds r3, r1, 0 -_080A46F6: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_080A46FE: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _080A46FE - adds r5, r2, 0 - cmp r5, 0x7 - ble _080A46F6 -_080A4712: - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A46A0 - - thumb_func_start sub_80A4720 -sub_80A4720: @ 80A4720 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - adds r6, r2, 0 - lsls r0, 16 - lsrs r5, r0, 16 - lsls r3, 24 - movs r0, 0x40 - mov r12, r0 - cmp r3, 0 - bne _080A473C - movs r1, 0x20 - mov r12, r1 -_080A473C: - lsls r0, r5, 28 - lsrs r5, r0, 16 - movs r0, 0 - cmp r0, r12 - bge _080A476C - ldr r7, =0x00000fff -_080A4748: - adds r4, r0, 0x1 - lsls r0, 6 - mov r1, r8 - adds r3, r0, r1 - movs r2, 0x1F -_080A4752: - ldrh r1, [r3] - adds r0, r7, 0 - ands r0, r1 - orrs r0, r5 - adds r0, r6 - strh r0, [r3] - adds r3, 0x2 - subs r2, 0x1 - cmp r2, 0 - bge _080A4752 - adds r0, r4, 0 - cmp r0, r12 - blt _080A4748 -_080A476C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4720 - - thumb_func_start sub_80A477C -sub_80A477C: @ 80A477C - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r0, sp - bl sub_80A6B30 - cmp r4, 0 - beq _080A479C - bl sub_80A4DF0 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _080A47B8 -_080A479C: - movs r0, 0x1 - bl sub_80A6C68 - ldr r0, =gUnknown_02022E18 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E1A - strh r1, [r0] - b _080A47C6 - .pool -_080A47B8: - movs r0, 0x2 - bl sub_80A6C68 - ldr r0, =gUnknown_02022E1C - strh r4, [r0] - ldr r0, =gUnknown_02022E1E - strh r4, [r0] -_080A47C6: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A477C - - thumb_func_start task_pA_ma0A_obj_to_bg_pal -@ void task_pA_ma0A_obj_to_bg_pal(int task_id) -task_pA_ma0A_obj_to_bg_pal: @ 80A47D8 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r4, [r5, 0x8] - ldrb r6, [r5, 0x14] - mov r0, sp - bl sub_80A6B30 - ldr r0, =gUnknown_02020630 - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r1, 0x24] - ldrh r0, [r1, 0x20] - adds r2, r0 - ldrh r0, [r5, 0xA] - subs r0, r2 - lsls r0, 16 - lsrs r3, r0, 16 - ldrh r2, [r1, 0x26] - ldrh r1, [r1, 0x22] - adds r2, r1 - ldrh r0, [r5, 0xC] - subs r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - movs r1, 0x12 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _080A4870 - ldr r1, =gUnknown_02022E18 - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r2, =gUnknown_02037D14 - adds r0, r2 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 5 - ldr r3, =0xfffffe00 - adds r2, r3 - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - b _080A4896 - .pool -_080A4870: - ldr r1, =gUnknown_02022E1C - lsls r0, r3, 16 - asrs r0, 16 - ldrh r3, [r5, 0xE] - adds r0, r3 - strh r0, [r1] - ldr r1, =gUnknown_02022E1E - lsls r0, r2, 16 - asrs r0, 16 - ldrh r5, [r5, 0x10] - adds r0, r5 - strh r0, [r1] - lsls r0, r6, 5 - ldr r1, =gUnknown_02037D14 - adds r0, r1 - subs r1, 0xE0 - ldr r2, =0x04000008 - bl CpuSet -_080A4896: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end task_pA_ma0A_obj_to_bg_pal - - thumb_func_start ma0B_0807324C -ma0B_0807324C: @ 80A48B0 - push {r4,r5,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r4, [r2, 0x1] - cmp r4, 0 - bne _080A48C8 - movs r4, 0x2 - b _080A48D2 - .pool -_080A48C8: - cmp r4, 0x1 - bne _080A48CE - movs r4, 0x3 -_080A48CE: - cmp r4, 0 - beq _080A48D6 -_080A48D2: - cmp r4, 0x2 - bne _080A48E0 -_080A48D6: - ldr r0, =gUnknown_02038436 - b _080A48E2 - .pool -_080A48E0: - ldr r0, =gUnknown_02038437 -_080A48E2: - ldrb r5, [r0] - ldr r3, =gUnknown_02038430 - ldrb r0, [r3] - cmp r0, 0xFF - beq _080A4908 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r5, 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] -_080A4908: - cmp r4, 0x1 - bls _080A4948 - ldrb r0, [r3, 0x1] - cmp r0, 0xFF - beq _080A4948 - ldr r3, =gUnknown_02020630 - ldr r2, =gUnknown_020241E4 - movs r1, 0x2 - adds r0, r5, 0 - eors r0, r1 - adds r0, r2 - 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] - b _080A494A - .pool -_080A4948: - movs r4, 0 -_080A494A: - ldr r0, =sub_80A4980 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - strh r5, [r1, 0xC] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0B_0807324C - - thumb_func_start sub_80A4980 -sub_80A4980: @ 80A4980 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4A0A - ldrb r0, [r1, 0xC] - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A49BC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A49C4 -_080A49BC: - movs r4, 0 - b _080A49C6 - .pool -_080A49C4: - movs r4, 0x1 -_080A49C6: - ldr r6, =gUnknown_02038430 - ldrb r0, [r6] - cmp r0, 0xFF - beq _080A49DE - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6] - bl DestroyTask - movs r0, 0xFF - strb r0, [r6] -_080A49DE: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4A04 - movs r0, 0x1 - eors r4, r0 - adds r0, r4, 0 - bl sub_80A477C - ldrb r0, [r6, 0x1] - bl DestroyTask - movs r0, 0xFF - strb r0, [r6, 0x1] -_080A4A04: - adds r0, r5, 0 - bl DestroyTask -_080A4A0A: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4980 - - thumb_func_start sub_80A4A18 -sub_80A4A18: @ 80A4A18 - push {r4,r5,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4A30 - movs r5, 0x2 - b _080A4A3A - .pool -_080A4A30: - cmp r5, 0x1 - bne _080A4A36 - movs r5, 0x3 -_080A4A36: - cmp r5, 0 - beq _080A4A3E -_080A4A3A: - cmp r5, 0x2 - bne _080A4A48 -_080A4A3E: - ldr r0, =gUnknown_02038436 - b _080A4A4A - .pool -_080A4A48: - ldr r0, =gUnknown_02038437 -_080A4A4A: - ldrb r4, [r0] - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4A8A - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4A76 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4A80 -_080A4A76: - movs r1, 0 - b _080A4A82 - .pool -_080A4A80: - movs r1, 0x1 -_080A4A82: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4A8A: - movs r0, 0x2 - eors r4, r0 - cmp r5, 0x1 - bls _080A4ACA - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4ACA - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4ABC - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4AC0 -_080A4ABC: - movs r1, 0 - b _080A4AC2 -_080A4AC0: - movs r1, 0x1 -_080A4AC2: - adds r0, r4, 0 - movs r2, 0 - bl sub_80A438C -_080A4ACA: - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4A18 - - thumb_func_start ma23_8073484 -ma23_8073484: @ 80A4ADC - push {r4-r6,lr} - ldr r0, =gUnknown_020383F0 - ldr r2, [r0] - adds r1, r2, 0x1 - str r1, [r0] - ldrb r5, [r2, 0x1] - cmp r5, 0 - bne _080A4AF4 - movs r5, 0x2 - b _080A4AFE - .pool -_080A4AF4: - cmp r5, 0x1 - bne _080A4AFA - movs r5, 0x3 -_080A4AFA: - cmp r5, 0 - beq _080A4B02 -_080A4AFE: - cmp r5, 0x2 - bne _080A4B0C -_080A4B02: - ldr r0, =gUnknown_02038436 - b _080A4B0E - .pool -_080A4B0C: - ldr r0, =gUnknown_02038437 -_080A4B0E: - ldrb r6, [r0] - adds r0, r6, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B38 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - adds r0, r6, 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] -_080A4B38: - cmp r5, 0x1 - bls _080A4B78 - movs r0, 0x2 - adds r4, r6, 0 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4B78 - ldr r2, =gUnknown_02020630 - ldr r0, =gUnknown_020241E4 - 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] - b _080A4B7A - .pool -_080A4B78: - movs r5, 0 -_080A4B7A: - ldr r0, =sub_80A4BB0 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r6, [r1, 0xC] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma23_8073484 - - thumb_func_start sub_80A4BB0 -sub_80A4BB0: @ 80A4BB0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r1, r0, r1 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _080A4C3E - ldrb r4, [r1, 0xC] - adds r0, r4, 0 - bl battle_get_per_side_status - lsls r0, 24 - movs r1, 0xFF - lsls r1, 24 - adds r0, r1 - lsrs r0, 24 - cmp r0, 0x1 - bls _080A4BEE - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4BF8 -_080A4BEE: - movs r5, 0 - b _080A4BFA - .pool -_080A4BF8: - movs r5, 0x1 -_080A4BFA: - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C0C - adds r0, r5, 0 - bl sub_80A477C -_080A4C0C: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _080A4C38 - movs r0, 0x2 - eors r4, r0 - adds r0, r4, 0 - bl b_side_obj__get_some_boolean - lsls r0, 24 - cmp r0, 0 - beq _080A4C38 - movs r0, 0x1 - eors r5, r0 - adds r0, r5, 0 - bl sub_80A477C -_080A4C38: - adds r0, r6, 0 - bl DestroyTask -_080A4C3E: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4BB0 - - thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument -ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: @ 80A4C48 - push {r4,r5,lr} - ldr r2, =gUnknown_020383F0 - ldr r0, [r2] - adds r1, r0, 0x1 - str r1, [r2] - ldrb r5, [r0, 0x1] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r4, [r1, 0x1] - lsls r4, 8 - adds r0, 0x1 - str r0, [r2] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - orrs r5, r4 - movs r0, 0x52 - adds r1, r5, 0 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument - - thumb_func_start ma1E_set_BLDCNT -ma1E_set_BLDCNT: @ 80A4C80 - push {lr} - ldr r3, =gUnknown_020383F0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - adds r0, r2, 0x1 - str r0, [r3] - ldrb r2, [r2, 0x1] - lsls r2, 8 - adds r0, 0x1 - str r0, [r3] - orrs r1, r2 - movs r0, 0x50 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma1E_set_BLDCNT - - thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA -ma0D_reset_BLDCNT_and_BLDALPHA: @ 80A4CA8 - push {lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA - - thumb_func_start ma0E_call -ma0E_call: @ 80A4CCC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldr r2, =gUnknown_020383F4 - adds r0, r1, 0x5 - str r0, [r2] - ldrb r1, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma0E_call - - thumb_func_start sub_80A4D00 -sub_80A4D00: @ 80A4D00 - ldr r0, =gUnknown_020383F0 - ldr r1, =gUnknown_020383F4 - ldr r1, [r1] - str r1, [r0] - bx lr - .pool - thumb_func_end sub_80A4D00 - - thumb_func_start ma10_080736AC -ma10_080736AC: @ 80A4D14 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r1, [r5] - adds r0, r1, 0x1 - str r0, [r5] - ldrb r2, [r1, 0x1] - adds r3, r0, 0x1 - str r3, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - orrs r4, r0 - adds r1, 0x4 - str r1, [r5] - ldr r0, =gUnknown_0203841E - lsls r2, 1 - adds r2, r0 - strh r4, [r2] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma10_080736AC - - thumb_func_start ma11_if_else -ma11_if_else: @ 80A4D48 - push {lr} - ldr r3, =gUnknown_020383F0 - ldr r2, [r3] - adds r0, r2, 0x1 - str r0, [r3] - ldr r0, =gUnknown_02038432 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080A4D62 - adds r0, r2, 0x5 - str r0, [r3] -_080A4D62: - ldr r2, [r3] - 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] - pop {r0} - bx r0 - .pool - thumb_func_end ma11_if_else - - thumb_func_start ma12_cond_if -ma12_cond_if: @ 80A4D88 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r4, [r5] - adds r2, r4, 0x1 - str r2, [r5] - ldrb r1, [r4, 0x1] - adds r3, r2, 0x1 - str r3, [r5] - ldr r0, =gUnknown_02038432 - ldrb r0, [r0] - cmp r1, r0 - bne _080A4DC0 - ldrb r1, [r2, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A4DC4 - .pool -_080A4DC0: - adds r0, r4, 0x6 - str r0, [r5] -_080A4DC4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end ma12_cond_if - - thumb_func_start ma13_goto -ma13_goto: @ 80A4DCC - ldr r3, =gUnknown_020383F0 - ldr r0, [r3] - adds r2, r0, 0x1 - str r2, [r3] - ldrb r1, [r0, 0x1] - 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] - bx lr - .pool - thumb_func_end ma13_goto - - thumb_func_start sub_80A4DF0 -sub_80A4DF0: @ 80A4DF0 - push {lr} - ldr r0, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080A4E10 - movs r0, 0 - b _080A4E12 - .pool -_080A4E10: - movs r0, 0x1 -_080A4E12: - pop {r1} - bx r1 - thumb_func_end sub_80A4DF0 - - thumb_func_start ma14_load_background -ma14_load_background: @ 80A4E18 - push {r4,lr} - ldr r1, =gUnknown_020383F0 - ldr r2, [r1] - adds r0, r2, 0x1 - str r0, [r1] - ldrb r4, [r2, 0x1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma14_load_background - - thumb_func_start sub_80A4E5C -sub_80A4E5C: @ 80A4E5C - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r2, =gUnknown_020383F0 - ldr r1, [r2] - adds r0, r1, 0x1 - str r0, [r2] - ldrb r3, [r1, 0x1] - mov r8, r3 - ldrb r7, [r0, 0x1] - ldrb r6, [r0, 0x2] - adds r1, 0x4 - str r1, [r2] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A4EA8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] - b _080A4EDA - .pool -_080A4EA8: - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A4ECC - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - strh r7, [r0, 0x8] - b _080A4EDA - .pool -_080A4ECC: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - mov r1, r8 - strh r1, [r0, 0x8] -_080A4EDA: - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4E5C - - thumb_func_start task_p5_load_battle_screen_elements -task_p5_load_battle_screen_elements: @ 80A4EF4 - push {r4-r7,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrh r6, [r4, 0x1C] - movs r0, 0x1C - ldrsh r3, [r4, r0] - adds r7, r1, 0 - cmp r3, 0 - bne _080A4F2C - str r3, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl sub_80A27B0 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - b _080A4FBC - .pool -_080A4F2C: - ldr r2, =gUnknown_02037FD4 - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _080A4FBC - cmp r3, 0x1 - bne _080A4F50 - adds r0, r6, 0x1 - strh r0, [r4, 0x1C] - ldr r1, =gUnknown_02038433 - movs r0, 0x2 - strb r0, [r1] - b _080A4F94 - .pool -_080A4F50: - cmp r3, 0x2 - bne _080A4F94 - ldrh r0, [r4, 0x8] - lsls r2, r0, 16 - asrs r1, r2, 16 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _080A4F68 - bl dp01t_11_3_message_for_player_only - b _080A4F6E -_080A4F68: - lsrs r0, r2, 16 - bl sub_80A4FC8 -_080A4F6E: - movs r0, 0x1 - str r0, [sp] - movs r0, 0xE8 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl sub_80A27B0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x1C] - adds r1, 0x1 - strh r1, [r0, 0x1C] - b _080A4FBC - .pool -_080A4F94: - ldrb r1, [r2, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _080A4FBC - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r7 - movs r1, 0x1C - ldrsh r0, [r0, r1] - cmp r0, 0x3 - bne _080A4FBC - adds r0, r5, 0 - bl DestroyTask - ldr r0, =gUnknown_02038433 - strb r4, [r0] -_080A4FBC: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end task_p5_load_battle_screen_elements - - thumb_func_start sub_80A4FC8 -sub_80A4FC8: @ 80A4FC8 - push {r4-r7,lr} - lsls r0, 16 - lsrs r7, r0, 16 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5050 - ldr r6, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r6, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r5, =0x0201c000 - adds r1, r5, 0 - bl LZDecompressWram - bl sub_80A6D94 - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - adds r1, r5, 0 - movs r3, 0 - bl sub_80A4720 - ldr r1, =0x0600d000 - ldr r0, =0x040000d4 - str r5, [r0] - str r1, [r0, 0x4] - ldr r1, =0x84000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - adds r0, r4, r6 - ldr r0, [r0] - ldr r1, =0x06002000 - bl LZDecompressVram - adds r6, 0x4 - adds r4, r6 - ldr r4, [r4] - bl sub_80A6D94 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 20 - adds r0, r4, 0 - movs r2, 0x20 - bl decompress_palette - b _080A507E - .pool -_080A5050: - ldr r5, =gUnknown_08525D54 - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r0, r5, 0 - adds r0, 0x8 - adds r0, r4, r0 - ldr r0, [r0] - ldr r1, =0x0600d000 - bl LZDecompressVram - adds r0, r4, r5 - ldr r0, [r0] - ldr r1, =0x06008000 - bl LZDecompressVram - adds r5, 0x4 - adds r4, r5 - ldr r0, [r4] - movs r1, 0x20 - movs r2, 0x20 - bl decompress_palette -_080A507E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A4FC8 - - thumb_func_start dp01t_11_3_message_for_player_only -dp01t_11_3_message_for_player_only: @ 80A5090 - push {lr} - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A50A2 - bl sub_80D7724 - b _080A50A6 -_080A50A2: - bl load_battle_oval_graphics -_080A50A6: - pop {r0} - bx r0 - thumb_func_end dp01t_11_3_message_for_player_only - - thumb_func_start ma15_load_battle_screen_elements -ma15_load_battle_screen_elements: @ 80A50AC - push {lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =task_p5_load_battle_screen_elements - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =0x0000ffff - strh r0, [r1, 0x8] - ldr r1, =gUnknown_02038433 - movs r0, 0x1 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma15_load_battle_screen_elements - - thumb_func_start ma16_wait_for_battle_screen_elements_s2 -ma16_wait_for_battle_screen_elements_s2: @ 80A50F0 - push {lr} - ldr r0, =gUnknown_02038433 - ldrb r0, [r0] - cmp r0, 0x2 - bne _080A5114 - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r1, =gUnknown_020383FC - movs r0, 0 - b _080A5118 - .pool -_080A5114: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 -_080A5118: - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma16_wait_for_battle_screen_elements_s2 - - thumb_func_start sub_80A5124 -sub_80A5124: @ 80A5124 - push {lr} - ldr r0, =gUnknown_02038433 - ldrb r2, [r0] - cmp r2, 0 - bne _080A5148 - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - ldr r0, =gUnknown_020383FC - strb r2, [r0] - b _080A514E - .pool -_080A5148: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] -_080A514E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5124 - - thumb_func_start ma18_load_background_probably -ma18_load_background_probably: @ 80A5158 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - ldrb r0, [r1, 0x1] - bl sub_80A4FC8 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma18_load_background_probably - - thumb_func_start sub_80A5178 -sub_80A5178: @ 80A5178 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A51C0 - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gUnknown_02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A51C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A51C0: - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A51E8 - ldr r0, =gUnknown_02038436 - ldr r1, =gUnknown_02038437 - ldrb r0, [r0] - ldrb r1, [r1] - cmp r0, r1 - bne _080A524C - cmp r0, 0x2 - bne _080A524C - cmp r4, 0x3F - beq _080A525E - b _080A524C - .pool -_080A51E8: - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5226 - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A5252 - lsls r0, r4, 24 - asrs r1, r0, 24 - cmp r1, 0x3F - bne _080A5218 - movs r4, 0xC0 - b _080A5252 - .pool -_080A5218: - movs r0, 0x40 - negs r0, r0 - cmp r1, r0 - beq _080A5252 - negs r0, r1 - lsls r0, 24 - b _080A5250 -_080A5226: - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080A524C - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bne _080A5252 - movs r4, 0x3F - b _080A5252 - .pool -_080A524C: - lsls r0, r4, 24 - negs r0, r0 -_080A5250: - lsrs r4, r0, 24 -_080A5252: - lsls r0, r4, 24 - asrs r0, 24 - cmp r0, 0x3F - ble _080A525E - movs r4, 0x3F - b _080A526C -_080A525E: - lsls r0, r4, 24 - asrs r0, 24 - movs r1, 0x40 - negs r1, r1 - cmp r0, r1 - bge _080A526C - movs r4, 0xC0 -_080A526C: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80A5178 - - thumb_func_start sub_80A5278 -sub_80A5278: @ 80A5278 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A52C0 - ldr r0, =gUnknown_020244D0 - ldr r1, [r0] - ldr r0, =gUnknown_02038436 - ldrb r2, [r0] - ldr r1, [r1, 0x4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080A52C0 - adds r0, r2, 0 - bl battle_side_get_owner - lsls r0, 24 - movs r4, 0xC0 - cmp r0, 0 - beq _080A52DE - movs r4, 0x3F - b _080A52DE - .pool -_080A52C0: - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - cmp r0, 0 - bne _080A52D8 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A52DE -_080A52D8: - lsls r0, r4, 24 - negs r0, r0 - lsrs r4, r0, 24 -_080A52DE: - lsls r0, r4, 24 - asrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A5278 - - thumb_func_start sub_80A52EC -sub_80A52EC: @ 80A52EC - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - asrs r2, r0, 16 - cmp r2, 0x3F - ble _080A52FC - movs r1, 0x3F - b _080A5306 -_080A52FC: - movs r0, 0x40 - negs r0, r0 - cmp r2, r0 - bge _080A5306 - ldr r1, =0x0000ffc0 -_080A5306: - lsls r0, r1, 16 - asrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80A52EC - - thumb_func_start sub_80A5314 -sub_80A5314: @ 80A5314 - push {lr} - lsls r2, 16 - lsrs r2, 16 - adds r3, r2, 0 - lsls r0, 16 - asrs r0, 16 - lsls r1, 16 - asrs r1, 16 - cmp r0, r1 - bge _080A5332 - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5342 - b _080A5340 -_080A5332: - cmp r0, r1 - ble _080A5348 - lsls r0, r3, 16 - asrs r0, 16 - cmp r0, 0 - bge _080A5340 - negs r0, r0 -_080A5340: - negs r0, r0 -_080A5342: - lsls r0, 16 - lsrs r0, 16 - b _080A534A -_080A5348: - movs r0, 0 -_080A534A: - lsls r0, 16 - asrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80A5314 - - thumb_func_start ma19_08073BC8 -ma19_08073BC8: @ 80A5354 - push {r4,r5,lr} - ldr r5, =gUnknown_020383F0 - ldr r0, [r5] - adds r1, r0, 0x1 - str r1, [r5] - ldrb r4, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r4, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - adds r0, r4, 0 - bl audio_play_and_stuff - ldr r0, [r5] - adds r0, 0x3 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma19_08073BC8 - - thumb_func_start ma1A_8073C00 -ma1A_8073C00: @ 80A538C - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r0, r1, 0x1 - str r0, [r4] - movs r0, 0x1 - ldrsb r0, [r1, r0] - bl sub_80A5178 - lsls r0, 24 - asrs r0, 24 - bl sub_80A3870 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma1A_8073C00 - - thumb_func_start ma1B_8073C2C -ma1B_8073C2C: @ 80A53B8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_020383F0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5178 - mov r8, r0 - lsls r5, 24 - asrs r5, 24 - mov r0, r8 - lsls r0, 24 - asrs r0, 24 - mov r8, r0 - lsls r6, 24 - asrs r6, 24 - adds r0, r5, 0 - mov r1, r8 - adds r2, r6, 0 - bl sub_80A5314 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - mov r2, r8 - strh r2, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r5, [r1, 0x10] - mov r0, r9 - adds r1, r5, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r10 - ldr r0, [r1] - adds r0, 0x6 - 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 ma1B_8073C2C - - thumb_func_start c3_08073CEC -c3_08073CEC: @ 80A5478 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xE - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A54FC - strh r7, [r2, 0x18] - ldrh r6, [r2, 0x8] - ldrh r3, [r2, 0xA] - movs r4, 0x10 - ldrsh r0, [r2, r4] - movs r4, 0xC - ldrsh r1, [r2, r4] - adds r0, r1 - lsls r0, 16 - lsrs r4, r0, 16 - strh r4, [r2, 0x10] - cmp r1, 0 - bne _080A54C0 - lsls r2, r3, 16 - b _080A54E4 - .pool -_080A54C0: - lsls r1, r6, 16 - lsls r0, r3, 16 - asrs r3, r0, 16 - adds r2, r0, 0 - cmp r1, r2 - bge _080A54D6 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - blt _080A54E0 - b _080A54E4 -_080A54D6: - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, r3 - bgt _080A54E0 - movs r7, 0x1 -_080A54E0: - cmp r7, 0 - beq _080A54F4 -_080A54E4: - lsrs r4, r2, 16 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A54F4: - lsls r0, r4, 24 - asrs r0, 24 - bl sub_80A3870 -_080A54FC: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end c3_08073CEC - - thumb_func_start sub_80A5508 -sub_80A5508: @ 80A5508 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gUnknown_020383F0 - mov r9, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r9 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r8, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r8 - orrs r2, r0 - mov r8, r2 - ldrb r4, [r1, 0x2] - ldrb r5, [r1, 0x3] - ldrb r6, [r1, 0x4] - ldrb r1, [r1, 0x5] - mov r10, r1 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0xC] - mov r0, r10 - strh r0, [r1, 0xE] - strh r4, [r1, 0x10] - mov r0, r8 - adds r1, r4, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r1, r9 - ldr r0, [r1] - adds r0, 0x6 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5508 - - thumb_func_start sub_80A559C -sub_80A559C: @ 80A559C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_020383F0 - mov r10, r0 - ldr r0, [r0] - adds r1, r0, 0x1 - mov r2, r10 - str r1, [r2] - ldrb r0, [r0, 0x1] - mov r9, r0 - ldrb r0, [r1, 0x1] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - ldrb r4, [r1, 0x3] - ldrb r0, [r1, 0x4] - mov r8, r0 - ldrb r7, [r1, 0x5] - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5278 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - lsls r4, 24 - asrs r4, 24 - adds r0, r4, 0 - bl sub_80A5278 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - mov r1, r8 - lsls r1, 24 - asrs r1, 24 - mov r8, r1 - mov r0, r8 - bl sub_80A5278 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =c3_08073CEC - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - lsls r6, 24 - asrs r6, 24 - strh r6, [r1, 0x8] - lsls r5, 24 - asrs r5, 24 - strh r5, [r1, 0xA] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xC] - strh r7, [r1, 0xE] - strh r6, [r1, 0x10] - mov r0, r9 - adds r1, r6, 0 - bl audio_play_and_stuff - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - mov r2, r10 - ldr r0, [r2] - adds r0, 0x6 - str 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_80A559C - - thumb_func_start ma1C_8073ED0 -ma1C_8073ED0: @ 80A565C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - ldrb r2, [r1, 0x4] - mov r9, r2 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A56E4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r2, r8 - strh r2, [r1, 0xC] - mov r2, r9 - strh r2, [r1, 0xE] - mov r2, r8 - strh r2, [r1, 0x18] - ldr r1, [r1] - bl _call_via_r1 - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x5 - str r0, [r6] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1C_8073ED0 - - thumb_func_start sub_80A56E4 -sub_80A56E4: @ 80A56E4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0x18] - adds r1, r0, 0x1 - strh r1, [r2, 0x18] - lsls r0, 16 - asrs r0, 16 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - blt _080A5732 - movs r0, 0 - strh r0, [r2, 0x18] - ldrh r0, [r2, 0x8] - ldrb r1, [r2, 0xA] - ldrh r4, [r2, 0xE] - subs r4, 0x1 - strh r4, [r2, 0xE] - lsls r4, 24 - lsrs r4, 24 - lsls r1, 24 - asrs r1, 24 - bl audio_play_and_stuff - cmp r4, 0 - bne _080A5732 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A5732: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A56E4 - - thumb_func_start ma1D_08073FB4 -ma1D_08073FB4: @ 80A5740 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r6, =gUnknown_020383F0 - ldr r0, [r6] - adds r1, r0, 0x1 - str r1, [r6] - ldrb r5, [r0, 0x1] - ldrb r0, [r1, 0x1] - lsls r0, 8 - orrs r5, r0 - ldrb r0, [r1, 0x3] - mov r8, r0 - movs r0, 0x2 - ldrsb r0, [r1, r0] - bl sub_80A5178 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =sub_80A57B4 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - lsls r4, 24 - asrs r4, 24 - strh r4, [r1, 0xA] - mov r0, r8 - strh r0, [r1, 0xC] - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - adds r0, 0x4 - str r0, [r6] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end ma1D_08073FB4 - - thumb_func_start sub_80A57B4 -sub_80A57B4: @ 80A57B4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r1 - ldrh r0, [r2, 0xC] - subs r1, r0, 0x1 - strh r1, [r2, 0xC] - lsls r0, 16 - cmp r0, 0 - bgt _080A57E8 - ldrh r0, [r2, 0x8] - movs r1, 0xA - ldrsb r1, [r2, r1] - bl audio_play_and_stuff - adds r0, r4, 0 - bl DestroyTask - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_080A57E8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57B4 - - thumb_func_start sub_80A57F8 -sub_80A57F8: @ 80A57F8 - push {r4-r6,lr} - ldr r4, =gUnknown_020383F0 - ldr r1, [r4] - adds r3, r1, 0x1 - str r3, [r4] - ldrb r2, [r1, 0x1] - ldrb r0, [r3, 0x1] - lsls r0, 8 - adds r2, r0 - ldrb r0, [r3, 0x2] - lsls r0, 16 - adds r2, r0 - ldrb r0, [r3, 0x3] - lsls r0, 24 - adds r6, r2, r0 - adds r0, r1, 0x5 - str r0, [r4] - ldrb r0, [r1, 0x5] - adds r1, 0x6 - str r1, [r4] - cmp r0, 0 - beq _080A5842 - adds r5, r4, 0 - ldr r4, =gUnknown_0203841E - adds r3, r0, 0 -_080A582A: - ldr r2, [r5] - ldrb r1, [r2] - ldrb r0, [r2, 0x1] - lsls r0, 8 - orrs r1, r0 - strh r1, [r4] - adds r2, 0x2 - str r2, [r5] - adds r4, 0x2 - subs r3, 0x1 - cmp r3, 0 - bne _080A582A -_080A5842: - adds r0, r6, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r6 - ldr r1, =gUnknown_020383FF - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A57F8 - - thumb_func_start ma20_wait_for_something -ma20_wait_for_something: @ 80A586C - push {r4,r5,lr} - ldr r0, =gUnknown_020383FF - ldrb r5, [r0] - cmp r5, 0 - bne _080A58B4 - bl mplay_has_finished_maybe - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _080A58CC - ldr r4, =gUnknown_0203842E - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5A - bls _080A58BA - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop - strh r5, [r4] - b _080A58DE - .pool -_080A58B4: - ldr r1, =gUnknown_0203842E - movs r0, 0 - strh r0, [r1] -_080A58BA: - ldr r1, =gUnknown_020383FC - movs r0, 0x1 - strb r0, [r1] - b _080A58DE - .pool -_080A58CC: - ldr r0, =gUnknown_0203842E - movs r2, 0 - strh r1, [r0] - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - ldr r0, =gUnknown_020383FC - strb r2, [r0] -_080A58DE: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ma20_wait_for_something - - thumb_func_start ma21_08074164 -ma21_08074164: @ 80A58F0 - push {r4-r6,lr} - ldr r5, =gUnknown_020383F0 - ldr r4, [r5] - adds r3, r4, 0x1 - str r3, [r5] - ldrb r2, [r4, 0x1] - ldrb r1, [r3, 0x1] - ldrb r0, [r3, 0x2] - lsls r0, 8 - orrs r1, r0 - ldr r0, =gUnknown_0203841E - lsls r2, 1 - adds r2, r0 - lsls r1, 16 - asrs r1, 16 - movs r6, 0 - ldrsh r0, [r2, r6] - cmp r1, r0 - bne _080A5938 - ldrb r1, [r3, 0x3] - ldrb r0, [r3, 0x4] - lsls r0, 8 - adds r1, r0 - ldrb r0, [r3, 0x5] - lsls r0, 16 - adds r1, r0 - ldrb r0, [r3, 0x6] - lsls r0, 24 - adds r1, r0 - str r1, [r5] - b _080A593E - .pool -_080A5938: - adds r0, r4, 0 - adds r0, 0x8 - str r0, [r5] -_080A593E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end ma21_08074164 - - thumb_func_start sub_80A5944 -sub_80A5944: @ 80A5944 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - adds r0, 0x1 - str r0, [r4] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - beq _080A5978 - ldr r2, [r4] - 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, [r4] - b _080A597E - .pool -_080A5978: - ldr r0, [r4] - adds r0, 0x4 - str r0, [r4] -_080A597E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80A5944 - - thumb_func_start sub_80A5984 -sub_80A5984: @ 80A5984 - push {r4,lr} - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - ldrb r2, [r1, 0x1] - adds r1, 0x2 - str r1, [r0] - cmp r2, 0 - beq _080A59A0 - ldr r0, =gUnknown_02038437 - b _080A59A2 - .pool -_080A59A0: - ldr r0, =gUnknown_02038436 -_080A59A2: - ldrb r0, [r0] - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A59D2 - cmp r4, 0 - beq _080A59BE - cmp r4, 0x3 - bne _080A59D2 -_080A59BE: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A59D2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5984 - - thumb_func_start sub_80A59DC -sub_80A59DC: @ 80A59DC - push {lr} - ldr r0, =gUnknown_020383F0 - ldr r1, [r0] - adds r1, 0x1 - str r1, [r0] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A04 - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A04: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A59DC - - thumb_func_start sub_80A5A0C -sub_80A5A0C: @ 80A5A0C - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r6, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - ldr r7, =gUnknown_02038436 - ldrb r0, [r7] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _080A5A78 - cmp r6, 0 - beq _080A5A48 - ldrb r0, [r5] - b _080A5A4A - .pool -_080A5A48: - ldrb r0, [r7] -_080A5A4A: - bl battle_get_per_side_status - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5A78 - cmp r4, 0 - beq _080A5A64 - cmp r4, 0x3 - bne _080A5A78 -_080A5A64: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl lcd_bg_operations - movs r0, 0x2 - movs r1, 0x4 - movs r2, 0x2 - bl lcd_bg_operations -_080A5A78: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5A0C - - thumb_func_start ma2B_make_side_invisible -ma2B_make_side_invisible: @ 80A5A80 - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AA8 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_080A5AA8: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2B_make_side_invisible - - thumb_func_start ma2C_make_side_visible -ma2C_make_side_visible: @ 80A5ABC - push {r4,lr} - ldr r4, =gUnknown_020383F0 - ldr r0, [r4] - ldrb r0, [r0, 0x1] - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5AE6 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] -_080A5AE6: - ldr r0, [r4] - adds r0, 0x2 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ma2C_make_side_visible - - thumb_func_start sub_80A5AFC -sub_80A5AFC: @ 80A5AFC - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5BA6 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5BA6 - ldr r6, =gUnknown_02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5BA6 - cmp r7, 0 - bne _080A5B54 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5B60 - .pool -_080A5B54: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5B60: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5BA6 - ldr r1, =gUnknown_02020630 - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - 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] - cmp r4, 0x2 - bne _080A5B90 - ldrb r0, [r2, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r2, 0x5] -_080A5B90: - cmp r4, 0x1 - bne _080A5BA0 - movs r0, 0 - bl sub_80A477C - b _080A5BA6 - .pool -_080A5BA0: - movs r0, 0x1 - bl sub_80A477C -_080A5BA6: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80A5AFC - - thumb_func_start sub_80A5BAC -sub_80A5BAC: @ 80A5BAC - push {r4-r7,lr} - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - ldrb r7, [r0, 0x1] - adds r0, 0x2 - str r0, [r1] - bl sub_80A4DF0 - lsls r0, 24 - cmp r0, 0 - bne _080A5C38 - bl battle_type_is_double - lsls r0, 24 - cmp r0, 0 - beq _080A5C38 - ldr r6, =gUnknown_02038436 - ldrb r0, [r6] - bl battle_side_get_owner - adds r4, r0, 0 - ldr r5, =gUnknown_02038437 - ldrb r0, [r5] - bl battle_side_get_owner - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - bne _080A5C38 - cmp r7, 0 - bne _080A5C04 - ldrb r0, [r6] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0 - b _080A5C10 - .pool -_080A5C04: - ldrb r0, [r5] - bl battle_get_per_side_status_permutated - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x1 -_080A5C10: - bl obj_id_for_side_relative_to_move - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _080A5C38 - cmp r4, 0x2 - bne _080A5C38 - ldr r1, =gUnknown_02020630 - 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 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] -_080A5C38: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80A5BAC - - thumb_func_start ma2F_stop_music -ma2F_stop_music: @ 80A5C44 - push {lr} - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop - ldr r1, =gUnknown_020383F0 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end ma2F_stop_music - thumb_func_start sub_80A5C6C sub_80A5C6C: @ 80A5C6C push {r4,r5,lr} diff --git a/asm/rom_80B5E6C.s b/asm/rom_80B5E6C.s deleted file mode 100644 index daed4324a..000000000 --- a/asm/rom_80B5E6C.s +++ /dev/null @@ -1,8625 +0,0 @@ - .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, =gUnknown_02037714 - 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, =gUnknown_02037B14 - 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, =gUnknown_02037714 - 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, =gUnknown_02037B14 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_03005DAC - 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, =gUnknown_03005DAC - 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, =gTasks - 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, =gUnknown_02038C08 - 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, =gUnknown_03005DAC - 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, =gUnknown_02037350 - ldr r3, =gUnknown_02037590 - 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, =gUnknown_03005DAC - 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, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _080B6B3E - ldr r0, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r0, [r6, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02037350 - mov r8, r0 - add r5, r8 - ldrb r0, [r6, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r0, [r6, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02021BBE - 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, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_02037590 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl Cos - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl Sin - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl Cos - strh r0, [r4, 0x24] - movs r0, 0xC - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl Sin - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gUnknown_03005DAC - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x84 - bl Cos - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x94 - bl Sin - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x84 - bl Cos - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x94 - bl Sin - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - adds r4, r0 - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x7C - bl Cos - strh r0, [r4, 0x24] - movs r0, 0xA - ldrsh r1, [r5, r0] - movs r0, 0x76 - bl Sin - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - adds r5, r0, r1 - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x7C - bl Cos - strh r0, [r5, 0x24] - movs r0, 0xA - ldrsh r1, [r4, r0] - movs r0, 0x76 - bl Sin - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =gUnknown_02038C08 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r1, r0, 3 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02037350 - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02037590 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r3, =gUnknown_02038C08 - 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, =gTasks - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - 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, =gTasks - ldr r5, =gUnknown_02037590 - 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, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02021BBE - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gUnknown_03005DAC - 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, =gTasks - ldr r5, =gUnknown_02037590 - 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, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02020630 - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02020630 - 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, =gTasks - ldr r5, =gUnknown_02037590 - 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, =gUnknown_02037350 - adds r1, r0 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - 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, =gUnknown_02038C08 - 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, =gUnknown_02020630 - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gUnknown_02038C08 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r3, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DAC - 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, =gUnknown_03005DAC - movs r0, 0 - str r0, [r1] - ldr r2, =gUnknown_02037350 - ldr r0, =gUnknown_02037590 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r0, [r5, 0x4] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02021BBE - adds r1, r4 - ldrh r3, [r3] - adds r1, r3 - asrs r0, 16 - adds r0, r1 - negs r0, r0 - strh r0, [r2, 0x26] - ldr r3, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r2, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r6, r0, r1 - ldrb r1, [r2, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02038C08 - ldr r0, [r2] - ldr r1, [r2, 0x4] - ldr r2, [r2, 0x8] - bl sub_80B8C60 - ldr r2, =gTasks - 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, =gUnknown_02038C08 - 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, =gUnknown_020244EC - 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, =gTasks - 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, =gUnknown_030022C0 - ldr r1, [r1, 0xC] - bl StoreWordInTwoHalfwords - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 LoadWordFromTwoHalfwords - 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, =gUnknown_02020630 - 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, =gTasks - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl LoadWordFromTwoHalfwords - 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, =gTasks - 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, =gUnknown_030022C0 - ldr r1, [r1, 0xC] - bl StoreWordInTwoHalfwords - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 LoadWordFromTwoHalfwords - 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, =gUnknown_02020630 - 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, =gTasks - adds r4, r0 - adds r0, r4, 0 - adds r0, 0x22 - mov r1, sp - bl LoadWordFromTwoHalfwords - 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, =gUnknown_02020630 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =gUnknown_02038C08 - 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, =gTasks - 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, =gUnknown_02037590 - 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, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - bl FieldObjectCheckIfSpecialAnimFinishedOrInactive - lsls r0, 24 - cmp r0, 0 - beq _080B8E96 - ldr r2, =gUnknown_02038C08 - 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, =gUnknown_02037590 - ldrb r0, [r5, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - 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, =gUnknown_02038C08 - 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, =gUnknown_02037590 - ldrb r1, [r5, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02038C08 - 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 Cos - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl Sin - 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, =gUnknown_02020630 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =gUnknown_02038C08 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02038C08 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r4, r0, 3 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02037350 - 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, =gUnknown_02037FD4 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 Cos - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl Sin - 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 Cos - movs r5, 0 - strh r0, [r4, 0x24] - movs r2, 0x32 - ldrsh r0, [r4, r2] - movs r1, 0x48 - bl Sin - 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, =gUnknown_02020630 - 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 Cos - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl Sin - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - adds r0, r1 - ldrb r0, [r0, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x4] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r0, [r0, 0x5] - lsls r5, r0, 3 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02037350 - adds r5, r0 - ldrb r0, [r5, 0x4] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r1, [r0, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02020630 - 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, =gUnknown_02037590 - ldrb r1, [r6, 0x5] - lsls r0, r1, 3 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02037350 - 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, =gUnknown_02038C08 - 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, =gTasks - 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, =gTasks + 0x8 - 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, =gTasks - 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, =gTasks + 0x8 - 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, =gUnknown_02037350 - 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, =gUnknown_02020630 - 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, =gUnknown_02037FD4 - 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, =gUnknown_03005DEC - 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, =gUnknown_03005DE8 - 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, =gUnknown_02020630 - 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, =gUnknown_02038C08 - 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, =gUnknown_02037350 - 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, =gTasks - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 3 - adds r2, r1 - ldrb r0, [r4, 0x4] - strh r0, [r2, 0xA] - ldr r3, =gUnknown_02020630 - 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, =gTasks + 0x8 - adds r5, r0, r1 - movs r0, 0x2 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_02037350 - 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, =gUnknown_02039B28 - 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, =gUnknown_02038C28 - ldr r2, =0x01000780 - bl CpuSet - ldr r0, =gUnknown_02039B28 - 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, =gUnknown_02039B28 - ldr r1, =gUnknown_02038C2A - 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, =gUnknown_02039B28 - ldr r1, =gUnknown_02038C2C - 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, =gUnknown_02039B28 - 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, =gUnknown_02039B44 - 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, =gUnknown_02039B28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - 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, =gUnknown_02039B28 - ldr r2, [r0, 0x8] - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - ldr r1, =gUnknown_02038C28 - 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, =gUnknown_02039B44 - ldrb r0, [r0] - cmp r0, 0 - beq _080BA1A4 - mov r0, r12 - bl DestroyTask - ldr r1, =gUnknown_02039B28 - movs r0, 0xFF - strb r0, [r1, 0x18] - b _080BA324 - .pool -_080BA1A4: - ldr r1, =gTasks - 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, =gUnknown_02022E14 - b _080BA24E - .pool -_080BA21C: - ldr r0, =gUnknown_02022E16 - b _080BA24E - .pool -_080BA224: - ldr r0, =gUnknown_02022E18 - b _080BA24E - .pool -_080BA22C: - ldr r0, =gUnknown_02022E1A - b _080BA24E - .pool -_080BA234: - ldr r0, =gUnknown_02022E1C - b _080BA24E - .pool -_080BA23C: - ldr r0, =gUnknown_02022E1E - b _080BA24E - .pool -_080BA244: - ldr r0, =gUnknown_02022E20 - b _080BA24E - .pool -_080BA24C: - ldr r0, =gUnknown_02022E22 -_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, =gUnknown_02038C28 - ldr r0, =gUnknown_02039B28 - 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, =gUnknown_02038C28 - adds r7, r1, 0 - lsls r0, r2, 1 - adds r4, r0, r5 - ldr r0, =gUnknown_02039B28 - 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, =gTasks - 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, =gUnknown_02039B28 - strb r7, [r0, 0x18] - ldr r0, =gUnknown_02039B44 - movs r1, 0 - strb r1, [r0] - ldr r4, =gUnknown_02038EA8 - 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_816F318.s b/asm/rom_816F318.s deleted file mode 100644 index 516d2673e..000000000 --- a/asm/rom_816F318.s +++ /dev/null @@ -1,15475 +0,0 @@ - .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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_0202064C - 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, =gUnknown_030062A0 - 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, =gUnknown_030062A0 - 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, =gUnknown_030062A0 - 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 Random - 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 Sin - ldr r1, =gUnknown_0203BCCC - 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, =gUnknown_030062A0 - 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, =gUnknown_02037D52 - 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, =gUnknown_02037D52 - 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, =gUnknown_02037D52 - 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, =gUnknown_030062A0 - 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, =gUnknown_030062A0 - 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, =gUnknown_030062A0 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 Sin - negs r0, r0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x78 - bl Sin - 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 Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x34] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3C - bl Cos - 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, =gUnknown_030022C0 - 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, =gUnknown_03006210 - ldrh r0, [r0] - cmp r0, 0 - beq _08170148 - cmp r0, 0x2 - bne _0817014C -_08170148: - bl init_sav2 -_0817014C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x15] - lsls r0, 31 - lsrs r0, 31 - bl SetPokemonCryStereo - 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, =gUnknown_0203BCD0 - 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, =gUnknown_0203BCD0 - 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, =gUnknown_0203BCD0 - ldr r1, [r0] - ldr r0, =0x0000088c - adds r1, r0 - b _081703D8 - .pool -_08170380: - ldr r0, =gUnknown_02037FD4 - 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, =gUnknown_0203BCD0 - 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, =gUnknown_0203BCD0 - 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, =gUnknown_02037FD4 - 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, =gUnknown_0203BCD0 - 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, =gUnknown_0203BCD0 - 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, =gUnknown_02038436 - ldrb r4, [r0] - ldr r0, =gUnknown_02022E24 - movs r1, 0 - strh r1, [r0] - ldr r0, =gUnknown_02022E26 - 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, =gUnknown_03005D70 - adds r4, r0 - ldrb r0, [r4] - ldr r1, =gUnknown_02020630 - 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 CreateInvisibleSpriteWithCallback - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x14] - ldr r0, =DummyObjectCallback - bl CreateInvisibleSpriteWithCallback - 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, =gUnknown_02022E18 - ldrh r0, [r7, 0x20] - negs r0, r0 - adds r0, 0x20 - strh r0, [r1] - ldr r1, =gUnknown_02022E1A - ldrh r0, [r7, 0x22] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1] - ldr r1, =gTasks - 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, =gUnknown_02038436 - ldrb r0, [r0] - mov r8, r0 - ldr r1, =gTasks - 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, =gUnknown_02022E1A - 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, =gUnknown_02022E24 - strh r4, [r0] - ldr r0, =gUnknown_02022E26 - 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, =gUnknown_02020630 - 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, =gUnknown_03005D70 - 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, =gUnknown_03005D70 - adds r2, r0 - ldrb r0, [r2] - lsls r5, r0, 4 - adds r5, r0 - lsls r5, 2 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02020630 - adds r6, r2 - ldrb r4, [r6, 0x5] - lsrs r4, 4 - lsls r4, 4 - orrs r4, r3 - lsls r0, 1 - ldr r1, =gUnknown_02037714 - 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, =gUnknown_02020630 - 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, =gUnknown_02038436 - 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, =gUnknown_03005D70 - adds r0, r1 - ldrb r0, [r0] - ldr r1, =gUnknown_02020630 - 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, =gUnknown_02038436 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r2, =gUnknown_0203841E - 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, =gTasks - 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 BlendPalette - 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 BlendPalette - 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, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - adds r0, r1 - ldrb r5, [r0] - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 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, =gUnknown_02020630 - 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, =gUnknown_020241E4 - ldr r4, =gUnknown_02038436 - 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, =gUnknown_0202406E - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_020244EC - b _08170C08 - .pool -_08170BF8: - ldr r1, =gUnknown_0202406E - ldrb r0, [r4] - lsls r0, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gUnknown_02024744 -_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, =gTasks - 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, =gUnknown_02038436 - 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, =gUnknown_02020630 - 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, =gUnknown_02024208 - 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, =gUnknown_02024208 - 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, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrb r0, [r0, 0x8] - cmp r0, 0x5 - bne _08170D70 - ldr r1, =gUnknown_0203841E - ldr r0, =0x0000ffff - b _08170D74 - .pool -_08170D70: - ldr r1, =gUnknown_0203841E - 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, =gUnknown_02024208 - 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, =gUnknown_02020630 - 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, =gUnknown_02038437 - 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, =gUnknown_020244D0 - ldr r0, [r0] - ldr r3, [r0, 0x8] - ldr r1, =gUnknown_020241E4 - 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, =gTasks - 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, =gTasks - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - ldr r2, =gUnknown_02020630 - 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, =gUnknown_02022FEC - 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, =gUnknown_02024208 - 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, =gUnknown_02020630 - 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, =gUnknown_02038437 - 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, =gUnknown_020241E4 - 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, =gTasks - 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, =gUnknown_02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_020241E4 - 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, =gTasks - 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, =gUnknown_02020630 - movs r0, 0 - bl battle_get_side_with_given_state - ldr r4, =gUnknown_020241E4 - 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, =gUnknown_020244D0 - 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, =gUnknown_02024208 - 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, =gUnknown_02038437 - 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, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038437 - 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, =gUnknown_020241E4 - ldr r0, =gUnknown_02038437 - ldrb r0, [r0] - adds r0, r1 - ldrb r4, [r0] - ldrh r0, [r7, 0x38] - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - 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, =gUnknown_030062DC - movs r0, 0x1C - str r0, [r1] - ldr r2, =gUnknown_030062E4 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_030062E0 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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 Cos - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - movs r0, 0x36 - ldrsh r1, [r4, r0] - movs r0, 0 - bl Cos - 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 Cos - 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 Cos - 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 Cos - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - strh r5, [r4, 0x26] - ldr r0, =gUnknown_020244D0 - 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, =gUnknown_020244D0 - 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, =gUnknown_020244D0 - 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, =gUnknown_020244D0 - 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, =gUnknown_020244D0 - 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, =gUnknown_020244D0 - 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, =gUnknown_02038437 - 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, =gUnknown_020244B9 - 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, =gUnknown_02020630 - ldr r4, =gUnknown_020241E4 - 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, =gUnknown_02037FD4 - 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, =gUnknown_02020630 - 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, =gUnknown_02024208 - 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, =gUnknown_02038437 - ldrb r1, [r0] - movs r0, 0x1 - movs r2, 0xE - adds r3, r5, 0 - bl sub_81729E8 -_08171B36: - ldr r6, =gUnknown_02020630 - ldr r5, =gUnknown_020241E4 - ldr r4, =gUnknown_02038437 - 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, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038437 - 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, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038437 - 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, =gUnknown_020244D0 - 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, =gUnknown_020244B9 - 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, =gUnknown_020244B9 - 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, =gTasks - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08171E3E - ldr r0, =gUnknown_020244D0 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_030022C0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08171F22 - ldr r0, =gUnknown_02020630 - 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 Sin - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl Cos - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172092 - ldr r0, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172196 - ldr r0, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172296 - ldr r0, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0817239E - ldr r0, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gTasks - 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, =gUnknown_030022C0 - ldr r4, =0x00000439 - adds r0, r4 - ldrb r1, [r0] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _081724D0 - ldr r0, =gUnknown_02020630 - 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 Sin - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - movs r2, 0x32 - ldrsh r1, [r4, r2] - bl Cos - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _08172626 - ldr r0, =gUnknown_02020630 - 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 Sin - strh r0, [r5, 0x24] - movs r0, 0x2E - ldrsh r4, [r5, r0] - movs r2, 0x32 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl Sin - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl Cos - 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, =gTasks - 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, =gUnknown_02020630 - adds r5, r4, r0 - ldr r0, =gUnknown_085E51B4 - add r0, r9 - ldrb r1, [r0] - adds r0, r5, 0 - bl StartObjectImageAnim - ldr r1, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r2, =0x00000439 - adds r0, r2 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081727C4 - ldr r0, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_0202064C - 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, =gUnknown_030022C0 - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081728A8 - ldr r0, =gUnknown_02020630 - 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 Sin - 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 Sin - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl Cos - 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, =gUnknown_030022C0 - 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, =gUnknown_020244D0 - 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, =gTasks - 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 BlendPalette - 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 BlendPalette - 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, =gTasks - 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 BlendPalette - 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, =gUnknown_02037FD4 - 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, =gUnknown_02037FD4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08172B78 - ldr r0, =gTasks - 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, =gTasks - 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 BlendPalette - 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, =gUnknown_020241E4 - ldr r3, =gUnknown_02038436 - ldrb r2, [r3] - adds r0, r2, r0 - ldrb r6, [r0] - ldr r1, =gTasks - 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, =gUnknown_0203841E - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0x8] - strh r1, [r0, 0x8] - ldr r0, =gUnknown_02038436 - ldrb r0, [r0] - bl battle_side_get_owner - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08172D68 - ldr r0, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02038436 - 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, =gTasks - 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, =gUnknown_020241E4 - ldr r4, =gUnknown_02038436 - ldrb r0, [r4] - adds r0, r1 - ldrb r1, [r0] - ldr r2, =gUnknown_02020630 - 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, =gUnknown_0203841E - ldr r1, =gUnknown_020244D0 - ldr r2, [r1] - ldr r1, =gUnknown_02038436 - 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, =gUnknown_02038437 - ldr r1, =gUnknown_0202420E - 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, =gUnknown_020244D0 - 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, =gTasks - 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, =gUnknown_020244D0 - 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, =gTasks - 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, =gUnknown_020244D0 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - adds r0, r4, r5 - lsls r0, 2 - adds r0, r1 - strh r7, [r0, 0x2E] - ldr r1, =gTasks - 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, =gTasks - 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, =gUnknown_020244D0 - 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 Sin - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl Cos - 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, =gTasks - 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, =gTasks - 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, =gUnknown_0203841E - 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, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - 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, =gUnknown_02020630 - ldr r1, =gUnknown_020241E4 - ldr r0, =gUnknown_02038436 - 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, =gUnknown_02020630 - ldr r3, =gUnknown_020241E4 - ldr r2, =gUnknown_02038436 - 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, =gUnknown_0203841E - 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, =gUnknown_02038436 - strb r0, [r1] - movs r0, 0x1 - b _08173498 - .pool -_0817348C: - movs r0, 0x1 - bl battle_get_side_with_given_state - ldr r1, =gUnknown_02038436 - strb r0, [r1] - movs r0, 0 -_08173498: - bl battle_get_side_with_given_state - ldr r1, =gUnknown_02038437 - 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, =gUnknown_020244D0 - ldr r0, [r0] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - cmp r1, 0x53 - bne _081734D4 - ldr r1, =gUnknown_0203841E - movs r0, 0x1 - b _0817350C - .pool -_081734D4: - cmp r1, 0xFA - bne _081734E4 - ldr r1, =gUnknown_0203841E - movs r0, 0x2 - b _0817350C - .pool -_081734E4: - cmp r1, 0x80 - bne _081734F4 - ldr r1, =gUnknown_0203841E - movs r0, 0x3 - b _0817350C - .pool -_081734F4: - movs r0, 0xA4 - lsls r0, 1 - cmp r1, r0 - bne _08173508 - ldr r1, =gUnknown_0203841E - movs r0, 0x4 - b _0817350C - .pool -_08173508: - ldr r1, =gUnknown_0203841E - 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, =gUnknown_02038436 - ldr r1, =gUnknown_020244D0 - ldr r2, [r1] - ldr r1, [r2, 0x8] - ldrh r1, [r1] - strb r1, [r3] - ldr r3, =gUnknown_02038437 - 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, =gUnknown_030022C0 - 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, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gUnknown_030022C0 - 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, =gUnknown_0203BCDC - 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, =gUnknown_030022C0 - 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, =gUnknown_02037FD4 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r4, =gUnknown_0203BCD8 - 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, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - ldr r4, =gUnknown_0203BCD8 - 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, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - movs r7, 0 - ldr r0, =gUnknown_0203BCD8 - mov r9, r0 -_08173740: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gUnknown_020244EC - 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, =gUnknown_0203BCD8 -_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, =gTasks - 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, =gUnknown_0203BCD4 - movs r3, 0 - str r3, [r0] - ldr r4, =gTasks - 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, =gUnknown_0203BCE4 - 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, =gUnknown_0203BCD8 - 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, =gTasks - 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, =gUnknown_03006214 - 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, =gUnknown_030061FC - ldr r0, [r0] - cmp r0, 0 - beq _08173A34 - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - bl FreeAllWindowBuffers - ldr r5, =gUnknown_0203BCDC - ldr r0, [r5] - cmp r0, 0 - beq _08173A06 - bl Free - movs r0, 0 - str r0, [r5] -_08173A06: - ldr r5, =gUnknown_0203BCD8 - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r6, [r1, 0xA] - ldr r2, =gUnknown_0203BCD8 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gTasks - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - adds r5, r3, r4 - ldrh r0, [r5, 0xA] - ldr r2, =gUnknown_0203BCD8 - 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, =gUnknown_02020630 - 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, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - adds r4, r6, r2 - ldrh r3, [r4, 0xA] - ldr r1, =gUnknown_0203BCD8 - 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, =gUnknown_0203BCD4 - ldr r0, =gUnknown_02020630 - 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, =gTasks + 0x8 - mov r12, r0 - mov r8, r1 - ldr r6, =gUnknown_02020630 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_0203BCD4 - mov r10, r0 - adds r4, r5, 0 - adds r7, 0x8 - mov r8, r7 - ldr r7, =gUnknown_02020630 - 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, =gTasks - 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, =gTasks - 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, =gSaveBlock2Ptr - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_030022C0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817404E - movs r0, 0x4 - bl play_sound_effect - ldr r0, =gTasks - 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, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 - 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, =gTasks - 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, =gUnknown_02037FD4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08174164 - lsls r0, r7, 2 - mov r8, r0 - ldr r1, =gTasks - adds r0, r7 - lsls r0, 3 - adds r1, 0x12 - adds r5, r0, r1 - ldr r2, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174150 - bl Free - movs r0, 0 - str r0, [r4] -_08174150: - ldr r4, =gUnknown_0203BCD8 - 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, =gUnknown_030022C0 - 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, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gUnknown_030022C0 - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _08174308 - .pool -_08174200: - bl sub_8174F70 - ldr r1, =gUnknown_030022C0 - 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, =gUnknown_030022C0 - 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, =gUnknown_030022C0 - 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, =gUnknown_030022C0 - 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, =gTasks + 0x8 - 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, =gUnknown_0203BCD8 - 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, =gTasks - 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, =gUnknown_0203BCD8 - 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, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - subs r0, r2, 0x1 - b _081743C6 - .pool -_081743BC: - ldr r0, =gTasks - 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, =gTasks - 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, =gUnknown_0203BCD8 - ldr r3, [r0] - movs r5, 0 - ldr r1, =gTasks - 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, =gUnknown_0203BCD4 - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gTasks + 0x8 - adds r1, r2 - strh r0, [r1] - b _0817454E - .pool -_08174540: - adds r0, r5, 0x5 - lsls r0, 1 - add r0, r9 - ldr r4, =gTasks + 0x8 - 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, =gStringVar1 - ldr r1, =gTasks - 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 ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gUnknown_085E8C00 - adds r0, r5, 0 - bl StringExpandPlaceholders - 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, =gTasks - 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, =gUnknown_0203BCD8 - ldr r5, [r0] - movs r3, 0 - ldr r1, =gTasks - 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, =gTasks + 0x8 - mov r10, r0 - ldr r1, =gUnknown_02020630 - 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, =gTasks - adds r6, r1, r0 - movs r2, 0xC - ldrsh r0, [r6, r2] - adds r0, 0x5 - lsls r0, 1 - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_02020630 - 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, =gUnknown_0203BCD4 - 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, =gUnknown_030022C0 - ldrh r2, [r1, 0x2E] - movs r0, 0x1 - ands r0, r2 - adds r3, r1, 0 - cmp r0, 0 - beq _081747E4 - ldr r0, =gTasks - 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, =gTasks - 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, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_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, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_08174806: - ldr r0, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02037B14 - ldr r1, =gUnknown_02037714 - 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, =gTasks - 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, =gTasks + 0x8 - 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, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174974 - bl Free - movs r0, 0 - str r0, [r4] -_08174974: - ldr r4, =gUnknown_0203BCD8 - 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, =gTasks - 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, =gUnknown_030022C0 - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08174A28 - ldr r0, =gTasks - 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 StringCopy - 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 StringCopy - 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 StringCopy - adds r6, r0, 0 - ldrb r1, [r7, 0x9] - lsrs r1, 1 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - 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 StringCopy - adds r6, r0, 0 - ldrh r1, [r7] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - 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, =gSaveBlock2Ptr - 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, =gSaveBlock2Ptr - 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, =gUnknown_0300301C - 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, =gUnknown_0203BCDC - 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, =gUnknown_0203BCDC - 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, =gUnknown_0203BCDC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08175114 - .pool -_08175108: - ldr r0, =gUnknown_0203BCDC - 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 Random - 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 Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl Random - 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, =gUnknown_02020630 - adds r4, r1, r0 - bl Random - 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 Random - 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, =gUnknown_020375E0 - 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, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r4] - strh r1, [r0, 0xA] - ldr r0, =gUnknown_020375E2 - 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, =gTasks - 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 Random - 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, =gTasks + 0x8 - 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, =gUnknown_020375E0 - strh r7, [r0] - ldr r1, =gUnknown_020375E2 - 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 Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r5, r0, 0 - lsls r5, 16 - asrs r5, 16 - bl Random - 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 Random - 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 Random - 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, =gUnknown_020375E0 - strh r7, [r0] - ldr r1, =gUnknown_020375E2 - 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, =gUnknown_030022C0 - ldrh r1, [r0, 0x2C] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08175522 - ldr r0, =gUnknown_0203BCE4 - ldrb r0, [r0] - cmp r0, 0 - beq _08175522 - ldr r2, =gTasks - ldr r0, =gUnknown_0203BCE2 - 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, =gUnknown_0203BCE5 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_0203BCE5 - mov r1, r8 - strb r1, [r0] - ldr r4, =gUnknown_0203BCE8 - 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, =gUnknown_0203BCE2 - 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, =gUnknown_02037FD4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175764 - ldr r0, =gTasks - 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, =gTasks - 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, =gUnknown_0203BCE0 - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gUnknown_030022C0 - 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, =gUnknown_0300301C - 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, =gUnknown_030022C0 - 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, =gTasks - 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, =gUnknown_0203BD28 - 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, =gTasks - 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, =gUnknown_02037FD4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175B0A - adds r0, r4, 0 - bl sub_8176CA0 - ldr r0, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gUnknown_02037FD4 - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08175CB8 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0 - beq _08175C62 - ldr r0, =gUnknown_030022C0 - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gUnknown_02037FD4 - 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, =gUnknown_0203BCE0 - 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, =gTasks - 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, =gUnknown_02037FD4 - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gUnknown_0203BCE8 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_0203BCE8 - 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, =gUnknown_0203BCE8 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_0203BCE8 - 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, =gTasks - 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, =gTasks - 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 Sin - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176390 - .pool -_0817636C: - ldr r7, =gUnknown_0203BD26 - 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 Sin - strh r0, [r7] -_08176390: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - b _08176514 - .pool -_0817639C: - ldr r3, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 Sin - ldr r1, =gUnknown_0203BD26 - strh r0, [r1] - b _08176514 - .pool -_08176464: - ldr r2, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gTasks - 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, =gUnknown_02020630 - ldr r0, =gTasks - 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, =gUnknown_02020630 - ldr r0, =gTasks - 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, =gUnknown_02020630 - ldr r0, =gTasks - 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, =gUnknown_02020630 - ldr r0, =gTasks - 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, =gUnknown_02020630 - ldr r0, =gTasks - 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, =gTasks - 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, =gUnknown_030022C0 - 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, =gUnknown_0203BD24 - movs r0, 0x22 - strh r0, [r1] - ldr r1, =gUnknown_0203BD26 - 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, =gSaveBlock2Ptr - 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, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gUnknown_02020630 - 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, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - strh r2, [r4, 0x12] - ldr r6, =gUnknown_02020630 - 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, =gUnknown_030022C0 - 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, =gTasks - 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, =gUnknown_0203BD28 - 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, =gUnknown_0203BD28 - 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, =gUnknown_0203BD28 - 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, =gUnknown_0203BD26 - 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, =gUnknown_0203BD28 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_0203BD28 - 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, =gUnknown_0203BCE8 - 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, =gUnknown_0203BCE8 - 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, =gUnknown_0203BCE8 - mov r9, r0 - ldr r1, =0x0000039a - mov r8, r1 - movs r7, 0 - b _08177450 - .pool -_0817744C: - cmp r6, 0x46 - bhi _081774AC -_08177450: - bl Random - 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, =gUnknown_0203BCE8 - 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_81700F8.s b/asm/rom_81700F8.s new file mode 100644 index 000000000..b17d1d2c7 --- /dev/null +++ b/asm/rom_81700F8.s @@ -0,0 +1,64 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + 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, =gUnknown_030022C0 + 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, =gUnknown_03006210 + ldrh r0, [r0] + cmp r0, 0 + beq _08170148 + cmp r0, 0x2 + bne _0817014C +_08170148: + bl init_sav2 +_0817014C: + ldr r0, =gSaveBlock2Ptr + ldr r0, [r0] + ldrb r0, [r0, 0x15] + lsls r0, 31 + lsrs r0, 31 + bl SetPokemonCryStereo + 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 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom_817B064.s b/asm/rom_817C95C.s similarity index 61% rename from asm/rom_817B064.s rename to asm/rom_817C95C.s index 362d35c30..0375f71df 100644 --- a/asm/rom_817B064.s +++ b/asm/rom_817C95C.s @@ -5,3016 +5,6 @@ .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, =gUnknown_0203BD28 - movs r0, 0 - strh r0, [r1] - ldr r1, =gUnknown_0300301C - 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, =gUnknown_0300301C - movs r0, 0x8 - strb r0, [r1] - ldr r1, =gUnknown_0203BD28 - 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, =gTasks - 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, =gTasks - 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, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - 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, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - 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, =gUnknown_0203BD24 - ldrh r1, [r0] - movs r0, 0x1A - bl SetGpuReg -_0817B4FA: - ldr r0, =gTasks - 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, =gUnknown_0203BD24 - 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, =gUnknown_030022C0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gUnknown_02037FD4 - 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, =gUnknown_02037714 - ldrh r1, [r2, 0x12] - mov r0, sp - strh r1, [r0] - ldrh r1, [r2, 0x14] - b _0817B596 - .pool -_0817B58C: - ldr r2, =gUnknown_02037714 - 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, =gUnknown_030022C0 - ldr r2, [r0, 0x20] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _0817B620 - ldr r0, =gUnknown_02037FD4 - 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, =gUnknown_0203BD28 - 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, =gUnknown_0203BD24 - ldr r0, =gUnknown_0203BD26 - ldrh r0, [r0] - ldrh r1, [r1] - adds r0, r1 - b _0817B68C - .pool -_0817B688: - ldr r0, =gUnknown_0203BD24 - 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, =gUnknown_02020630 - 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, =gUnknown_02020638 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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, =gUnknown_02020630 - 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 Sin - 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 Cos - 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, =gUnknown_02020630 - 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 Sin - 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 Cos - strh r0, [r4, 0x24] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 26 - lsrs r0, 24 - movs r1, 0x28 - bl Sin - 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, =gUnknown_02020630 - 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 Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x3A] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Cos - 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, =gUnknown_02020630 - 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 Sin - 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 Random - ldr r6, =gUnknown_02020630 - 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 Random - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gTasks - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =gUnknown_02037B54 - ldr r1, =gUnknown_02037754 - 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, =gTasks - 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 Random - 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, =gTasks - 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, =gUnknown_02037FD4 - 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, =gTasks - 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, =gTasks - lsls r5, r4, 2 - adds r5, r4 - lsls r5, 3 - adds r5, r0 - movs r0, 0 - strh r0, [r5, 0x26] - ldr r0, =gUnknown_02037B54 - ldr r1, =gUnknown_02037754 - 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, =gTasks - 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 Random - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02020630 - 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, =gUnknown_02037D14 - 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, =gTasks - 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, =gTasks - 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, =gTasks - 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, =gUnknown_02020630 - mov r8, r1 - ldr r1, =gTasks - 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, =gUnknown_02020630 - mov r8, r1 - ldr r1, =gTasks - 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, =gUnknown_02037318 - ldrb r0, [r0, 0x17] - bl is_light_level_1_2_3_or_6 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0817C8D8 - movs r0, 0 - b _0817C8E6 - .pool -_0817C8D8: - ldr r1, =gUnknown_03005DB0 - ldr r0, =hm_add_c3_launch_phase_2 - str r0, [r1] - ldr r1, =gUnknown_0203CEEC - 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, =gUnknown_02038C08 - 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, =gTasks - 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} diff --git a/asm/unknown_task.s b/asm/unknown_task.s new file mode 100644 index 000000000..0d9b6a1dd --- /dev/null +++ b/asm/unknown_task.s @@ -0,0 +1,593 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start remove_some_task +remove_some_task: @ 80B9FB8 + push {r4,lr} + ldr r4, =gUnknown_02039B28 + 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, =gUnknown_02038C28 + ldr r2, =0x01000780 + bl CpuSet + ldr r0, =gUnknown_02039B28 + 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, =gUnknown_02039B28 + ldr r1, =gUnknown_02038C2A + 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, =gUnknown_02039B28 + ldr r1, =gUnknown_02038C2C + 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, =gUnknown_02039B28 + 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, =gUnknown_02039B44 + 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, =gUnknown_02039B28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + 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, =gUnknown_02039B28 + ldr r2, [r0, 0x8] + ldrb r1, [r0, 0x14] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 7 + ldr r1, =gUnknown_02038C28 + 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, =gUnknown_02039B44 + ldrb r0, [r0] + cmp r0, 0 + beq _080BA1A4 + mov r0, r12 + bl DestroyTask + ldr r1, =gUnknown_02039B28 + movs r0, 0xFF + strb r0, [r1, 0x18] + b _080BA324 + .pool +_080BA1A4: + ldr r1, =gTasks + 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, =gUnknown_02022E14 + b _080BA24E + .pool +_080BA21C: + ldr r0, =gUnknown_02022E16 + b _080BA24E + .pool +_080BA224: + ldr r0, =gUnknown_02022E18 + b _080BA24E + .pool +_080BA22C: + ldr r0, =gUnknown_02022E1A + b _080BA24E + .pool +_080BA234: + ldr r0, =gUnknown_02022E1C + b _080BA24E + .pool +_080BA23C: + ldr r0, =gUnknown_02022E1E + b _080BA24E + .pool +_080BA244: + ldr r0, =gUnknown_02022E20 + b _080BA24E + .pool +_080BA24C: + ldr r0, =gUnknown_02022E22 +_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, =gUnknown_02038C28 + ldr r0, =gUnknown_02039B28 + 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, =gUnknown_02038C28 + adds r7, r1, 0 + lsls r0, r2, 1 + adds r4, r0, r5 + ldr r0, =gUnknown_02039B28 + 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, =gTasks + 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, =gUnknown_02039B28 + strb r7, [r0, 0x18] + ldr r0, =gUnknown_02039B44 + movs r1, 0 + strb r1, [r0] + ldr r4, =gUnknown_02038EA8 + 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_806F640.s b/asm/util.s similarity index 100% rename from asm/rom_806F640.s rename to asm/util.s diff --git a/asm/var.s b/asm/var.s deleted file mode 100644 index 333dee065..000000000 --- a/asm/var.s +++ /dev/null @@ -1,105 +0,0 @@ - .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, =gSaveBlock1Ptr - 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/ld_script.txt b/ld_script.txt index 6fb2fbeb8..34b07ab1b 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -58,10 +58,10 @@ SECTIONS { asm/pokemon_1.o(.text); asm/calculate_base_damage.o(.text); asm/pokemon_2.o(.text); - asm/rom_806BD04.o(.text); + asm/pokemon_3.o(.text); asm/trig.o(.text); asm/rng.o(.text); - asm/rom_806F640.o(.text); + asm/util.o(.text); asm/blend_palette.o(.text); asm/daycare.o(.text); asm/egg_hatch.o(.text); @@ -85,16 +85,18 @@ SECTIONS { 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/field_control_avatar.o(.text); + asm/event_data.o(.text); + asm/coord_event_weather.o(.text); + asm/field_tasks.o(.text); + asm/clock.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); + asm/battle_anim.o(.text); + asm/rom_80A5C6C.o(.text); src/task.o(.text); asm/rom5.o(.text); asm/title_screen.o(.text); @@ -106,7 +108,7 @@ SECTIONS { asm/fldeff_emotion.o(.text); asm/wild_encounter.o(.text); asm/field_effect.o(.text); - asm/rom_80B5E6C.o(.text); + asm/unknown_task.o(.text); asm/option_menu.o(.text); asm/pokedex.o(.text); asm/trainer_card.o(.text); @@ -176,15 +178,24 @@ SECTIONS { asm/rom_8158B30.o(.text); asm/player_pc.o(.text); asm/intro.o(.text); - asm/rom_816F318.o(.text); + asm/rom_81700F8.o(.text); + asm/field_region_map.o(.text); + asm/battle_anim_8170478.o(.text); + asm/hall_of_fame.o(.text); + asm/credits.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/braille_puzzles.o(.text); + asm/pokeblock_feed.o(.text); asm/clear_save_data_screen.o(.text); - asm/rom_817B064.o(.text); + asm/intro_credits_graphics.o(.text); + asm/evolution_graphics.o(.text); + asm/bard_music.o(.text); + asm/fldeff_teleport.o(.text); + asm/rom_817C95C.o(.text); asm/front_pic_anim.o(.text); asm/rom_8184DA4.o(.text); src/multiboot.o(.text);