From b2ac3b6d6f06ed4a2d64af90e97796c66bcdeb5f Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Tue, 18 Dec 2018 19:03:26 -0600 Subject: [PATCH] Decompile most of battle_anim_effects_3.c --- asm/battle_anim_815A0D4.s | 12488 ---------------------------------- asm/battle_anim_effects_3.s | 1632 +++++ include/battle_anim.h | 6 + include/graphics.h | 13 +- include/scanline_effect.h | 1 + ld_script.txt | 6 +- src/battle_anim_80A5C6C.c | 2 +- src/battle_anim_815A0D4.c | 1092 --- src/battle_anim_effects_3.c | 4889 +++++++++++++ src/graphics.c | 6 +- 10 files changed, 6543 insertions(+), 13592 deletions(-) delete mode 100644 asm/battle_anim_815A0D4.s create mode 100644 asm/battle_anim_effects_3.s delete mode 100755 src/battle_anim_815A0D4.c create mode 100755 src/battle_anim_effects_3.c diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s deleted file mode 100644 index 84f7a7883..000000000 --- a/asm/battle_anim_815A0D4.s +++ /dev/null @@ -1,12488 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_815A0D4 -sub_815A0D4: @ 815A0D4 - push {lr} - adds r2, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r3, [r2, 0x20] - adds r0, r3 - strh r0, [r2, 0x20] - ldrh r0, [r1, 0x2] - ldrh r3, [r2, 0x22] - adds r0, r3 - strh r0, [r2, 0x22] - movs r3, 0x6 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815A0FC - ldrh r0, [r1, 0x4] - b _0815A100 - .pool -_0815A0FC: - ldrh r0, [r1, 0x4] - negs r0, r0 -_0815A100: - strh r0, [r2, 0x2E] - ldrh r0, [r1, 0x8] - strh r0, [r2, 0x30] - ldr r0, =sub_815A114 - str r0, [r2, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A0D4 - - thumb_func_start sub_815A114 -sub_815A114: @ 815A114 - push {lr} - adds r3, r0, 0 - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0 - ble _0815A154 - ldrh r1, [r3, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r3, 0x24] - ldrh r0, [r3, 0x2E] - adds r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - b _0815A15A -_0815A154: - adds r0, r3, 0 - bl DestroyAnimSprite -_0815A15A: - pop {r0} - bx r0 - thumb_func_end sub_815A114 - - thumb_func_start sub_815A160 -sub_815A160: @ 815A160 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r6, =gBattleAnimTarget - ldrb r0, [r6] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 8 - movs r0, 0x80 - lsls r0, 12 - adds r4, r0 - asrs r4, 16 - ldrb r0, [r6] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 8 - movs r0, 0x80 - lsls r0, 12 - adds r1, r0 - asrs r1, 16 - adds r0, r4, 0 - movs r2, 0 - bl sub_807521C - adds r0, r5, 0 - bl DestroyAnimVisualTask - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A160 - - thumb_func_start sub_815A1B0 -sub_815A1B0: @ 815A1B0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x5A - strh r0, [r4, 0x2E] - ldr r0, =WaitAnimForDuration - str r0, [r4, 0x1C] - movs r0, 0x7 - strh r0, [r4, 0x30] - ldr r1, =sub_815A1F4 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1B0 - - thumb_func_start sub_815A1F4 -sub_815A1F4: @ 815A1F4 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815A228 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A234 - str r0, [r4, 0x1C] -_0815A228: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A1F4 - - thumb_func_start sub_815A234 -sub_815A234: @ 815A234 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A234 - - thumb_func_start sub_815A254 -sub_815A254: @ 815A254 - push {r4-r7,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A6980 - ldrh r0, [r5, 0x20] - subs r0, r7 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r5, 0x22] - subs r1, r6 - lsls r1, 16 - asrs r1, 16 - bl ArcTan2Neg - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 23 - adds r0, r1 - lsrs r4, r0, 16 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815A2B2 - movs r1, 0x80 - lsls r1, 7 - adds r0, r4, r1 - lsls r0, 16 - lsrs r4, r0, 16 -_0815A2B2: - movs r3, 0x80 - lsls r3, 1 - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - adds r2, r3, 0 - bl TrySetSpriteRotScale - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - strh r7, [r5, 0x32] - strh r6, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A254 - - thumb_func_start sub_815A2F0 -sub_815A2F0: @ 815A2F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x4 - strh r0, [r4, 0x2E] - ldr r0, =sub_815A31C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A2F0 - - thumb_func_start sub_815A31C -sub_815A31C: @ 815A31C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815A342 - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - b _0815A346 -_0815A342: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 -_0815A346: - strh r0, [r4, 0x2E] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0xF - beq _0815A354 - cmp r0, 0x4 - bne _0815A35C -_0815A354: - ldrh r0, [r4, 0x30] - movs r1, 0x1 - eors r0, r1 - strh r0, [r4, 0x30] -_0815A35C: - ldrh r0, [r4, 0x32] - adds r1, r0, 0x1 - strh r1, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x46 - ble _0815A3A0 - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - movs r0, 0 - strh r0, [r4, 0x32] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r0, [r2] - movs r1, 0x80 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A3AC - str r0, [r4, 0x1C] -_0815A3A0: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A31C - - thumb_func_start sub_815A3AC -sub_815A3AC: @ 815A3AC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x32] - adds r1, r0, 0x1 - strh r1, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - ble _0815A3E8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - subs r2, 0x12 - ldrb r1, [r2] - movs r0, 0x7F - ands r0, r1 - strb r0, [r2] - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815A3E8 - ldr r0, =sub_815A3F0 - str r0, [r3, 0x1C] -_0815A3E8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3AC - - thumb_func_start sub_815A3F0 -sub_815A3F0: @ 815A3F0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x6 - bhi _0815A448 - lsls r0, 2 - ldr r1, =_0815A40C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A40C: - .4byte _0815A428 - .4byte _0815A428 - .4byte _0815A432 - .4byte _0815A432 - .4byte _0815A440 - .4byte _0815A440 - .4byte _0815A448 -_0815A428: - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x24] - strh r1, [r4, 0x26] - b _0815A450 -_0815A432: - ldr r0, =0x0000ffff - strh r0, [r4, 0x24] - movs r0, 0 - b _0815A44E - .pool -_0815A440: - movs r0, 0 - strh r0, [r4, 0x24] - movs r0, 0x1 - b _0815A44E -_0815A448: - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =0x0000ffff -_0815A44E: - strh r0, [r4, 0x26] -_0815A450: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815A462 - strh r2, [r4, 0x34] -_0815A462: - ldrh r0, [r4, 0x36] - adds r1, r0, 0x1 - strh r1, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0815A48C - movs r0, 0x10 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x30] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldrh r1, [r4, 0x2E] - movs r0, 0x52 - bl SetGpuReg - ldr r0, =sub_815A49C - str r0, [r4, 0x1C] -_0815A48C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A3F0 - - thumb_func_start sub_815A49C -sub_815A49C: @ 815A49C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815A4CC - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] -_0815A4CC: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A4E0 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815A4E0: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815A4FE - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite -_0815A4FE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815A49C - - thumb_func_start sub_815A504 -sub_815A504: @ 815A504 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_815A52C - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A504 - - thumb_func_start sub_815A52C -sub_815A52C: @ 815A52C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_80A6D94 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gTasks - lsls r5, r4, 2 - adds r1, r5, r4 - lsls r1, 3 - adds r1, r7 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A59C - ldr r0, =gPlttBufferFaded - lsls r2, r6, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r3, [r1] - mov r8, r3 - movs r3, 0xA - mov r9, r7 - adds r7, r5, 0 - mov r12, r0 - adds r5, r2, 0 - lsls r0, r6, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A57A: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r3, 0x1 - cmp r3, 0 - bgt _0815A57A - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - mov r2, r8 - strh r2, [r0] - adds r0, r7, r4 - lsls r0, 3 - add r0, r9 - strh r1, [r0, 0x12] -_0815A59C: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A5AC - adds r0, r4, 0 - bl DestroyTask -_0815A5AC: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A52C - - thumb_func_start sub_815A5C8 -sub_815A5C8: @ 815A5C8 - 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_815A5F0 - str r0, [r1] - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_815A5C8 - - thumb_func_start sub_815A5F0 -sub_815A5F0: @ 815A5F0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl sub_80A6D94 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gTasks - mov r0, r8 - lsls r3, r0, 2 - adds r1, r3, r0 - lsls r1, 3 - adds r1, r5 - ldrh r0, [r1, 0x12] - adds r0, 0x1 - strh r0, [r1, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815A692 - ldr r0, =gPlttBufferFaded - lsls r2, r7, 4 - adds r1, r2, 0 - adds r1, 0xB - lsls r1, 1 - adds r1, r0 - ldrh r6, [r1] - movs r4, 0xA - mov r10, r3 - mov r9, r0 - adds r5, r2, 0 - ldr r2, =gPlttBufferUnfaded - mov r12, r2 - lsls r0, r7, 5 - add r0, r9 - adds r3, r0, 0 - adds r3, 0x14 -_0815A644: - ldrh r0, [r3] - strh r0, [r1] - subs r3, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A644 - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r9 - strh r6, [r0] - adds r1, r5, 0 - adds r1, 0xB - lsls r1, 1 - add r1, r12 - ldrh r6, [r1] - movs r4, 0xA - lsls r0, r7, 5 - add r0, r12 - adds r2, r0, 0 - adds r2, 0x14 -_0815A66E: - ldrh r0, [r2] - strh r0, [r1] - subs r2, 0x2 - subs r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bgt _0815A66E - adds r0, r5, 0x1 - lsls r0, 1 - add r0, r12 - movs r1, 0 - strh r6, [r0] - mov r0, r10 - add r0, r8 - lsls r0, 3 - ldr r2, =gTasks - adds r0, r2 - strh r1, [r0, 0x12] -_0815A692: - ldr r0, =gBattleAnimArgs - ldrh r1, [r0, 0xE] - ldr r0, =0x0000ffff - cmp r1, r0 - bne _0815A6A2 - mov r0, r8 - bl DestroyTask -_0815A6A2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A5F0 - - thumb_func_start sub_815A6C4 -sub_815A6C4: @ 815A6C4 - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - mov r5, sp - adds r5, 0x2 - movs r1, 0 - mov r2, sp - adds r3, r5, 0 - bl SetAverageBattlerPositions - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815A6F8 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - negs r0, r0 - strh r0, [r1, 0x4] -_0815A6F8: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - mov r2, sp - ldrh r0, [r1, 0x4] - ldrh r2, [r2] - adds r0, r2 - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - ldrh r5, [r5] - adds r0, r5 - strh r0, [r4, 0x36] - ldr r0, =0x0000ffce - strh r0, [r4, 0x38] - adds r0, r4, 0 - bl InitAnimArcTranslation - ldr r0, =sub_815A73C - str r0, [r4, 0x1C] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A6C4 - - thumb_func_start sub_815A73C -sub_815A73C: @ 815A73C - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimArc - lsls r0, 24 - cmp r0, 0 - beq _0815A75E - movs r1, 0 - movs r0, 0x1E - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - ldr r0, =WaitAnimForDuration - str r0, [r4, 0x1C] - ldr r1, =sub_815A76C - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 -_0815A75E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A73C - - thumb_func_start sub_815A76C -sub_815A76C: @ 815A76C - push {lr} - adds r3, r0, 0 - ldrh r1, [r3, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815A798 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] -_0815A798: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x10 - bne _0815A7AC - adds r0, r3, 0 - bl DestroyAnimSprite -_0815A7AC: - pop {r0} - bx r0 - thumb_func_end sub_815A76C - - thumb_func_start sub_815A7B0 -sub_815A7B0: @ 815A7B0 - push {r4,r5,lr} - adds r4, r0, 0 - bl SetSpriteCoordsToAnimAttackerCoords - ldr r5, =gBattleAnimArgs - movs r0, 0 - ldrsh r1, [r5, r0] - adds r0, r4, 0 - bl sub_80A6864 - ldrh r0, [r5, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =RunStoredCallbackWhenAnimEnds - str r0, [r4, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A7B0 - - thumb_func_start sub_815A7EC -sub_815A7EC: @ 815A7EC - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815A84C - adds r0, r4, 0 - bl SetSpriteCoordsToAnimAttackerCoords - ldr r5, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r5, r2] - adds r0, r4, 0 - bl sub_80A6864 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815A840 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815A830 - ldrh r0, [r5, 0x4] - b _0815A846 - .pool -_0815A830: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 - strh r0, [r4, 0x30] - movs r2, 0x6 - ldrsh r0, [r5, r2] - negs r0, r0 - b _0815A84A -_0815A840: - movs r1, 0x4 - ldrsh r0, [r5, r1] - negs r0, r0 -_0815A846: - strh r0, [r4, 0x30] - ldrh r0, [r5, 0x6] -_0815A84A: - strh r0, [r4, 0x32] -_0815A84C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - movs r3, 0xFF - ldrh r1, [r4, 0x30] - ldrh r2, [r4, 0x34] - adds r1, r2 - strh r1, [r4, 0x34] - ldrh r1, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r1, r2 - strh r1, [r4, 0x36] - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - strh r1, [r4, 0x24] - ands r0, r3 - movs r1, 0x5 - bl Sin - movs r2, 0x36 - ldrsh r1, [r4, r2] - lsrs r2, r1, 31 - adds r1, r2 - asrs r1, 1 - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0xF0 - bls _0815A8A4 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815A8A4: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815A7EC - - thumb_func_start sub_815A8AC -sub_815A8AC: @ 815A8AC - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815A8C2 - adds r0, r2, 0 - bl DestroyAnimSprite -_0815A8C2: - pop {r0} - bx r0 - thumb_func_end sub_815A8AC - - thumb_func_start AnimTask_IsTargetPlayerSide -AnimTask_IsTargetPlayerSide: @ 815A8C8 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815A8EC - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A8F0 - .pool -_0815A8EC: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A8F0: - strh r0, [r1, 0xE] - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_IsTargetPlayerSide - - thumb_func_start AnimTask_IsHealingMove -AnimTask_IsHealingMove: @ 815A904 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gAnimMoveDmg - ldr r0, [r0] - cmp r0, 0 - ble _0815A920 - ldr r1, =gBattleAnimArgs - movs r0, 0 - b _0815A924 - .pool -_0815A920: - ldr r1, =gBattleAnimArgs - movs r0, 0x1 -_0815A924: - strh r0, [r1, 0xE] - adds r0, r2, 0 - bl DestroyAnimVisualTask - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_IsHealingMove - - thumb_func_start sub_815A934 -sub_815A934: @ 815A934 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gBattle_WIN0H - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_WIN0V - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815A9A0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A934 - - thumb_func_start sub_815A9A0 -sub_815A9A0: @ 815A9A0 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0815AA60 - lsls r0, 2 - ldr r1, =_0815A9BC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815A9BC: - .4byte _0815A9D4 - .4byte _0815A9F2 - .4byte _0815AA12 - .4byte _0815A9F2 - .4byte _0815AA32 - .4byte _0815AA42 -_0815A9D4: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - b _0815AA3A -_0815A9F2: - ldrh r0, [r4, 0x30] - adds r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x15 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA12: - ldrh r0, [r4, 0x30] - subs r0, 0x75 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x29 - bne _0815AA60 - movs r0, 0 - strh r0, [r4, 0x32] - b _0815AA3A -_0815AA32: - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim -_0815AA3A: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815AA60 -_0815AA42: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815AA60 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815AA6C - str r0, [r4, 0x1C] -_0815AA60: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815A9A0 - - thumb_func_start sub_815AA6C -sub_815AA6C: @ 815AA6C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AA6C - - thumb_func_start sub_815AAA4 -sub_815AAA4: @ 815AAA4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AAD0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815AAD0: - ldrh r0, [r6] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r3, 0 - strh r0, [r5, 0x20] - ldrh r0, [r6, 0x2] - ldrh r4, [r5, 0x22] - adds r0, r4 - strh r0, [r5, 0x22] - ldrh r2, [r5, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r4, =0x000003ff - adds r0, r4, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r5, 0x4] - movs r1, 0x4 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815AB2C - ldrb r1, [r5, 0x3] - movs r0, 0x3F - negs r0, r0 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - ldr r0, =0x0000fff4 - strh r0, [r5, 0x24] - movs r0, 0x2 - b _0815AB32 - .pool -_0815AB2C: - movs r0, 0xC - strh r0, [r5, 0x24] - ldr r0, =0x0000fffe -_0815AB32: - strh r0, [r5, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x8] - strh r0, [r5, 0x2E] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmp r0, 0xFF - beq _0815AB46 - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] -_0815AB46: - ldr r0, =sub_815AB5C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AAA4 - - thumb_func_start sub_815AB5C -sub_815AB5C: @ 815AB5C - push {r4,lr} - adds r4, r0, 0 - ldrh r2, [r4, 0x32] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815AB9A - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0815ABBA - adds r0, r2, 0x1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABBA - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xDE - bl PlaySE1WithPanning - b _0815ABBA -_0815AB9A: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x24] - movs r1, 0x24 - ldrsh r0, [r4, r1] - cmp r0, 0 - bge _0815ABAC - negs r0, r0 -_0815ABAC: - cmp r0, 0xC - bne _0815ABBA - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - subs r0, r2, 0x1 - strh r0, [r4, 0x32] -_0815ABBA: - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815ABC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815ABC8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815AB5C - - thumb_func_start sub_815ABD0 -sub_815ABD0: @ 815ABD0 - push {lr} - ldrb r2, [r0, 0x1] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x1] - movs r1, 0xFF - strh r1, [r0, 0x34] - bl sub_815AAA4 - pop {r0} - bx r0 - thumb_func_end sub_815ABD0 - - thumb_func_start sub_815ABEC -sub_815ABEC: @ 815ABEC - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815AC40 - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gBattle_WIN1H - ldr r2, =0x000098f0 - adds r0, r2, 0 - strh r0, [r1] - ldr r1, =gBattle_WIN1V - movs r0, 0xA0 - strh r0, [r1] - ldr r0, =gBattle_WIN0H - ldrh r1, [r0] - movs r0, 0x42 - bl SetGpuReg - ldr r0, =gBattle_WIN0V - ldrh r1, [r0] - movs r0, 0x46 - bl SetGpuReg - b _0815AC70 - .pool -_0815AC40: - ldr r1, =0x00001f3f - movs r0, 0x48 - bl SetGpuReg - ldr r1, =gBattle_WIN1H - movs r0, 0xF0 - strh r0, [r1] - ldr r4, =gBattle_WIN1V - ldr r1, =0x000078a0 - adds r0, r1, 0 - strh r0, [r4] - movs r0, 0x42 - movs r1, 0xF0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x46 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl SetGpuRegBits -_0815AC70: - adds r0, r5, 0 - bl DestroyAnimVisualTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ABEC - - thumb_func_start sub_815AC8C -sub_815AC8C: @ 815AC8C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =0x00003f3f - movs r0, 0x48 - bl SetGpuReg - ldr r0, =gBattle_WIN1H - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_WIN1V - strh r1, [r0] - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815ACB8 - movs r1, 0x80 - lsls r1, 7 - movs r0, 0 - bl ClearGpuRegBits -_0815ACB8: - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AC8C - - thumb_func_start sub_815ACD0 -sub_815ACD0: @ 815ACD0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815ACEC - ldr r4, =gBattleAnimAttacker - b _0815ACEE - .pool -_0815ACEC: - ldr r4, =gBattleAnimTarget -_0815ACEE: - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x2] - adds r0, r6 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - ldr r2, =gBattleAnimArgs - ldrh r0, [r2, 0x4] - strh r0, [r5, 0x26] - movs r3, 0 - lsls r0, 16 - asrs r0, 16 - ldrh r4, [r2, 0x6] - movs r6, 0x6 - ldrsh r1, [r2, r6] - cmp r0, r1 - ble _0815AD26 - movs r3, 0x1 -_0815AD26: - strh r3, [r5, 0x2E] - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r0, [r2, 0x8] - strh r0, [r5, 0x32] - ldrh r0, [r2, 0xA] - strh r0, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_815AD4C - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ACD0 - - thumb_func_start sub_815AD4C -sub_815AD4C: @ 815AD4C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r2, 0x30] - ldr r1, =gSineTable - movs r3, 0x30 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x34] - ldrh r3, [r2, 0x26] - adds r1, r0, r3 - strh r1, [r2, 0x26] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _0815AD98 - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - bge _0815ADAA - adds r0, r2, 0 - bl DestroyAnimSprite - b _0815ADAA - .pool -_0815AD98: - lsls r0, r1, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r2, r3] - cmp r0, r1 - ble _0815ADAA - adds r0, r2, 0 - bl DestroyAnimSprite -_0815ADAA: - pop {r0} - bx r0 - thumb_func_end sub_815AD4C - - thumb_func_start sub_815ADB0 -sub_815ADB0: @ 815ADB0 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r5, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815ADDC - ldr r4, =gBattleAnimAttacker - b _0815ADDE - .pool -_0815ADDC: - ldr r4, =gBattleAnimTarget -_0815ADDE: - ldrb r0, [r4] - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r6, r0, 24 - ldrb r0, [r4] - bl sub_80A8364 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r6, 0 - adds r1, r0, 0 - adds r1, 0x24 - movs r2, 0 - strh r1, [r5, 0x8] - strh r1, [r5, 0xA] - subs r0, 0x21 - strh r0, [r5, 0xC] - cmp r0, 0 - bge _0815AE08 - strh r2, [r5, 0xC] -_0815AE08: - ldrh r0, [r5, 0x8] - strh r0, [r5, 0xE] - movs r0, 0x8 - strh r0, [r5, 0x10] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x12] - strh r2, [r5, 0x14] - strh r2, [r5, 0x16] - cmp r7, 0x1 - bne _0815AE30 - ldr r0, =gBattle_BG1_X - b _0815AE32 - .pool -_0815AE30: - ldr r0, =gBattle_BG2_X -_0815AE32: - ldrh r2, [r0] - strh r2, [r5, 0x18] - adds r3, r2, 0 - adds r3, 0xF0 - strh r3, [r5, 0x1A] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x1C] - movs r4, 0x4 - ldrsh r0, [r1, r4] - cmp r0, 0 - bne _0815AE54 - strh r3, [r5, 0x1E] - ldrh r3, [r5, 0x18] - b _0815AE58 - .pool -_0815AE54: - strh r2, [r5, 0x1E] - ldrh r3, [r5, 0x1A] -_0815AE58: - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r1, [r5, 0xC] - lsls r2, r1, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - bgt _0815AE8E - ldr r4, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r0, r4 - mov r12, r0 -_0815AE74: - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - add r1, r12 - strh r3, [r1] - adds r2, 0x1 - lsls r2, 16 - asrs r1, r2, 16 - movs r6, 0xE - ldrsh r0, [r5, r6] - cmp r1, r0 - ble _0815AE74 -_0815AE8E: - cmp r7, 0x1 - bne _0815AEA0 - ldr r0, =0x04000014 - b _0815AEA2 - .pool -_0815AEA0: - ldr r0, =0x04000018 -_0815AEA2: - str r0, [sp] - ldr r0, =0xa2600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl ScanlineEffect_SetParams - ldr r0, =sub_815AED8 - str r0, [r5] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ADB0 - - thumb_func_start sub_815AED8 -sub_815AED8: @ 815AED8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0x8] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF00 - strh r2, [r4, 0x8] -_0815AF00: - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF2C - ldrh r0, [r4, 0xA] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - ldrh r2, [r4, 0xC] - movs r3, 0xC - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0815AF30 - strh r2, [r4, 0xA] - movs r0, 0x1 - strh r0, [r4, 0x26] - b _0815AF30 - .pool -_0815AF2C: - subs r0, r1, 0x1 - strh r0, [r4, 0x10] -_0815AF30: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815AF5C - movs r0, 0 - strh r0, [r4, 0x14] - movs r1, 0 - movs r2, 0x16 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815AF4E - movs r1, 0x1 -_0815AF4E: - strh r1, [r4, 0x16] - cmp r1, 0 - beq _0815AF58 - ldrh r0, [r4, 0x18] - b _0815AF5A -_0815AF58: - ldrh r0, [r4, 0x1A] -_0815AF5A: - strh r0, [r4, 0x20] -_0815AF5C: - ldrh r1, [r4, 0x8] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _0815AF90 - ldr r5, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AF72: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x20] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x20] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - blt _0815AF72 -_0815AF90: - ldrh r1, [r4, 0xA] - lsls r3, r1, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0815AFC4 - ldr r5, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r6, r5, r0 -_0815AFA6: - asrs r3, 16 - lsls r1, r3, 1 - adds r2, r1, r5 - ldrh r0, [r4, 0x1E] - strh r0, [r2] - adds r1, r6 - ldrh r0, [r4, 0x1E] - strh r0, [r1] - adds r3, 0x1 - lsls r3, 16 - asrs r1, r3, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _0815AFA6 -_0815AFC4: - movs r3, 0x26 - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0815AFE0 - movs r1, 0x1C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815AFDA - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] -_0815AFDA: - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815AFE0: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AED8 - - thumb_func_start sub_815AFF0 -sub_815AFF0: @ 815AFF0 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r5, 0 - strh r5, [r4, 0x8] - strh r5, [r4, 0xA] - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrb r0, [r6] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x10] - ldr r0, =0x0000ffec - strh r0, [r4, 0x12] - strh r5, [r4, 0x14] - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B054 - str r0, [r4] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815AFF0 - - thumb_func_start sub_815B054 -sub_815B054: @ 815B054 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x5 - bls _0815B074 - b _0815B22E -_0815B074: - lsls r0, 2 - ldr r1, =_0815B088 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B088: - .4byte _0815B0A0 - .4byte _0815B160 - .4byte _0815B18E - .4byte _0815B1A2 - .4byte _0815B1B8 - .4byte _0815B220 -_0815B0A0: - movs r0, 0xC - ldrsh r2, [r6, r0] - ldrh r1, [r6, 0xA] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815B0B6 - movs r1, 0x10 - ldrsh r0, [r6, r1] - subs r0, r2, r0 - b _0815B0BC -_0815B0B6: - movs r1, 0x10 - ldrsh r0, [r6, r1] - adds r0, r2, r0 -_0815B0BC: - lsls r0, 16 - lsrs r1, r0, 16 - ldrh r2, [r6, 0x12] - ldrh r0, [r6, 0xE] - adds r2, r0 - ldr r0, =gUnknown_08593114 - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - ldrb r4, [r6, 0xA] - movs r3, 0x6 - subs r3, r4 - lsls r3, 24 - lsrs r3, 24 - bl CreateSprite - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xBA - bl PlaySE12WithPanning - cmp r4, 0x40 - beq _0815B120 - ldr r5, =gSprites - lsls r1, r4, 4 - adds r1, r4 - lsls r1, 2 - adds r3, r1, r5 - ldrh r0, [r6, 0xA] - movs r2, 0x1 - ands r2, r0 - adds r3, 0x3F - ldrb r4, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r4 - orrs r0, r2 - strb r0, [r3] - adds r5, 0x1C - adds r1, r5 - ldr r0, =SpriteCallbackDummy - str r0, [r1] -_0815B120: - ldrh r1, [r6, 0xA] - movs r4, 0x1 - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _0815B138 - ldrh r0, [r6, 0x10] - subs r0, 0x6 - strh r0, [r6, 0x10] - ldrh r0, [r6, 0x12] - subs r0, 0x6 - strh r0, [r6, 0x12] -_0815B138: - ldrh r1, [r6, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE2A0 - adds r0, r6, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r6, 0xA] - adds r0, 0x1 - strh r0, [r6, 0xA] - strh r4, [r6, 0x8] - b _0815B22E - .pool -_0815B160: - adds r0, r6, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815B22E - movs r2, 0xA - ldrsh r1, [r6, r2] - cmp r1, 0x6 - bne _0815B180 - movs r0, 0x8 - strh r0, [r6, 0x14] - movs r0, 0x3 - strh r0, [r6, 0x8] - b _0815B22E -_0815B180: - cmp r1, 0x2 - bgt _0815B186 - movs r0, 0xA -_0815B186: - strh r0, [r6, 0x14] - movs r0, 0x2 - strh r0, [r6, 0x8] - b _0815B22E -_0815B18E: - ldrh r0, [r6, 0x14] - movs r2, 0x14 - ldrsh r1, [r6, r2] - cmp r1, 0 - beq _0815B19E - subs r0, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B19E: - strh r1, [r6, 0x8] - b _0815B22E -_0815B1A2: - ldrh r1, [r6, 0x14] - movs r2, 0x14 - ldrsh r0, [r6, r2] - cmp r0, 0 - beq _0815B1B2 - subs r0, r1, 0x1 - strh r0, [r6, 0x14] - b _0815B22E -_0815B1B2: - movs r0, 0x4 - strh r0, [r6, 0x8] - b _0815B22E -_0815B1B8: - movs r5, 0 - movs r7, 0 - ldr r3, =gSprites - movs r0, 0x1C - adds r0, r3 - mov r8, r0 -_0815B1C4: - lsls r0, r5, 4 - adds r0, r5 - lsls r4, r0, 2 - adds r0, r3, 0 - adds r0, 0x14 - adds r0, r4, r0 - ldr r1, [r0] - ldr r0, =gUnknown_08593114 - cmp r1, r0 - bne _0815B200 - adds r0, r4, r3 - strh r2, [r0, 0x2E] - movs r1, 0x6 - strh r1, [r0, 0x30] - movs r1, 0x2 - str r2, [sp] - str r3, [sp, 0x4] - bl StartSpriteAnim - mov r0, r8 - adds r1, r4, r0 - ldr r0, =sub_815B23C - str r0, [r1] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r2, [sp] - ldr r3, [sp, 0x4] - cmp r7, 0x6 - beq _0815B20A -_0815B200: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3F - bls _0815B1C4 -_0815B20A: - strh r7, [r6, 0x14] - movs r0, 0x5 - strh r0, [r6, 0x8] - b _0815B22E - .pool -_0815B220: - movs r1, 0x14 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815B22E - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815B22E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815B054 - - thumb_func_start sub_815B23C -sub_815B23C: @ 815B23C - push {r4,lr} - adds r4, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815B270 - ldr r3, =gTasks - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x2E - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815B270: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B23C - - thumb_func_start sub_815B27C -sub_815B27C: @ 815B27C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815B290 - adds r0, r5, 0 - movs r1, 0 - bl InitAnimSpritePos -_0815B290: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - bgt _0815B2C2 - ldrh r0, [r5, 0x2E] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815B2B4 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _0815B2C0 -_0815B2B4: - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 -_0815B2C0: - strb r0, [r2] -_0815B2C2: - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x1E - ble _0815B2D8 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B2D8: - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3D - bne _0815B324 - ldr r1, =DestroyAnimSprite - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - ldrh r0, [r5, 0x24] - ldrh r2, [r5, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x26] - ldrh r2, [r5, 0x22] - adds r0, r2 - strh r0, [r5, 0x22] - strh r1, [r5, 0x24] - strh r1, [r5, 0x26] - movs r0, 0x14 - strh r0, [r5, 0x2E] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x32] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x36] - ldr r0, =StartAnimLinearTranslation - str r0, [r5, 0x1C] -_0815B324: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B27C - - thumb_func_start sub_815B338 -sub_815B338: @ 815B338 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B35C - cmp r0, 0x1 - beq _0815B37C - b _0815B38E - .pool -_0815B35C: - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE350 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B38E - .pool -_0815B37C: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B38E - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B38E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B338 - - thumb_func_start sub_815B394 -sub_815B394: @ 815B394 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0815B3F4 - cmp r0, 0x1 - bgt _0815B3B4 - cmp r0, 0 - beq _0815B3BE - b _0815B496 -_0815B3B4: - cmp r0, 0x2 - beq _0815B424 - cmp r0, 0x3 - beq _0815B478 - b _0815B496 -_0815B3BE: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - adds r0, r6, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - movs r0, 0x80 - lsls r0, 1 - strh r0, [r5, 0x30] - strh r0, [r5, 0x32] - b _0815B46C - .pool -_0815B3F4: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - subs r0, 0x1A - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815B424 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0815B424: - ldrh r0, [r5, 0x30] - adds r0, 0x60 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x30 - strh r0, [r5, 0x32] - movs r2, 0x30 - ldrsh r1, [r5, r2] - movs r0, 0x32 - ldrsh r2, [r5, r0] - adds r0, r6, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r5, 0x34] - adds r0, 0x1 - strh r0, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815B496 - movs r0, 0 - strh r0, [r5, 0x34] - ldr r1, =gSprites - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - adds r0, r6, 0 - bl ResetSpriteRotScale -_0815B46C: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815B496 - .pool -_0815B478: - ldrh r0, [r5, 0x26] - subs r0, 0x6 - strh r0, [r5, 0x26] - movs r1, 0x22 - ldrsh r0, [r5, r1] - movs r2, 0x26 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0815B496 - adds r0, r5, 0 - bl DestroyAnimSprite -_0815B496: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815B394 - - thumb_func_start sub_815B49C -sub_815B49C: @ 815B49C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4BC - ldr r0, =0x0000fff0 - b _0815B4C0 - .pool -_0815B4BC: - movs r0, 0x80 - lsls r0, 1 -_0815B4C0: - strh r0, [r4, 0x20] - movs r0, 0 - strh r0, [r4, 0x22] - ldr r0, =sub_815B4D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B49C - - thumb_func_start sub_815B4D4 -sub_815B4D4: @ 815B4D4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x48 - strh r0, [r4, 0x2E] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815B4F8 - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - b _0815B500 - .pool -_0815B4F8: - ldrh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 -_0815B500: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x30] - adds r0, 0x10 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r5, r0, r1 - strh r5, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x3 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0815B54C - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r1, r2 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r5 - lsls r2, 16 - asrs r2, 16 - adds r3, r4, 0 - adds r3, 0x43 - ldrb r3, [r3] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - bl CreateSpriteAndAnimate -_0815B54C: - movs r1, 0x20 - ldrsh r0, [r4, r1] - movs r2, 0x24 - ldrsh r1, [r4, r2] - adds r0, r1 - adds r0, 0x20 - movs r1, 0x98 - lsls r1, 1 - cmp r0, r1 - bls _0815B566 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815B566: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B4D4 - - thumb_func_start sub_815B570 -sub_815B570: @ 815B570 - push {r4,lr} - adds r4, r0, 0 - bl Random2 - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0815B58A - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x4 - b _0815B592 -_0815B58A: - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x5 -_0815B592: - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - movs r1, 0x7 - ands r0, r1 - adds r1, r0, 0 - cmp r1, 0x3 - ble _0815B5B4 - negs r0, r1 - lsls r0, 24 - lsrs r0, 24 -_0815B5B4: - lsls r0, 24 - asrs r0, 24 - strh r0, [r4, 0x26] - ldr r0, =sub_815B5D0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B570 - - thumb_func_start sub_815B5D0 -sub_815B5D0: @ 815B5D0 - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1D - bgt _0815B612 - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815B646 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r0, 0 - b _0815B644 -_0815B612: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x2 - bne _0815B628 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0815B628: - movs r1, 0x30 - ldrsh r0, [r3, r1] - cmp r0, 0x3 - bne _0815B640 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] -_0815B640: - ldrh r0, [r3, 0x30] - adds r0, 0x1 -_0815B644: - strh r0, [r3, 0x30] -_0815B646: - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x3C - ble _0815B654 - adds r0, r3, 0 - bl DestroySprite -_0815B654: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B5D0 - - thumb_func_start sub_815B65C -sub_815B65C: @ 815B65C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B69C - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3B8 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B6AE - .pool -_0815B69C: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B6AE - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B6AE: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B65C - - thumb_func_start sub_815B6B4 -sub_815B6B4: @ 815B6B4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B6F4 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE3E0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B706 - .pool -_0815B6F4: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B706 - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B706: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B6B4 - - thumb_func_start sub_815B70C -sub_815B70C: @ 815B70C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815B71E - cmp r0, 0x1 - beq _0815B748 - b _0815B770 -_0815B71E: - adds r0, r4, 0 - movs r1, 0 - bl InitAnimSpritePos - movs r0, 0x90 - lsls r0, 4 - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815B770 - .pool -_0815B748: - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - subs r2, 0x60 - strh r2, [r4, 0x30] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - ble _0815B770 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815B770: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815B70C - - thumb_func_start sub_815B778 -sub_815B778: @ 815B778 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815B7B8 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE430 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815B7CA - .pool -_0815B7B8: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815B7CA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815B7CA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815B778 - - thumb_func_start sub_815B7D0 -sub_815B7D0: @ 815B7D0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815B7F6 - b _0815BAFC -_0815B7F6: - lsls r0, 2 - ldr r1, =_0815B808 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815B808: - .4byte _0815B81C - .4byte _0815B86C - .4byte _0815B8A8 - .4byte _0815BA44 - .4byte _0815BA82 -_0815B81C: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815B844 - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0x1 - bl SetAnimBgAttribute - b _0815B84E - .pool -_0815B844: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815B84E: - ldr r0, =gTasks - mov r6, r8 - lsls r1, r6, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r1, 0x1C] - b _0815BA26 - .pool -_0815B86C: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _0815B886 - b _0815BAFC -_0815B886: - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0xF - beq _0815B8A6 - b _0815BAFC -_0815B8A6: - b _0815BA7A -_0815B8A8: - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - ldr r1, =gBattleAnimTarget - ldrb r1, [r1] - mov r2, r8 - lsls r4, r2, 2 - adds r2, r4, r2 - lsls r2, 3 - adds r2, r3 - ldrb r2, [r2, 0x1C] - bl HandleSpeciesGfxDataChange - ldrb r1, [r5] - mov r0, sp - bl sub_80A6BFC - bl IsContest - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - beq _0815B8E0 - movs r1, 0 - b _0815B8EA - .pool -_0815B8E0: - ldrb r0, [r5] - bl GetBattlerPosition - lsls r0, 24 - lsrs r1, r0, 24 -_0815B8EA: - ldr r0, =gMonSpritesGfxPtr - ldr r2, [r0] - lsls r0, r1, 2 - adds r2, 0x4 - adds r2, r0 - ldr r1, =gBattleMonForms - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r1, [r0] - lsls r1, 11 - ldr r0, [r2] - adds r0, r1 - ldr r1, [sp] - ldr r2, =0x04000200 - bl CpuSet - ldr r1, [sp] - movs r2, 0x80 - lsls r2, 4 - mov r0, sp - ldrh r3, [r0, 0xA] - movs r0, 0x1 - bl LoadBgTiles - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815BA1C - ldr r5, =gContestResources - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0] - bl IsSpeciesNotUnown - adds r4, r0, 0 - ldr r0, [r5] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl IsSpeciesNotUnown - lsls r4, 24 - lsls r0, 24 - cmp r4, r0 - beq _0815B99C - ldr r6, [sp, 0x4] - movs r5, 0 - movs r0, 0x7 - mov r12, r0 - movs r7, 0 -_0815B950: - movs r4, 0 - adds r3, r7, r6 - mov r1, r12 - lsls r0, r1, 1 - adds r2, r0, r6 -_0815B95A: - ldrh r1, [r3] - ldrh r0, [r2] - strh r0, [r3] - strh r1, [r2] - adds r3, 0x2 - subs r2, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - ble _0815B95A - movs r2, 0x20 - add r12, r2 - adds r7, 0x40 - adds r5, 0x1 - cmp r5, 0x7 - ble _0815B950 - movs r5, 0 - movs r0, 0x80 - lsls r0, 3 - adds r3, r0, 0 -_0815B980: - adds r2, r5, 0x1 - lsls r0, r5, 6 - adds r1, r0, r6 - movs r4, 0x7 -_0815B988: - ldrh r0, [r1] - eors r0, r3 - strh r0, [r1] - adds r1, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0815B988 - adds r5, r2, 0 - cmp r5, 0x7 - ble _0815B980 -_0815B99C: - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldrh r0, [r0, 0x2] - bl IsSpeciesNotUnown - lsls r0, 24 - cmp r0, 0 - beq _0815B9EC - ldr r3, =gSprites - ldr r4, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - b _0815BA06 - .pool -_0815B9EC: - ldr r3, =gSprites - ldr r4, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF694 -_0815BA06: - str r1, [r0] - ldrb r0, [r2] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815BA1C: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815BA26: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815BAFC - .pool -_0815BA44: - mov r1, r8 - lsls r0, r1, 2 - add r0, r8 - lsls r0, 3 - adds r4, r0, r3 - ldrh r0, [r4, 0xC] - adds r1, r0, 0x1 - strh r1, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815BAFC - movs r0, 0 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - ldrh r5, [r4, 0xA] - lsls r1, r5, 4 - orrs r1, r5 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - cmp r5, 0 - bne _0815BAFC -_0815BA7A: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BAFC -_0815BA82: - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAAC - movs r0, 0x1 - movs r1, 0x2 - movs r2, 0 - bl SetAnimBgAttribute - b _0815BAB6 - .pool -_0815BAAC: - movs r0, 0x2 - movs r1, 0x2 - movs r2, 0 - bl SetAnimBgAttribute -_0815BAB6: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BAF6 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815BAF6 - ldr r0, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r6, 0x1C - ldrsh r0, [r1, r6] - cmp r0, 0 - bne _0815BAF6 - ldrb r0, [r4] - ldr r1, =gBattleSpritesDataPtr - ldr r1, [r1] - ldr r2, [r1] - lsls r1, r0, 2 - adds r1, r2 - ldrh r1, [r1, 0x2] - bl SetBattlerShadowSpriteCallback -_0815BAF6: - mov r0, r8 - bl DestroyAnimVisualTask -_0815BAFC: - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815B7D0 - - thumb_func_start sub_815BB18 -sub_815BB18: @ 815BB18 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gBattleAnimArgs - ldr r3, =gSprites - ldr r2, =gBattlerSpriteIds - ldr r1, =gBattleAnimAttacker - ldrb r1, [r1] - adds r1, r2 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - adds r1, 0x3E - ldrb r1, [r1] - lsls r1, 29 - lsrs r1, 31 - strh r1, [r4, 0xE] - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB18 - - thumb_func_start sub_815BB58 -sub_815BB58: @ 815BB58 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - ldr r1, =gBattleAnimTarget - ldrb r1, [r1] - movs r2, 0x1 - bl HandleSpeciesGfxDataChange - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB58 - - thumb_func_start sub_815BB84 -sub_815BB84: @ 815BB84 - push {r4,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0x4 - bls _0815BBA2 - b _0815BDF2 -_0815BBA2: - lsls r0, 2 - ldr r1, =_0815BBB4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815BBB4: - .4byte _0815BBC8 - .4byte _0815BCB8 - .4byte _0815BD08 - .4byte _0815BD72 - .4byte _0815BDA6 -_0815BBC8: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BC02 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815BC02: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815BC34 - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ffc8 - b _0815BC5C - .pool -_0815BC34: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815BC58 - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ff79 - adds r0, r2, 0 - b _0815BC5E - .pool -_0815BC58: - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000fff6 -_0815BC5C: - adds r0, r3, 0 -_0815BC5E: - strh r0, [r1] - ldr r1, =gBattle_BG1_Y - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gBattle_BG1_Y - ldrh r0, [r0] - strh r0, [r1, 0x1E] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - b _0815BD8E - .pool -_0815BCB8: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x10] - adds r1, r0, 0x1 - strh r1, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bgt _0815BCCE - b _0815BDF2 -_0815BCCE: - movs r0, 0 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815BCE4 - movs r0, 0xC - strh r0, [r4, 0xA] -_0815BCE4: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC - bne _0815BDF2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD08: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - cmp r0, 0 - bge _0815BD20 - movs r0, 0 - strh r0, [r4, 0xA] -_0815BD20: - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0815BDF2 - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE460 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x1C] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BD6C - strh r0, [r4, 0x8] - b _0815BDF2 - .pool -_0815BD6C: - movs r0, 0x3 - strh r0, [r4, 0x8] - b _0815BDF2 -_0815BD72: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0xE] - adds r0, 0x1 - strh r0, [r1, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815BDF2 - movs r0, 0 - strh r0, [r1, 0xE] - movs r0, 0x1 -_0815BD8E: - strh r0, [r1, 0x8] - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xE4 - bl PlaySE12WithPanning - b _0815BDF2 -_0815BDA6: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815BDC8 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_0815BDC8: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_BG1_Y - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815BDF2: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BB84 - - thumb_func_start sub_815BE04 -sub_815BE04: @ 815BE04 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl Random2 - lsls r0, 16 - movs r1, 0xFC - lsls r1, 14 - ands r1, r0 - lsrs r5, r1, 16 - adds r1, r5, 0 - cmp r1, 0x1F - ble _0815BE2E - movs r0, 0x20 - subs r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 -_0815BE2E: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, r5 - strh r0, [r7, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r7, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r7, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r7, 0x32] - ldr r4, =gUnknown_085CE48C - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - adds r5, r7, 0 - adds r5, 0x43 - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r9, r0 - mov r1, r9 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0x20 - ldrsh r1, [r7, r0] - movs r0, 0x22 - ldrsh r2, [r7, r0] - ldrb r3, [r5] - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - bl CreateSprite - mov r8, r0 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - mov r0, r9 - lsls r2, r0, 4 - add r2, r9 - lsls r2, 2 - ldr r1, =gSprites - mov r10, r1 - adds r5, r2, r1 - adds r0, r5, 0 - movs r1, 0x1 - str r2, [sp] - bl StartSpriteAnim - mov r0, r8 - lsls r6, r0, 4 - add r6, r8 - lsls r6, 2 - mov r1, r10 - adds r4, r6, r1 - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAnim - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r5, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x32] - ldrh r0, [r1] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x32] - ldr r0, =0x0000ffff - strh r0, [r5, 0x3C] - movs r0, 0x1 - negs r0, r0 - strh r0, [r4, 0x3C] - adds r5, 0x3E - ldrb r0, [r5] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r5] - adds r4, 0x3E - ldrb r0, [r4] - orrs r0, r1 - strb r0, [r4] - movs r0, 0x1C - add r10, r0 - ldr r2, [sp] - add r2, r10 - ldr r0, =sub_815C050 - str r0, [r2] - add r6, r10 - str r0, [r6] - mov r1, r9 - strh r1, [r7, 0x3A] - mov r0, r8 - strh r0, [r7, 0x3C] - ldr r0, =sub_815BF44 - str r0, [r7, 0x1C] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BE04 - - thumb_func_start sub_815BF44 -sub_815BF44: @ 815BF44 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x32] - ldrh r0, [r3, 0x34] - adds r2, r0 - lsls r0, r2, 16 - asrs r0, 24 - ldrh r1, [r3, 0x26] - subs r1, r0 - strh r1, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - movs r2, 0x36 - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815BF92 - lsls r0, r1, 16 - asrs r0, 16 - movs r1, 0x8 - negs r1, r1 - cmp r0, r1 - bge _0815BF92 - ldr r2, =gSprites - movs r0, 0x3A - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BF92: - movs r1, 0x36 - ldrsh r0, [r3, r1] - cmp r0, 0x1 - bne _0815BFC6 - movs r2, 0x26 - ldrsh r1, [r3, r2] - movs r0, 0x10 - negs r0, r0 - cmp r1, r0 - bge _0815BFC6 - ldr r2, =gSprites - movs r0, 0x3C - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r3, 0x36] - adds r0, 0x1 - strh r0, [r3, 0x36] -_0815BFC6: - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815BFE8 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815BFF4 - str r0, [r3, 0x1C] -_0815BFE8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BF44 - - thumb_func_start sub_815BFF4 -sub_815BFF4: @ 815BFF4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gSprites - movs r0, 0x3A - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r3, r0, 2 - adds r6, r5, 0 - adds r6, 0x1C - adds r0, r3, r6 - ldr r2, [r0] - ldr r0, =SpriteCallbackDummy - cmp r2, r0 - bne _0815C040 - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldr r0, [r1] - cmp r0, r2 - bne _0815C040 - adds r0, r3, r5 - bl DestroySprite - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C040: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815BFF4 - - thumb_func_start sub_815C050 -sub_815C050: @ 815C050 - push {lr} - adds r3, r0, 0 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0815C09C - ldrh r2, [r3, 0x32] - ldrh r1, [r3, 0x34] - adds r2, r1 - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - movs r0, 0xFF - ands r2, r0 - strh r2, [r3, 0x34] - ldrh r0, [r3, 0x30] - subs r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815C09C - mov r1, r12 - ldrb r0, [r1] - movs r1, 0x4 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldr r0, =SpriteCallbackDummy - str r0, [r3, 0x1C] -_0815C09C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C050 - - thumb_func_start sub_815C0A4 -sub_815C0A4: @ 815C0A4 - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r4, r1, 0 - cmp r0, 0x5 - bls _0815C0C2 - b _0815C396 -_0815C0C2: - lsls r0, 2 - ldr r1, =_0815C0D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815C0D4: - .4byte _0815C0EC - .4byte _0815C224 - .4byte _0815C2AC - .4byte _0815C2E2 - .4byte _0815C310 - .4byte _0815C34A -_0815C0EC: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x00000d03 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815C124 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_0815C124: - mov r0, sp - bl sub_80A6B30 - ldr r1, =gUnknown_08C2A6EC - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815C15C - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ffc8 - adds r0, r3, 0 - b _0815C1CA - .pool -_0815C15C: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerPosition - lsls r0, 24 - lsrs r4, r0, 24 - bl IsDoubleBattle - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C1B4 - cmp r4, 0x1 - bne _0815C180 - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ff65 - adds r0, r2, 0 - strh r0, [r1] -_0815C180: - cmp r4, 0x3 - bne _0815C18C - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ff8d - adds r0, r3, 0 - strh r0, [r1] -_0815C18C: - cmp r4, 0 - bne _0815C196 - ldr r1, =gBattle_BG1_X - movs r0, 0xE - strh r0, [r1] -_0815C196: - cmp r4, 0x2 - bne _0815C1CC - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000ffec - b _0815C1C8 - .pool -_0815C1B4: - cmp r4, 0x1 - bne _0815C1C0 - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000ff79 - adds r0, r3, 0 - strh r0, [r1] -_0815C1C0: - cmp r4, 0 - bne _0815C1CC - ldr r1, =gBattle_BG1_X - ldr r2, =0x0000fff6 -_0815C1C8: - adds r0, r2, 0 -_0815C1CA: - strh r0, [r1] -_0815C1CC: - ldr r1, =gBattle_BG1_Y - movs r0, 0 - strh r0, [r1] - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08C2A634 - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r0, =gUnknown_08C2A6D4 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - strh r0, [r1, 0x1C] - ldr r0, =gBattle_BG1_Y - ldrh r0, [r0] - strh r0, [r1, 0x1E] - b _0815C2A4 - .pool -_0815C224: - ldr r1, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r0, 0 - strh r0, [r5, 0xE] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C268 - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - ldrh r5, [r5, 0x1C] - adds r0, r5 - b _0815C27A - .pool -_0815C268: - ldr r2, =gBattle_BG1_X - ldr r1, =gUnknown_085CE4A4 - movs r3, 0xC - ldrsh r0, [r5, r3] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r5, 0x1C] - subs r0, r1 -_0815C27A: - strh r0, [r2] - ldr r0, =gTasks - adds r1, r4, r6 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815C2A4 - strh r0, [r1, 0x8] - b _0815C396 - .pool -_0815C2A4: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815C396 -_0815C2AC: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bgt _0815C2C6 - movs r0, 0x5 - strh r0, [r4, 0xA] -_0815C2C6: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bne _0815C396 - b _0815C302 -_0815C2E2: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r1, [r4, 0xE] - adds r1, 0x1 - strh r1, [r4, 0xE] - lsls r1, 16 - asrs r1, 16 - ldr r2, =gUnknown_085CE4A8 - movs r3, 0xC - ldrsh r0, [r4, r3] - adds r0, r2 - ldrb r0, [r0] - cmp r1, r0 - ble _0815C396 -_0815C302: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 - .pool -_0815C310: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r4 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - ble _0815C32A - movs r0, 0xD - strh r0, [r4, 0xA] -_0815C32A: - ldrh r1, [r4, 0xA] - lsls r1, 8 - movs r0, 0x3 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xD - bne _0815C396 - movs r0, 0x1 - strh r0, [r4, 0x8] - b _0815C396 -_0815C34A: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815C36C - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_0815C36C: - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_BG1_Y - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815C396: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C0A4 - - thumb_func_start sub_815C3A8 -sub_815C3A8: @ 815C3A8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815C3E8 - movs r0, 0 - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE4B0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C3FA - .pool -_0815C3E8: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815C3FA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815C3FA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815C3A8 - - thumb_func_start sub_815C400 -sub_815C400: @ 815C400 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _0815C41E - adds r0, r4, 0 - movs r1, 0 - bl InitAnimSpritePos - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815C472 -_0815C41E: - adds r0, 0x1 - strh r0, [r4, 0x2E] - cmp r1, 0x14 - ble _0815C472 - ldrh r0, [r4, 0x30] - adds r0, 0xA0 - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x32] - adds r0, 0x80 - strh r0, [r4, 0x32] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815C450 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - b _0815C456 - .pool -_0815C450: - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 -_0815C456: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x40 - ble _0815C472 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C472: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C400 - - thumb_func_start sub_815C478 -sub_815C478: @ 815C478 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldr r5, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C4A4 - adds r0, r2, 0 - bl DestroyAnimVisualTask - b _0815C538 - .pool -_0815C4A4: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0 - bge _0815C4B0 - movs r0, 0 - strh r0, [r5, 0x4] -_0815C4B0: - movs r1, 0x4 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - ble _0815C4BC - movs r0, 0x2 - strh r0, [r5, 0x4] -_0815C4BC: - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - movs r0, 0x4 - ldrsh r1, [r5, r0] - lsls r1, 1 - movs r0, 0x8 - subs r0, r1 - strh r0, [r4, 0xE] - movs r1, 0x4 - ldrsh r0, [r5, r1] - lsls r0, 7 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4, 0x10] - ldrh r0, [r5, 0x4] - adds r0, 0x2 - strh r0, [r4, 0x12] - ldrh r0, [r5, 0x2] - subs r0, 0x1 - strh r0, [r4, 0x14] - ldrb r0, [r5] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C508 - ldr r0, =gBattleAnimAttacker - b _0815C50A - .pool -_0815C508: - ldr r0, =gBattleAnimTarget -_0815C50A: - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815C528 - movs r1, 0x10 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x10] - movs r1, 0x12 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x12] -_0815C528: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - ldr r0, =sub_815C548 - str r0, [r4] -_0815C538: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C478 - - thumb_func_start sub_815C548 -sub_815C548: @ 815C548 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r6, [r4, r0] - cmp r6, 0x1 - beq _0815C5D0 - cmp r6, 0x1 - bgt _0815C570 - cmp r6, 0 - beq _0815C57C - b _0815C6A8 - .pool -_0815C570: - cmp r6, 0x2 - beq _0815C628 - cmp r6, 0x3 - bne _0815C57A - b _0815C698 -_0815C57A: - b _0815C6A8 -_0815C57C: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - strh r6, [r4, 0xA] - b _0815C690 - .pool -_0815C5D0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r0, 0x24] - ldrh r2, [r4, 0x12] - subs r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0x10] - ldrh r1, [r4, 0xC] - adds r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - lsls r1, 16 - asrs r1, 16 - movs r2, 0xE - ldrsh r0, [r4, r2] - lsls r0, 1 - cmp r1, r0 - blt _0815C6A8 - movs r0, 0 - strh r0, [r4, 0xA] - b _0815C690 - .pool -_0815C628: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r4, 0x12] - ldrh r2, [r0, 0x24] - adds r1, r2 - movs r5, 0 - strh r1, [r0, 0x24] - ldrh r0, [r4, 0xC] - ldrh r1, [r4, 0x10] - subs r0, r1 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r2, 0xE - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _0815C6A8 - ldrh r1, [r4, 0x14] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0815C690 - subs r0, r1, 0x1 - strh r0, [r4, 0x14] - strh r5, [r4, 0xA] - strh r5, [r4, 0x8] - b _0815C6A8 - .pool -_0815C690: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815C6A8 -_0815C698: - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl ResetSpriteRotScale - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815C6A8: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C548 - - thumb_func_start sub_815C6B0 -sub_815C6B0: @ 815C6B0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _0815C6D4 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - b _0815C6DE - .pool -_0815C6D4: - movs r0, 0xF0 - strh r0, [r4, 0x20] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - subs r0, 0x1E -_0815C6DE: - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrb r1, [r1, 0x2] - adds r0, r4, 0 - bl StartSpriteAnim - ldr r0, =sub_815C700 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C6B0 - - thumb_func_start sub_815C700 -sub_815C700: @ 815C700 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x3 - strh r0, [r4, 0x2E] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815C744 - ldrh r1, [r4, 0x20] - adds r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - subs r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0xF0 - ble _0815C732 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C732: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Sin - b _0815C768 - .pool -_0815C744: - ldrh r1, [r4, 0x20] - subs r1, 0x5 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x22] - adds r0, 0x1 - strh r0, [r4, 0x22] - lsls r1, 16 - cmp r1, 0 - bge _0815C75C - adds r0, r4, 0 - bl DestroyAnimSprite -_0815C75C: - ldrh r1, [r4, 0x2E] - movs r0, 0xFF - ands r0, r1 - movs r1, 0x10 - bl Cos -_0815C768: - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815C700 - - thumb_func_start sub_815C770 -sub_815C770: @ 815C770 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - strh r0, [r4, 0xE] - movs r0, 0x20 - strh r0, [r4, 0x20] - movs r0, 0x40 - strh r0, [r4, 0x22] - movs r0, 0x80 - lsls r0, 4 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - ldr r0, =sub_815C7C4 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815C770 - - thumb_func_start sub_815C7C4 -sub_815C7C4: @ 815C7C4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - movs r1, 0x8 - ldrsh r0, [r7, r1] - mov r8, r0 - cmp r0, 0x1 - beq _0815C860 - cmp r0, 0x1 - bgt _0815C7F4 - cmp r0, 0 - beq _0815C7FC - b _0815C8DA - .pool -_0815C7F4: - mov r2, r8 - cmp r2, 0x2 - beq _0815C8C8 - b _0815C8DA -_0815C7FC: - movs r3, 0x80 - lsls r3, 2 - adds r0, r3, 0 - ldrh r1, [r7, 0xC] - adds r2, r0, r1 - strh r2, [r7, 0xC] - lsls r0, r2, 16 - asrs r0, 16 - ldrh r3, [r7, 0x24] - mov r8, r3 - movs r3, 0x24 - ldrsh r1, [r7, r3] - cmp r0, r1 - blt _0815C8DA - mov r0, r8 - subs r5, r0, r2 - lsls r5, 16 - asrs r5, 16 - adds r6, r1, 0 - lsls r6, 1 - adds r0, r5, 0 - adds r1, r6, 0 - bl __divsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r4, 16 - asrs r4, 16 - movs r1, 0x1 - ands r4, r1 - cmp r4, 0 - bne _0815C854 - lsls r0, 16 - asrs r0, 16 - mov r2, r8 - subs r0, r2, r0 - b _0815C8B2 -_0815C854: - lsls r0, 16 - asrs r0, 16 - mov r3, r8 - subs r0, r3 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C860: - ldr r1, =0xfffffe00 - adds r0, r1, 0 - ldrh r2, [r7, 0xC] - adds r1, r0, r2 - strh r1, [r7, 0xC] - movs r3, 0xC - ldrsh r0, [r7, r3] - movs r2, 0x24 - ldrsh r6, [r7, r2] - cmn r0, r6 - bgt _0815C8DA - ldrh r3, [r7, 0x24] - mov r9, r3 - mov r0, r9 - subs r4, r0, r1 - lsls r4, 16 - asrs r4, 16 - lsls r6, 1 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - adds r1, r6, 0 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - mov r1, r8 - ands r1, r5 - lsls r0, r1, 16 - asrs r1, r0, 16 - cmp r1, 0 - bne _0815C8BC - lsls r0, r2, 16 - asrs r0, 16 - mov r2, r9 - subs r0, r2 -_0815C8B2: - strh r0, [r7, 0xC] - strh r1, [r7, 0x8] - b _0815C8DA - .pool -_0815C8BC: - lsls r0, r2, 16 - asrs r0, 16 - mov r3, r9 - subs r0, r3, r0 - strh r0, [r7, 0xC] - b _0815C8DA -_0815C8C8: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl ResetSpriteRotScale - adds r0, r4, 0 - bl DestroyAnimVisualTask - b _0815C950 -_0815C8DA: - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r7, 0xC] - adds r1, r2, 0 - bl SetSpriteRotScale - ldrh r0, [r7, 0x26] - lsls r0, 24 - lsrs r0, 24 - bl SetBattlerSpriteYOffsetFromRotation - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - movs r2, 0xC - ldrsh r0, [r7, r2] - cmp r0, 0 - bge _0815C90E - adds r0, 0x3F -_0815C90E: - asrs r0, 6 - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r7, 0xA] - adds r0, 0x1 - strh r0, [r7, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815C950 - ldrh r1, [r7, 0x20] - movs r3, 0x20 - ldrsh r0, [r7, r3] - cmp r0, 0 - beq _0815C94C - subs r0, r1, 0x1 - strh r0, [r7, 0x20] - ldrh r0, [r7, 0x24] - ldrh r1, [r7, 0x22] - subs r0, r1 - strh r0, [r7, 0x24] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _0815C950 - movs r0, 0x10 - strh r0, [r7, 0x24] - b _0815C950 - .pool -_0815C94C: - movs r0, 0x2 - strh r0, [r7, 0x8] -_0815C950: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815C7C4 - - thumb_func_start sub_815C95C -sub_815C95C: @ 815C95C - push {r4-r6,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815C9BC - ldr r6, =gBattleAnimArgs - movs r2, 0x4 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815C990 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] -_0815C990: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - strh r0, [r5, 0x20] - ldrh r1, [r6, 0x2] - ldrh r2, [r5, 0x22] - adds r0, r1, r2 - strh r0, [r5, 0x22] - movs r0, 0x80 - strh r0, [r5, 0x30] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r5, 0x32] - strh r1, [r5, 0x34] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0815CA1A - .pool -_0815C9BC: - ldrh r1, [r5, 0x30] - lsls r0, r1, 16 - asrs r0, 24 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r5, 0x26] - adds r0, r2 - strh r0, [r5, 0x26] - movs r2, 0x36 - ldrsh r0, [r5, r2] - adds r4, r1, 0 - cmp r0, 0 - bne _0815C9FA - movs r0, 0x26 - ldrsh r1, [r5, r0] - movs r2, 0x34 - ldrsh r0, [r5, r2] - cmn r1, r0 - ble _0815C9FA - movs r0, 0x1 - strh r0, [r5, 0x36] - movs r1, 0x32 - ldrsh r0, [r5, r1] - negs r0, r0 - movs r1, 0x3 - bl __divsi3 - lsls r0, 1 - strh r0, [r5, 0x32] -_0815C9FA: - adds r0, r4, 0 - adds r0, 0xC0 - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x80 - strh r0, [r5, 0x32] - adds r0, r5, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0815CA1A - adds r0, r5, 0 - bl DestroyAnimSprite -_0815CA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815C95C - - thumb_func_start sub_815CA20 -sub_815CA20: @ 815CA20 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0815CB2C - ldr r0, =gBattleAnimArgs - movs r3, 0 - ldrsh r1, [r0, r3] - mov r8, r0 - cmp r1, 0 - bne _0815CA5C - ldr r0, =gBattleAnimAttacker - b _0815CA5E - .pool -_0815CA5C: - ldr r0, =gBattleAnimTarget -_0815CA5E: - ldrb r0, [r0] - strh r0, [r2, 0x1E] - mov r1, r8 - ldrb r0, [r1] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r4, r7, 2 - adds r0, r4, r7 - lsls r0, 3 - adds r6, r0, r1 - strh r5, [r6, 0x1C] - adds r0, r5, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - mov r2, r8 - movs r3, 0x2 - ldrsh r0, [r2, r3] - cmp r0, 0x1 - beq _0815CAC0 - cmp r0, 0x1 - bgt _0815CAA0 - cmp r0, 0 - beq _0815CAA8 - lsls r2, r5, 4 - b _0815CB08 - .pool -_0815CAA0: - cmp r0, 0x2 - beq _0815CACA - lsls r2, r5, 4 - b _0815CB08 -_0815CAA8: - movs r2, 0xA0 - lsls r2, 1 - adds r0, r5, 0 - movs r1, 0xE0 - movs r3, 0 - bl SetSpriteRotScale - adds r0, r5, 0 - bl SetBattlerSpriteYOffsetFromYScale - lsls r2, r5, 4 - b _0815CB08 -_0815CAC0: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF0 - lsls r3, 4 - b _0815CAD2 -_0815CACA: - movs r2, 0x98 - lsls r2, 1 - movs r3, 0xF1 - lsls r3, 8 -_0815CAD2: - adds r0, r5, 0 - movs r1, 0xD0 - bl SetSpriteRotScale - adds r0, r5, 0 - bl SetBattlerSpriteYOffsetFromYScale - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815CAF8 - ldrb r0, [r6, 0x1E] - bl GetBattlerSide - lsls r0, 24 - lsls r2, r5, 4 - cmp r0, 0 - bne _0815CB08 -_0815CAF8: - ldr r0, =gSprites - lsls r2, r5, 4 - adds r1, r2, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x26] - adds r0, 0x10 - strh r0, [r1, 0x26] -_0815CB08: - ldr r1, =gSprites - adds r0, r2, r5 - lsls r0, 2 - adds r0, r1 - movs r1, 0x2 - strh r1, [r0, 0x24] - ldr r0, =gTasks - adds r1, r4, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815CB78 - .pool -_0815CB2C: - ldrb r5, [r2, 0x1C] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - movs r4, 0 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815CB50 - strh r4, [r2, 0xC] - ldr r0, =gSprites - lsls r1, r5, 4 - adds r1, r5 - lsls r1, 2 - adds r1, r0 - ldrh r0, [r1, 0x24] - negs r0, r0 - strh r0, [r1, 0x24] -_0815CB50: - ldrh r0, [r2, 0xA] - adds r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - bne _0815CB78 - adds r0, r5, 0 - bl ResetSpriteRotScale - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - strh r4, [r0, 0x24] - strh r4, [r0, 0x26] - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815CB78: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CA20 - - thumb_func_start sub_815CB88 -sub_815CB88: @ 815CB88 - push {r4,r5,lr} - adds r4, r0, 0 - bl Random2 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xC - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, r0 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - bl Random2 - ldr r5, =0x000001ff - ands r5, r0 - bl Random2 - movs r1, 0xFF - ands r1, r0 - movs r0, 0x1 - ands r0, r5 - cmp r0, 0 - beq _0815CBE0 - movs r2, 0xBC - lsls r2, 3 - adds r0, r5, r2 - b _0815CBE8 - .pool -_0815CBE0: - movs r3, 0xBC - lsls r3, 3 - adds r0, r3, 0 - subs r0, r5 -_0815CBE8: - strh r0, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815CBFA - movs r2, 0x90 - lsls r2, 3 - adds r0, r1, r2 - b _0815CC02 -_0815CBFA: - movs r3, 0x90 - lsls r3, 3 - adds r0, r3, 0 - subs r0, r1 -_0815CC02: - strh r0, [r4, 0x30] - ldr r0, =gBattleAnimArgs - ldrh r0, [r0] - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - bne _0815CC1C - ldr r0, =0x0000fff8 - b _0815CC1E - .pool -_0815CC1C: - movs r0, 0xF8 -_0815CC1E: - strh r0, [r4, 0x20] - movs r0, 0x68 - strh r0, [r4, 0x22] - ldr r0, =sub_815CC34 - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CB88 - - thumb_func_start sub_815CC34 -sub_815CC34: @ 815CC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815CC4C - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0815CC56 -_0815CC4C: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0815CC56: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - adds r0, r3, 0 - subs r0, 0x16 - strh r0, [r4, 0x2E] - adds r1, r2, 0 - subs r1, 0x30 - strh r1, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0815CC7A - movs r0, 0 - strh r0, [r4, 0x2E] -_0815CC7A: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0815CC8E - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CC8E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815CC34 - - thumb_func_start sub_815CC94 -sub_815CC94: @ 815CC94 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x00001f3f - movs r0, 0x4A - bl SetGpuReg - movs r1, 0x80 - lsls r1, 8 - movs r0, 0 - bl SetGpuRegBits - ldr r0, =gBattle_WIN0H - movs r1, 0 - strh r1, [r0] - ldr r4, =gBattle_WIN0V - strh r1, [r4] - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x44 - bl SetGpuReg - ldr r0, =gBattleAnimArgs - ldrh r0, [r0, 0x4] - strh r0, [r5, 0x2E] - adds r0, r5, 0 - movs r1, 0 - bl sub_80A6980 - ldrb r1, [r5, 0x1] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r5, 0x1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldr r0, =sub_815CD0C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CC94 - - thumb_func_start sub_815CD0C -sub_815CD0C: @ 815CD0C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0815CD4A - cmp r0, 0x1 - bgt _0815CD22 - cmp r0, 0 - beq _0815CD2C - b _0815CDAA -_0815CD22: - cmp r0, 0x2 - beq _0815CD60 - cmp r0, 0x3 - beq _0815CD82 - b _0815CDAA -_0815CD2C: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - b _0815CD7A -_0815CD4A: - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - cmp r0, 0 - bne _0815CDAA - adds r0, r4, 0 - movs r1, 0x1 - bl ChangeSpriteAffineAnim - b _0815CD7A -_0815CD60: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0815CDAA - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815CD7A: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - b _0815CDAA -_0815CD82: - ldr r1, =0x00003f3f - movs r0, 0x4A - bl SetGpuReg - movs r0, 0 - bl GetGpuReg - adds r1, r0, 0 - movs r2, 0x80 - lsls r2, 8 - adds r0, r2, 0 - eors r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CDAA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CD0C - - thumb_func_start sub_815CDB4 -sub_815CDB4: @ 815CDB4 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x30] - ldr r1, =sub_815CDFC - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDB4 - - thumb_func_start sub_815CDFC -sub_815CDFC: @ 815CDFC - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x30 - ldrsh r0, [r4, r1] - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - bl Sin - strh r0, [r4, 0x24] - movs r2, 0x30 - ldrsh r0, [r4, r2] - ldrh r1, [r4, 0x34] - lsls r1, 16 - asrs r1, 24 - bl Cos - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x30] - adds r0, 0x9 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - lsls r1, r0, 16 - cmp r0, 0x3F - bls _0815CE36 - asrs r0, r1, 16 - cmp r0, 0xC3 - ble _0815CE48 -_0815CE36: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - subs r0, 0x1 - b _0815CE52 - .pool -_0815CE48: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - adds r0, 0x1 -_0815CE52: - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - movs r3, 0x38 - ldrsh r2, [r4, r3] - cmp r2, 0 - bne _0815CE98 - movs r1, 0x80 - lsls r1, 3 - adds r0, r1, 0 - ldrh r3, [r4, 0x32] - adds r0, r3 - strh r0, [r4, 0x32] - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - ldrh r3, [r4, 0x34] - adds r0, r3 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x2E - ldrsh r1, [r4, r3] - cmp r0, r1 - bne _0815CEC8 - strh r2, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x38] - b _0815CEC8 - .pool -_0815CE98: - cmp r2, 0x1 - bne _0815CEC8 - ldr r1, =0xfffffc00 - adds r0, r1, 0 - ldrh r2, [r4, 0x32] - adds r0, r2 - strh r0, [r4, 0x32] - ldr r3, =0xffffff00 - adds r0, r3, 0 - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x2E - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _0815CEC8 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815CEC8: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CDFC - - thumb_func_start sub_815CED8 -sub_815CED8: @ 815CED8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - movs r0, 0 - bl GetAnimBattlerSpriteId - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815CF18 - movs r0, 0x1 - str r0, [sp, 0x1C] - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r1, [r0, 0x10] - mov r9, r1 - ldr r2, [r0, 0xC] - mov r8, r2 - ldrh r6, [r0, 0x2] - movs r3, 0x14 - b _0815D058 - .pool -_0815CF18: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815CFC4 - movs r0, 0 - str r0, [sp, 0x1C] - ldr r6, =gBattlerPartyIndexes - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gPlayerParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815CFBC - adds r0, r2, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815CF9C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - b _0815CFAA - .pool -_0815CF9C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gEnemyParty - adds r0, r1 -_0815CFAA: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815CFBE - .pool -_0815CFBC: - ldrh r6, [r1, 0x2] -_0815CFBE: - movs r1, 0x14 - mov r10, r1 - b _0815D05A -_0815CFC4: - movs r2, 0x1 - str r2, [sp, 0x1C] - ldr r6, =gBattlerPartyIndexes - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - movs r5, 0x64 - muls r0, r5 - ldr r7, =gEnemyParty - adds r0, r7 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 - movs r1, 0x1 - bl GetMonData - mov r8, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815D054 - adds r0, r2, 0 - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815D03C - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - ldr r1, =gPlayerParty - adds r0, r1 - b _0815D048 - .pool -_0815D03C: - ldrb r0, [r4] - lsls r0, 1 - adds r0, r6 - ldrh r0, [r0] - muls r0, r5 - adds r0, r7 -_0815D048: - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815D056 -_0815D054: - ldrh r6, [r1, 0x2] -_0815D056: - ldr r3, =0x0000ffec -_0815D058: - mov r10, r3 -_0815D05A: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl sub_80A8328 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - mov r2, r10 - lsls r1, r2, 16 - asrs r1, 16 - adds r4, r1 - lsls r4, 16 - asrs r4, 16 - lsrs r0, 24 - str r0, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - mov r3, r9 - str r3, [sp, 0x8] - mov r0, r8 - str r0, [sp, 0xC] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - str r0, [sp, 0x10] - movs r0, 0x1 - str r0, [sp, 0x14] - adds r0, r6, 0 - ldr r1, [sp, 0x1C] - movs r2, 0 - adds r3, r4, 0 - bl sub_80A8394 - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - ldr r0, =gSprites - lsls r5, r6, 4 - adds r5, r6 - lsls r5, 2 - adds r5, r0 - movs r0, 0x3 - ands r7, r0 - lsls r7, 2 - mov r8, r7 - ldrb r0, [r5, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r0 - mov r2, r8 - orrs r1, r2 - strb r1, [r5, 0x5] - ldrb r2, [r5, 0x1] - adds r0, r4, 0 - ands r0, r2 - movs r2, 0x4 - orrs r0, r2 - strb r0, [r5, 0x1] - ldr r0, =0x00007fff - lsrs r1, 4 - lsls r1, 4 - movs r3, 0x80 - lsls r3, 1 - adds r2, r3, 0 - orrs r1, r2 - movs r2, 0x20 - bl FillPalette - ldrb r0, [r5, 0x5] - ands r4, r0 - mov r0, r8 - orrs r4, r0 - strb r4, [r5, 0x5] - movs r1, 0xFD - lsls r1, 6 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gTasks - ldr r1, [sp, 0x18] - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r4, 0xA] - movs r1, 0x10 - subs r1, r0 - lsls r1, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - strh r6, [r4, 0x8] - ldr r0, =sub_815D160 - str r0, [r4] - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815CED8 - - thumb_func_start sub_815D160 -sub_815D160: @ 815D160 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0x1C] - adds r1, r0, 0x1 - strh r1, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D1AE - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0xA] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xA - bne _0815D1AE - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0x1C] - strh r0, [r4, 0x1E] - ldr r0, =sub_815D1BC - str r0, [r4] -_0815D1AE: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D160 - - thumb_func_start sub_815D1BC -sub_815D1BC: @ 815D1BC - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r5, r1, r2 - ldrb r2, [r5, 0x8] - ldrh r0, [r5, 0x1C] - subs r0, 0x10 - movs r4, 0 - strh r0, [r5, 0x1C] - ldrh r0, [r5, 0x1E] - adds r0, 0x80 - strh r0, [r5, 0x1E] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r6, r0, r1 - ldrb r2, [r6, 0x1] - lsls r1, r2, 30 - lsrs r1, 30 - movs r0, 0x2 - orrs r1, r0 - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x1] - movs r0, 0x1C - ldrsh r2, [r5, r0] - movs r0, 0x1E - ldrsh r3, [r5, r0] - str r4, [sp] - adds r0, r6, 0 - movs r1, 0x1 - bl TrySetSpriteRotScale - ldrh r0, [r5, 0x20] - adds r0, 0x1 - strh r0, [r5, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815D22A - adds r0, r6, 0 - bl sub_80A749C - adds r0, r6, 0 - bl sub_80A8610 - ldr r0, =sub_80A6814 - str r0, [r5] -_0815D22A: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D1BC - - thumb_func_start sub_815D240 -sub_815D240: @ 815D240 - push {r4-r7,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815D26C - ldr r0, =gBattleAnimAttacker - b _0815D26E - .pool -_0815D26C: - ldr r0, =gBattleAnimTarget -_0815D26E: - ldrb r5, [r0] - movs r6, 0 - strh r6, [r4, 0x8] - strh r6, [r4, 0xA] - strh r6, [r4, 0xC] - movs r0, 0x10 - strh r0, [r4, 0xE] - strh r6, [r4, 0x10] - strh r5, [r4, 0x12] - movs r0, 0x20 - strh r0, [r4, 0x14] - strh r6, [r4, 0x16] - movs r0, 0x18 - strh r0, [r4, 0x18] - adds r0, r5, 0 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D2A0 - movs r1, 0x18 - ldrsh r0, [r4, r1] - negs r0, r0 - strh r0, [r4, 0x18] -_0815D2A0: - adds r0, r5, 0 - bl GetBattlerYCoordWithElevation - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x22 - strh r0, [r4, 0x22] - cmp r0, 0 - bge _0815D2B4 - strh r6, [r4, 0x22] -_0815D2B4: - ldrh r0, [r4, 0x22] - adds r0, 0x42 - strh r0, [r4, 0x24] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x26] - adds r0, r5, 0 - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D304 - ldr r0, =0x04000014 - str r0, [sp] - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gBattle_BG1_X - ldrh r5, [r0] - ldr r0, =gBattle_BG1_Y - b _0815D316 - .pool -_0815D304: - ldr r0, =0x04000018 - str r0, [sp] - ldr r1, =0x00003f44 - movs r0, 0x50 - bl SetGpuReg - ldr r0, =gBattle_BG2_X - ldrh r5, [r0] - ldr r0, =gBattle_BG2_Y -_0815D316: - ldrh r3, [r0] - movs r7, 0 - movs r2, 0 - ldr r6, =gScanlineEffectRegBuffers - movs r0, 0xF0 - lsls r0, 3 - adds r0, r6 - mov r12, r0 -_0815D326: - lsls r2, 16 - asrs r2, 16 - lsls r1, r2, 1 - adds r0, r1, r6 - strh r5, [r0] - add r1, r12 - strh r5, [r1] - adds r0, r2, 0x1 - lsls r0, 1 - adds r1, r0, r6 - strh r3, [r1] - add r0, r12 - strh r3, [r0] - lsls r0, r7, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r2, 0x2 - lsls r2, 16 - lsrs r2, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x9F - ble _0815D326 - ldr r0, =0xa6600001 - str r0, [sp, 0x4] - mov r1, sp - movs r2, 0 - movs r0, 0x1 - strb r0, [r1, 0x8] - mov r0, sp - strb r2, [r0, 0x9] - ldr r0, [sp] - ldr r1, [sp, 0x4] - ldr r2, [sp, 0x8] - bl ScanlineEffect_SetParams - ldr r0, =sub_815D398 - str r0, [r4] - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D240 - - thumb_func_start sub_815D398 -sub_815D398: @ 815D398 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r6, r0, r1 - ldrb r0, [r6, 0x12] - bl sub_80A8364 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815D3D8 - ldr r0, =gBattle_BG1_X - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gBattle_BG1_Y - b _0815D3E0 - .pool -_0815D3D8: - ldr r0, =gBattle_BG2_X - ldrh r0, [r0] - str r0, [sp, 0x4] - ldr r0, =gBattle_BG2_Y -_0815D3E0: - ldrh r0, [r0] - str r0, [sp, 0x8] - movs r1, 0x8 - ldrsh r0, [r6, r1] - cmp r0, 0x1 - bne _0815D3EE - b _0815D5CC -_0815D3EE: - cmp r0, 0x1 - bgt _0815D400 - cmp r0, 0 - beq _0815D40E - b _0815D63C - .pool -_0815D400: - cmp r0, 0x2 - bne _0815D406 - b _0815D5EC -_0815D406: - cmp r0, 0x3 - bne _0815D40C - b _0815D636 -_0815D40C: - b _0815D63C -_0815D40E: - movs r2, 0x24 - ldrsh r0, [r6, r2] - lsls r0, 17 - lsrs r5, r0, 16 - movs r3, 0 - str r3, [sp] - mov r9, r3 - movs r4, 0 - ldrh r0, [r6, 0xA] - adds r0, 0x2 - movs r1, 0xFF - ands r0, r1 - strh r0, [r6, 0xA] - ldrh r7, [r6, 0xA] - mov r8, r7 - movs r0, 0x14 - ldrsh r1, [r6, r0] - movs r0, 0xFC - lsls r0, 3 - bl __divsi3 - strh r0, [r6, 0x1A] - movs r1, 0x16 - ldrsh r0, [r6, r1] - lsls r0, 1 - movs r2, 0x1A - ldrsh r1, [r6, r2] - bl __divsi3 - negs r0, r0 - strh r0, [r6, 0x1C] - ldrh r0, [r6, 0x16] - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - ldrh r2, [r6, 0x24] - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - ble _0815D52E - ldr r0, =gScanlineEffect - mov r10, r0 - ldr r1, [sp, 0x4] - lsls r0, r1, 16 - asrs r0, 16 - str r0, [sp, 0x10] - ldr r2, [sp, 0x8] - lsls r0, r2, 16 - asrs r0, 16 - str r0, [sp, 0xC] -_0815D47E: - lsls r5, 16 - asrs r5, 16 - adds r2, r5, 0x1 - lsls r2, 1 - mov r3, r10 - ldrb r1, [r3, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r2, r0 - ldr r0, =gScanlineEffectRegBuffers - adds r2, r0 - lsls r4, 16 - asrs r4, 16 - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - subs r0, r4, r0 - ldr r3, [sp, 0xC] - adds r0, r3, r0 - strh r0, [r2] - lsls r3, r5, 1 - mov r0, r10 - ldrb r1, [r0, 0x14] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 7 - adds r3, r0 - ldr r1, =gScanlineEffectRegBuffers - adds r3, r1 - lsls r1, r7, 16 - asrs r1, 16 - ldr r2, [sp, 0x10] - adds r1, r2, r1 - mov r7, r8 - lsls r2, r7, 16 - asrs r2, 16 - lsls r0, r2, 1 - ldr r7, =gSineTable - adds r0, r7 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - adds r1, r0 - strh r1, [r3] - adds r2, 0xA - mov r8, r2 - movs r0, 0xFF - mov r1, r8 - ands r1, r0 - mov r8, r1 - ldrh r0, [r6, 0x1C] - ldrh r2, [r6, 0x1E] - adds r0, r2 - strh r0, [r6, 0x1E] - lsls r0, 16 - asrs r0, 21 - lsls r0, 16 - lsrs r7, r0, 16 - strh r7, [r6, 0x20] - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - subs r5, 0x2 - lsls r5, 16 - lsrs r5, 16 - ldr r3, [sp] - lsls r0, r3, 16 - asrs r0, 16 - ldrh r1, [r6, 0x14] - adds r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - str r2, [sp] - asrs r0, 21 - lsls r0, 16 - lsrs r0, 16 - mov r9, r0 - ldr r0, =0xffff0000 - add r0, r12 - lsrs r2, r0, 16 - lsls r3, r2, 16 - mov r12, r3 - asrs r1, r3, 16 - movs r3, 0x22 - ldrsh r0, [r6, r3] - cmp r1, r0 - bgt _0815D47E -_0815D52E: - lsls r1, r2, 17 - cmp r1, 0 - blt _0815D55A - ldr r4, =gScanlineEffectRegBuffers - ldr r7, [sp, 0x4] - lsls r0, r7, 16 - asrs r0, 16 - adds r3, r0, 0 - adds r3, 0xF0 - movs r0, 0xF0 - lsls r0, 3 - adds r5, r4, r0 -_0815D546: - asrs r2, r1, 16 - lsls r1, r2, 1 - adds r0, r1, r4 - strh r3, [r0] - adds r1, r5 - strh r3, [r1] - subs r2, 0x2 - lsls r1, r2, 16 - cmp r1, 0 - bge _0815D546 -_0815D55A: - ldrh r0, [r6, 0x14] - adds r0, 0x1 - strh r0, [r6, 0x14] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3F - ble _0815D5C2 - movs r0, 0x40 - strh r0, [r6, 0x14] - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D594 - ldrh r0, [r6, 0xE] - subs r0, 0x1 - strh r0, [r6, 0xE] - b _0815D59A - .pool -_0815D594: - ldrh r0, [r6, 0x10] - adds r0, 0x1 - strh r0, [r6, 0x10] -_0815D59A: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0xE - ldrsh r1, [r6, r2] - cmp r1, 0 - bne _0815D63C - movs r3, 0x10 - ldrsh r0, [r6, r3] - cmp r0, 0x10 - bne _0815D63C - strh r1, [r6, 0xC] - strh r1, [r6, 0xE] - b _0815D62E -_0815D5C2: - ldrh r0, [r6, 0x18] - ldrh r7, [r6, 0x16] - adds r0, r7 - strh r0, [r6, 0x16] - b _0815D63C -_0815D5CC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - ble _0815D63C - ldr r1, =gScanlineEffect - movs r0, 0x3 - strb r0, [r1, 0x15] - movs r0, 0 - strh r0, [r6, 0xC] - b _0815D62E - .pool -_0815D5EC: - ldrh r0, [r6, 0xC] - adds r0, 0x1 - strh r0, [r6, 0xC] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0815D602 - ldrh r0, [r6, 0xE] - adds r0, 0x1 - strh r0, [r6, 0xE] - b _0815D608 -_0815D602: - ldrh r0, [r6, 0x10] - subs r0, 0x1 - strh r0, [r6, 0x10] -_0815D608: - ldrh r1, [r6, 0x10] - lsls r1, 8 - ldrh r0, [r6, 0xE] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0x10 - bne _0815D63C - movs r2, 0x10 - ldrsh r0, [r6, r2] - cmp r0, 0 - bne _0815D63C - strh r0, [r6, 0xC] - strh r0, [r6, 0xE] -_0815D62E: - ldrh r0, [r6, 0x8] - adds r0, 0x1 - strh r0, [r6, 0x8] - b _0815D63C -_0815D636: - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815D63C: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815D398 - - thumb_func_start sub_815D64C -sub_815D64C: @ 815D64C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE5F0 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815D694 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D64C - - thumb_func_start sub_815D694 -sub_815D694: @ 815D694 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x14 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _0815D6F8 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D708 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _0815D6F8 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _0815D708 - .pool -_0815D6F8: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_0815D708: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _0815D720 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815D720: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D694 - - thumb_func_start sub_815D72C -sub_815D72C: @ 815D72C - push {r4-r6,lr} - mov r6, r8 - push {r6} - mov r8, r0 - adds r5, r2, 0 - adds r0, r3, 0 - ldr r4, [sp, 0x14] - ldr r6, [sp, 0x18] - lsls r1, 16 - lsrs r1, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 16 - lsrs r4, 16 - lsls r6, 16 - lsrs r6, 16 - mov r2, r8 - strh r1, [r2, 0x20] - strh r5, [r2, 0x22] - lsls r1, 16 - asrs r1, 16 - lsls r2, r1, 4 - mov r3, r8 - strh r2, [r3, 0x36] - lsls r5, 16 - asrs r5, 16 - lsls r2, r5, 4 - strh r2, [r3, 0x38] - lsls r0, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 4 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - strh r0, [r1, 0x3A] - lsls r4, 16 - asrs r4, 16 - subs r4, r5 - lsls r4, 4 - adds r0, r4, 0 - adds r1, r6, 0 - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815D72C - - thumb_func_start sub_815D794 -sub_815D794: @ 815D794 - ldrh r1, [r0, 0x3A] - ldrh r2, [r0, 0x36] - adds r1, r2 - strh r1, [r0, 0x36] - ldrh r2, [r0, 0x3C] - ldrh r3, [r0, 0x38] - adds r2, r3 - strh r2, [r0, 0x38] - lsls r1, 16 - asrs r1, 20 - strh r1, [r0, 0x20] - lsls r2, 16 - asrs r2, 20 - strh r2, [r0, 0x22] - bx lr - thumb_func_end sub_815D794 - - thumb_func_start sub_815D7B4 -sub_815D7B4: @ 815D7B4 - push {r4-r6,lr} - sub sp, 0x8 - adds r4, r0, 0 - ldrh r6, [r4, 0x20] - ldrh r5, [r4, 0x22] - bl SetSpriteCoordsToAnimAttackerCoords - ldr r0, =gBattleAnimArgs - ldrb r1, [r0] - adds r0, r4, 0 - bl StartSpriteAffineAnim - movs r0, 0x20 - ldrsh r1, [r4, r0] - movs r0, 0x22 - ldrsh r2, [r4, r0] - lsls r6, 16 - asrs r6, 16 - lsls r5, 16 - asrs r5, 16 - str r5, [sp] - movs r0, 0x40 - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r3, r6, 0 - bl sub_815D72C - movs r0, 0 - strh r0, [r4, 0x2E] - ldr r0, =sub_815D804 - str r0, [r4, 0x1C] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D7B4 - - thumb_func_start sub_815D804 -sub_815D804: @ 815D804 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - movs r0, 0x2E - ldrsh r4, [r5, r0] - lsls r4, 3 - movs r0, 0xFF - ands r4, r0 - adds r0, r5, 0 - bl sub_815D794 - adds r0, r4, 0 - movs r1, 0x8 - bl Sin - strh r0, [r5, 0x26] - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x3A - ble _0815D86A - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815D86A - movs r0, 0 - strh r0, [r5, 0x30] - ldrh r1, [r5, 0x32] - adds r1, 0x1 - strh r1, [r5, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r5, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x3 - ble _0815D86A - adds r0, r5, 0 - bl DestroySpriteAndMatrix -_0815D86A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815D804 - - thumb_func_start sub_815D870 -sub_815D870: @ 815D870 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - ldrh r0, [r6, 0x6] - strh r0, [r5, 0x2E] - ldrb r1, [r6] - adds r0, r5, 0 - bl StartSpriteAffineAnim - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815D896 - ldrh r0, [r6, 0x2] - negs r0, r0 - strh r0, [r6, 0x2] -_0815D896: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r6, [r6, 0x4] - adds r0, r6 - strh r0, [r5, 0x22] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D870 - - thumb_func_start sub_815D8D8 -sub_815D8D8: @ 815D8D8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815D95A - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815D95A - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815D92C - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815D92E - .pool -_0815D92C: - strh r7, [r3, 0x1A] -_0815D92E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815D94A - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815D94E -_0815D94A: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815D94E: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815D95A: - lsls r2, r5, 2 - adds r0, r2, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r6, [r4, 0x16] - ldrh r7, [r4, 0x18] - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r2 - cmp r0, 0 - beq _0815D998 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r6, 8 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815D9AE - .pool -_0815D998: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r6, 8 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815D9AE: - mov r1, r12 - adds r0, r1, r5 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815D9E0 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815D9F2 - .pool -_0815D9E0: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815D9F2: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r5 - lsls r0, 3 - add r0, r8 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bgt _0815DA12 - adds r0, r5, 0 - bl DestroyTask - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - subs r0, 0x1 - strb r0, [r1] -_0815DA12: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815D8D8 - - thumb_func_start sub_815DA20 -sub_815DA20: @ 815DA20 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r2, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - subs r0, 0x1 - strh r0, [r3, 0x8] - movs r1, 0x14 - ldrsh r0, [r3, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r8, r2 - cmp r0, 0 - beq _0815DAA6 - ldrh r0, [r3, 0xA] - subs r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0815DAA6 - movs r2, 0x1A - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815DA78 - ldrh r0, [r3, 0x10] - strh r0, [r3, 0x1A] - negs r0, r0 - strh r0, [r3, 0x10] - b _0815DA7A - .pool -_0815DA78: - strh r7, [r3, 0x1A] -_0815DA7A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0x1C - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0815DA96 - ldrh r0, [r1, 0x12] - strh r0, [r1, 0x1C] - negs r0, r0 - strh r0, [r1, 0x12] - b _0815DA9A -_0815DA96: - movs r0, 0 - strh r0, [r1, 0x1C] -_0815DA9A: - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - add r0, r8 - ldrh r1, [r0, 0x22] - strh r1, [r0, 0xA] -_0815DAA6: - lsls r3, r6, 2 - adds r0, r3, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldrh r2, [r4, 0xC] - ldr r1, =0x00007fff - adds r0, r1, 0 - ands r0, r2 - ldrh r2, [r4, 0x16] - adds r0, r2 - lsls r5, r0, 16 - lsrs r0, r5, 16 - mov r9, r0 - ldrh r0, [r4, 0xE] - ands r1, r0 - ldrh r2, [r4, 0x18] - adds r1, r2 - lsls r1, 16 - lsrs r7, r1, 16 - movs r1, 0xC - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - mov r12, r3 - cmp r0, 0 - beq _0815DB00 - ldr r3, =gSprites - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - lsrs r2, r5, 24 - ldrh r0, [r4, 0x1A] - subs r0, r2 - strh r0, [r1, 0x24] - adds r2, r3, 0 - b _0815DB16 - .pool -_0815DB00: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - lsrs r1, r5, 24 - ldrh r4, [r4, 0x1A] - adds r1, r4 - strh r1, [r0, 0x24] -_0815DB16: - mov r1, r12 - adds r0, r1, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - movs r1, 0xE - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DB48 - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r2, r7, 8 - ldrh r0, [r4, 0x1C] - subs r0, r2 - b _0815DB5A - .pool -_0815DB48: - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - lsrs r0, r7, 8 - ldrh r4, [r4, 0x1C] - adds r0, r4 -_0815DB5A: - strh r0, [r1, 0x26] - mov r2, r12 - adds r0, r2, r6 - lsls r0, 3 - mov r1, r8 - adds r2, r0, r1 - mov r0, r9 - strh r0, [r2, 0x16] - strh r7, [r2, 0x18] - movs r1, 0x8 - ldrsh r0, [r2, r1] - cmp r0, 0 - bgt _0815DB80 - movs r0, 0x1E - strh r0, [r2, 0x8] - movs r0, 0 - strh r0, [r2, 0x22] - ldr r0, =sub_815D8D8 - str r0, [r2] -_0815DB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DA20 - - thumb_func_start sub_815DB90 -sub_815DB90: @ 815DB90 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gTasks - mov r8, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r1, r8 - adds r4, r0, r1 - ldr r1, =gBattlerSpriteIds - ldr r2, =gBattleAnimAttacker - ldrb r0, [r2] - adds r0, r1 - ldrb r0, [r0] - strh r0, [r4, 0x26] - ldr r5, =gBattleAnimArgs - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5] - strh r0, [r4, 0x8] - ldrh r0, [r5, 0xC] - strh r0, [r4, 0x22] - movs r3, 0x6 - ldrsh r0, [r5, r3] - cmp r0, 0 - beq _0815DBD4 - ldrh r0, [r4, 0x14] - ldr r3, =0xffff8000 - adds r1, r3, 0 - orrs r0, r1 - strh r0, [r4, 0x14] -_0815DBD4: - ldrb r0, [r2] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815DC04 - ldrh r0, [r5, 0x2] - strh r0, [r4, 0xC] - ldrh r0, [r5, 0x4] - strh r0, [r4, 0xE] - mov r3, r8 - adds r4, r7, 0 - b _0815DC74 - .pool -_0815DC04: - movs r7, 0x2 - ldrsh r0, [r5, r7] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0815DC20 - ldrh r1, [r5, 0x2] - ldr r0, =0x00007fff - ands r0, r1 - b _0815DC28 - .pool -_0815DC20: - ldrh r0, [r5, 0x2] - ldr r2, =0xffff8000 - adds r1, r2, 0 - orrs r0, r1 -_0815DC28: - strh r0, [r4, 0xC] - ldr r0, =gBattleAnimArgs - movs r3, 0x4 - ldrsh r1, [r0, r3] - movs r2, 0x80 - lsls r2, 8 - ands r1, r2 - adds r5, r0, 0 - cmp r1, 0 - beq _0815DC60 - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r0, =0x00007fff - ands r0, r2 - b _0815DC72 - .pool -_0815DC60: - ldr r3, =gTasks - lsls r4, r6, 2 - adds r1, r4, r6 - lsls r1, 3 - adds r1, r3 - ldrh r2, [r5, 0x4] - ldr r7, =0xffff8000 - adds r0, r7, 0 - orrs r0, r2 -_0815DC72: - strh r0, [r1, 0xE] -_0815DC74: - adds r0, r4, r6 - lsls r0, 3 - adds r0, r3 - movs r1, 0 - strh r1, [r0, 0x18] - strh r1, [r0, 0x16] - ldrh r1, [r5, 0x8] - strh r1, [r0, 0x10] - ldrh r1, [r5, 0xA] - strh r1, [r0, 0x12] - ldr r1, =sub_815DA20 - str r1, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DB90 - - thumb_func_start sub_815DCA4 -sub_815DCA4: @ 815DCA4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - ldr r4, =gBattleAnimArgs - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCC4 - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815DCC4: - movs r0, 0 - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] - strh r0, [r5, 0xC] - ldrh r0, [r4, 0x2] - strh r0, [r5, 0xE] - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DCE8 - ldr r0, =gBattleAnimAttacker - b _0815DCEA - .pool -_0815DCE8: - ldr r0, =gBattleAnimTarget -_0815DCEA: - ldrb r4, [r0] - adds r0, r4, 0 - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x12] - adds r0, r4, 0 - bl GetBattlerSpriteSubpriority - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x14] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r5, 0x26] - ldr r2, =gUnknown_085CE74C - adds r0, r5, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815DD48 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DCA4 - - thumb_func_start sub_815DD48 -sub_815DD48: @ 815DD48 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DD6C - cmp r0, 0x1 - beq _0815DDCC - b _0815DDDA - .pool -_0815DD6C: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815DD82 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_815DDE0 -_0815DD82: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815DD92 - adds r0, r5, 0 - movs r1, 0 - bl sub_815DDE0 -_0815DD92: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _0815DDDA - ldrh r0, [r4, 0xE] - subs r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - cmp r0, 0 - bne _0815DDB4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815DDDA -_0815DDB4: - strh r1, [r4, 0xA] - ldrh r1, [r4, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE74C - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - b _0815DDDA - .pool -_0815DDCC: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815DDDA - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815DDDA: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DD48 - - thumb_func_start sub_815DDE0 -sub_815DDE0: @ 815DDE0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r2, =gTasks - adds r4, r0, r2 - cmp r1, 0 - bne _0815DE08 - movs r1, 0x12 - movs r3, 0xEC - b _0815DE0C - .pool -_0815DE08: - movs r1, 0x1E - movs r3, 0x14 -_0815DE0C: - mov r2, sp - ldrh r0, [r4, 0x10] - subs r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x10] - subs r0, r1 - subs r0, 0x4 - strh r0, [r2, 0x2] - ldrh r0, [r4, 0x10] - adds r0, r1 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x10] - adds r0, r1 - adds r0, 0x4 - strh r0, [r2, 0x6] - add r2, sp, 0x8 - lsls r1, r3, 24 - asrs r1, 24 - ldrh r0, [r4, 0x12] - adds r0, r1 - strh r0, [r2] - ldrh r0, [r4, 0x12] - adds r0, r1 - adds r0, 0x6 - strh r0, [r2, 0x2] - movs r5, 0 - mov r8, r2 - ldr r7, =gSprites -_0815DE44: - lsls r0, r5, 1 - add r0, sp - movs r2, 0 - ldrsh r1, [r0, r2] - movs r0, 0x1 - ands r0, r5 - lsls r0, 1 - add r0, r8 - movs r3, 0 - ldrsh r2, [r0, r3] - ldrb r3, [r4, 0x14] - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_085CE76C - bl CreateSprite - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x40 - beq _0815DE98 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r7 - movs r0, 0 - strh r0, [r1, 0x2E] - movs r0, 0x2 - cmp r5, 0x1 - bhi _0815DE86 - movs r2, 0x2 - negs r2, r2 - adds r0, r2, 0 -_0815DE86: - strh r0, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x32] - strh r6, [r1, 0x34] - movs r0, 0x2 - strh r0, [r1, 0x36] - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] -_0815DE98: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0815DE44 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DDE0 - - thumb_func_start sub_815DEBC -sub_815DEBC: @ 815DEBC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - ble _0815DF02 - ldr r3, =gTasks - movs r0, 0x36 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x34 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815DF02: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DEBC - - thumb_func_start sub_815DF0C -sub_815DF0C: @ 815DF0C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gTasks - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - adds r4, r1 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r4, 0xA] - ldrb r0, [r1] - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r0, [r1, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - adds r0, r1 - strh r0, [r4, 0xC] - ldr r0, =sub_815DF64 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DF0C - - thumb_func_start sub_815DF64 -sub_815DF64: @ 815DF64 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815DFB4 - ldrh r0, [r4, 0xC] - ldr r2, =gUnknown_085CE784 - movs r3, 0x8 - ldrsh r1, [r4, r3] - lsls r1, 1 - adds r1, r2 - ldrh r3, [r1] - movs r1, 0x10 - movs r2, 0x8 - bl BlendPalette - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0815DFA4 - movs r0, 0 - strh r0, [r4, 0x8] -_0815DFA4: - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - b _0815DFC6 - .pool -_0815DFB4: - ldrh r0, [r4, 0xC] - movs r1, 0x10 - movs r2, 0 - movs r3, 0 - bl BlendPalette - adds r0, r5, 0 - bl DestroyAnimVisualTask -_0815DFC6: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815DF64 - - thumb_func_start sub_815DFCC -sub_815DFCC: @ 815DFCC - push {lr} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - movs r2, 0xD0 - lsls r2, 1 - ldr r1, =gBattleAnimAttacker - ldrb r3, [r1] - ldr r1, =gBattleAnimArgs - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xA - str r1, [sp, 0x4] - movs r1, 0x2 - str r1, [sp, 0x8] - movs r1, 0x1E - str r1, [sp, 0xC] - ldr r1, =gUnknown_08C2DC68 - str r1, [sp, 0x10] - ldr r1, =gUnknown_08C2DDC4 - str r1, [sp, 0x14] - ldr r1, =gUnknown_08C2DDA4 - str r1, [sp, 0x18] - movs r1, 0 - bl sub_8117854 - add sp, 0x1C - pop {r0} - bx r0 - .pool - thumb_func_end sub_815DFCC - - thumb_func_start sub_815E01C -sub_815E01C: @ 815E01C - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E038 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - negs r0, r0 - strh r0, [r1] -_0815E038: - ldrb r0, [r6] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - ldr r4, =gBattleAnimArgs - lsrs r0, 24 - ldrh r1, [r4] - adds r0, r1 - strh r0, [r5, 0x20] - ldrb r0, [r6] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldrh r1, [r4, 0x2] - adds r0, r1 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815E080 - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - ldr r0, =0x0000fd80 - strh r0, [r5, 0x30] - b _0815E0A8 - .pool -_0815E080: - cmp r0, 0x1 - bne _0815E09A - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x2 - orrs r0, r1 - strb r0, [r2] - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] - strh r0, [r5, 0x30] - b _0815E0A8 -_0815E09A: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim - movs r0, 0xA0 - lsls r0, 2 - strh r0, [r5, 0x2E] -_0815E0A8: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815E0C8 - ldrh r0, [r5, 0x2E] - negs r0, r0 - strh r0, [r5, 0x2E] - adds r2, r5, 0 - adds r2, 0x3F - ldrb r0, [r2] - movs r1, 0x1 - orrs r0, r1 - strb r0, [r2] -_0815E0C8: - ldr r0, =sub_815E0DC - str r0, [r5, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E01C - - thumb_func_start sub_815E0DC -sub_815E0DC: @ 815E0DC - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x3A] - adds r0, r1 - strh r0, [r2, 0x3A] - ldrh r1, [r2, 0x30] - ldrh r3, [r2, 0x3C] - adds r1, r3 - strh r1, [r2, 0x3C] - lsls r0, 16 - asrs r0, 24 - strh r0, [r2, 0x24] - lsls r1, 16 - asrs r1, 24 - strh r1, [r2, 0x26] - ldrh r0, [r2, 0x38] - adds r0, 0x1 - strh r0, [r2, 0x38] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xE - bne _0815E110 - adds r0, r2, 0 - bl DestroyAnimSprite -_0815E110: - pop {r0} - bx r0 - thumb_func_end sub_815E0DC - - thumb_func_start sub_815E114 -sub_815E114: @ 815E114 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - bl IsContest - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - beq _0815E144 - movs r0, 0x8 - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - movs r0, 0x1 - strh r0, [r6, 0x16] - b _0815E14E - .pool -_0815E144: - movs r0, 0xC - strh r0, [r6, 0x12] - movs r0, 0x3 - strh r0, [r6, 0x14] - strh r1, [r6, 0x16] -_0815E14E: - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815E188 - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E17C - adds r0, 0x3 -_0815E17C: - asrs r0, 2 - adds r0, r4, r0 - b _0815E1AC - .pool -_0815E188: - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1A8 - adds r0, 0x3 -_0815E1A8: - asrs r0, 2 - subs r0, r4, r0 -_0815E1AC: - strh r0, [r6, 0x1E] - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - ldrb r0, [r5] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E1D0 - adds r0, 0x3 -_0815E1D0: - asrs r0, 2 - subs r0, r4, r0 - strh r0, [r6, 0x20] - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x22] - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x24] - ldr r0, =sub_815E20C - str r0, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E114 - - thumb_func_start sub_815E20C -sub_815E20C: @ 815E20C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - ldr r1, =gTasks - adds r5, r0, r1 - movs r0, 0x8 - ldrsh r1, [r5, r0] - cmp r1, 0 - beq _0815E238 - cmp r1, 0x1 - bne _0815E230 - b _0815E330 -_0815E230: - b _0815E33E - .pool -_0815E238: - ldrh r0, [r5, 0xA] - adds r0, 0x1 - strh r0, [r5, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0815E33E - strh r1, [r5, 0xA] - movs r1, 0x1E - ldrsh r0, [r5, r1] - movs r2, 0x20 - ldrsh r1, [r5, r2] - movs r3, 0x22 - ldrsh r2, [r5, r3] - movs r4, 0x24 - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0x12] - str r4, [sp] - ldrb r4, [r5, 0xC] - str r4, [sp, 0x4] - add r4, sp, 0x10 - str r4, [sp, 0x8] - adds r4, 0x2 - str r4, [sp, 0xC] - bl sub_815E34C - movs r6, 0 - mov r8, r4 - ldr r4, =gSprites -_0815E272: - add r0, sp, 0x10 - movs r2, 0 - ldrsh r1, [r0, r2] - mov r3, r8 - movs r0, 0 - ldrsh r2, [r3, r0] - ldr r0, =gUnknown_085CE7EC - movs r3, 0x23 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _0815E306 - movs r1, 0x16 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E2C6 - cmp r6, 0 - bne _0815E2B4 - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x26] - strh r0, [r1, 0x24] - b _0815E2EE - .pool -_0815E2B4: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x26] - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - b _0815E2EE -_0815E2C6: - cmp r6, 0 - bne _0815E2DC - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - negs r0, r0 - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - b _0815E2EC -_0815E2DC: - lsls r2, r3, 4 - adds r1, r2, r3 - lsls r1, 2 - adds r1, r4 - ldrh r0, [r5, 0x14] - strh r0, [r1, 0x24] - ldrh r0, [r5, 0x14] - negs r0, r0 -_0815E2EC: - strh r0, [r1, 0x26] -_0815E2EE: - ldr r1, =gSprites - adds r0, r2, r3 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x2E] - strh r7, [r0, 0x30] - movs r1, 0xA - strh r1, [r0, 0x32] - ldrh r0, [r5, 0x1C] - adds r0, 0x1 - strh r0, [r5, 0x1C] -_0815E306: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _0815E272 - ldrh r2, [r5, 0xC] - movs r3, 0xC - ldrsh r1, [r5, r3] - movs r4, 0x12 - ldrsh r0, [r5, r4] - cmp r1, r0 - bne _0815E324 - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0815E324: - adds r0, r2, 0x1 - strh r0, [r5, 0xC] - b _0815E33E - .pool -_0815E330: - movs r1, 0x1C - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0815E33E - adds r0, r7, 0 - bl DestroyAnimVisualTask -_0815E33E: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E20C - - thumb_func_start sub_815E34C -sub_815E34C: @ 815E34C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - ldr r4, [sp, 0x28] - ldr r5, [sp, 0x2C] - ldr r6, [sp, 0x30] - mov r9, r6 - ldr r6, [sp, 0x34] - mov r10, r6 - lsls r0, 16 - lsrs r0, 16 - mov r12, r0 - lsls r1, 16 - lsrs r1, 16 - str r1, [sp] - lsls r2, 16 - lsrs r2, 16 - adds r7, r2, 0 - lsls r3, 16 - lsrs r3, 16 - str r3, [sp, 0x4] - lsls r4, 24 - lsrs r6, r4, 24 - lsls r5, 24 - lsrs r5, 24 - mov r8, r5 - cmp r5, 0 - bne _0815E394 - mov r2, r9 - strh r0, [r2] - mov r6, r10 - strh r1, [r6] - b _0815E3F2 -_0815E394: - cmp r5, r6 - bcc _0815E3A2 - mov r0, r9 - strh r2, [r0] - mov r1, r10 - strh r3, [r1] - b _0815E3F2 -_0815E3A2: - subs r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - mov r2, r12 - lsls r1, r2, 16 - asrs r1, 16 - lsls r5, r1, 8 - lsls r0, r7, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r1, r8 - muls r1, r0 - adds r0, r1, 0 - adds r5, r0 - ldr r2, [sp] - lsls r1, r2, 16 - asrs r1, 16 - lsls r4, r1, 8 - ldr r2, [sp, 0x4] - lsls r0, r2, 16 - asrs r0, 16 - subs r0, r1 - lsls r0, 8 - adds r1, r6, 0 - bl __divsi3 - mov r6, r8 - muls r6, r0 - adds r0, r6, 0 - adds r4, r0 - asrs r5, 8 - mov r0, r9 - strh r5, [r0] - asrs r4, 8 - mov r1, r10 - strh r4, [r1] -_0815E3F2: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E34C - - thumb_func_start sub_815E404 -sub_815E404: @ 815E404 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x24 - ble _0815E43A - ldr r3, =gTasks - movs r0, 0x32 - ldrsh r1, [r4, r0] - lsls r1, 1 - movs r0, 0x30 - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl DestroySprite -_0815E43A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E404 - - thumb_func_start sub_815E444 -sub_815E444: @ 815E444 - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - strh r0, [r4, 0x22] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x36] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x2E] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A70C0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E444 - - thumb_func_start sub_815E47C -sub_815E47C: @ 815E47C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r0, 2 - add r0, r9 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - ldr r0, =gBattleAnimAttacker - mov r10, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x1E] - mov r1, r10 - ldrb r0, [r1] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x20] - ldr r0, =gBattleAnimTarget - mov r8, r0 - ldrb r0, [r0] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x22] - mov r1, r8 - ldrb r0, [r1] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - mov r1, r8 - ldrb r0, [r1] - movs r1, 0 - bl sub_80A861C - lsls r4, 24 - lsrs r4, 24 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0815E4EE - adds r0, 0x3 -_0815E4EE: - asrs r0, 2 - adds r0, r4, r0 - strh r0, [r7, 0x24] - ldr r4, =gUnknown_085CE84C - movs r0, 0x1E - ldrsh r5, [r7, r0] - movs r1, 0x20 - ldrsh r6, [r7, r1] - mov r1, r8 - ldrb r0, [r1] - bl GetBattlerSpriteSubpriority - adds r3, r0, 0 - subs r3, 0x5 - lsls r3, 24 - lsrs r3, 24 - adds r0, r4, 0 - adds r1, r5, 0 - adds r2, r6, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strh r0, [r7, 0x26] - cmp r0, 0x40 - beq _0815E5B8 - ldr r4, =gSprites - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x10 - strh r1, [r0, 0x2E] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x22] - strh r1, [r0, 0x32] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrh r1, [r7, 0x24] - strh r1, [r0, 0x36] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x38] - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl InitAnimArcTranslation - mov r1, r10 - ldrb r0, [r1] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815E596 - movs r0, 0x26 - ldrsh r1, [r7, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0x1 - bl StartSpriteAffineAnim -_0815E596: - ldr r0, =sub_815E5CC - str r0, [r7] - b _0815E5BE - .pool -_0815E5B8: - mov r0, r9 - bl DestroyAnimVisualTask -_0815E5BE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_815E47C - - thumb_func_start sub_815E5CC -sub_815E5CC: @ 815E5CC - push {r4,r5,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0815E634 - cmp r1, 0x1 - bgt _0815E5F4 - cmp r1, 0 - beq _0815E5FE - b _0815E6D2 - .pool -_0815E5F4: - cmp r1, 0x2 - beq _0815E658 - cmp r1, 0x3 - beq _0815E6CC - b _0815E6D2 -_0815E5FE: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - strh r1, [r4, 0xA] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl TranslateAnimArc - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0815E6D2 - b _0815E6BE - .pool -_0815E634: - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl TranslateAnimArc - lsls r0, 24 - cmp r0, 0 - beq _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815E6BE - .pool -_0815E658: - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E6D2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r2, [r4, 0xC] - adds r2, 0x1 - strh r2, [r4, 0xC] - ldr r5, =gSprites - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - movs r0, 0x1 - ands r2, r0 - adds r1, 0x3E - lsls r2, 2 - ldrb r3, [r1] - subs r0, 0x6 - ands r0, r3 - orrs r0, r2 - strb r0, [r1] - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _0815E6D2 - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - bl DestroySprite -_0815E6BE: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815E6D2 - .pool -_0815E6CC: - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815E6D2: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815E5CC - - thumb_func_start sub_815E6D8 -sub_815E6D8: @ 815E6D8 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r1, [r0, r2] - adds r6, r0, 0 - cmp r1, 0 - bne _0815E6F4 - ldr r0, =gBattleAnimAttacker - b _0815E6F6 - .pool -_0815E6F4: - ldr r0, =gBattleAnimTarget -_0815E6F6: - ldrb r5, [r0] - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] - adds r1, r6, 0 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x3A] - movs r2, 0x2 - ldrsh r0, [r1, r2] - movs r1, 0x1 - cmp r0, 0 - bne _0815E724 - movs r3, 0x1 - negs r3, r3 - adds r1, r3, 0 -_0815E724: - strh r1, [r4, 0x3C] - adds r0, r5, 0 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - movs r1, 0x2 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815E768 - ldrb r2, [r4, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x3] - adds r0, r5, 0 - movs r1, 0x4 - bl sub_80A861C - subs r0, 0x8 - b _0815E772 - .pool -_0815E768: - adds r0, r5, 0 - movs r1, 0x5 - bl sub_80A861C - adds r0, 0x8 -_0815E772: - strh r0, [r4, 0x20] - ldr r0, =sub_815E784 - str r0, [r4, 0x1C] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E6D8 - - thumb_func_start sub_815E784 -sub_815E784: @ 815E784 - push {lr} - adds r2, r0, 0 - movs r0, 0x2E - ldrsh r1, [r2, r0] - cmp r1, 0x1 - beq _0815E7CC - cmp r1, 0x1 - bgt _0815E79A - cmp r1, 0 - beq _0815E7A4 - b _0815E83C -_0815E79A: - cmp r1, 0x2 - beq _0815E7DC - cmp r1, 0x3 - beq _0815E802 - b _0815E83C -_0815E7A4: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E83C - strh r1, [r2, 0x30] - ldrh r0, [r2, 0x3C] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - adds r0, 0x1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xC - bne _0815E83C - b _0815E7FA -_0815E7CC: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - b _0815E7F6 -_0815E7DC: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r1, 2 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815E83C -_0815E7F6: - movs r0, 0 - strh r0, [r2, 0x30] -_0815E7FA: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E802: - movs r0, 0x3C - ldrsh r1, [r2, r0] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - bne _0815E83C - ldrh r0, [r2, 0x3A] - subs r0, 0x1 - strh r0, [r2, 0x3A] - lsls r0, 16 - cmp r0, 0 - beq _0815E836 - movs r0, 0 - strh r0, [r2, 0x30] - ldrh r0, [r2, 0x2E] - subs r0, 0x1 - strh r0, [r2, 0x2E] - b _0815E83C -_0815E836: - adds r0, r2, 0 - bl DestroyAnimSprite -_0815E83C: - pop {r0} - bx r0 - thumb_func_end sub_815E784 - - thumb_func_start sub_815E840 -sub_815E840: @ 815E840 - push {r4,lr} - lsls r0, 24 - lsrs r1, r0, 24 - ldr r2, =gBattleAnimArgs - movs r3, 0 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815E85C - adds r0, r1, 0 - bl DestroyAnimVisualTask - b _0815E884 - .pool -_0815E85C: - ldr r0, =gTasks - lsls r4, r1, 2 - adds r4, r1 - lsls r4, 3 - adds r4, r0 - ldrh r0, [r2, 0x2] - strh r0, [r4, 0x8] - ldrb r0, [r2] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE87C - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_815E898 - str r0, [r4] -_0815E884: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E840 - - thumb_func_start sub_815E898 -sub_815E898: @ 815E898 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815E8F2 - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r1, [r4, 0xC] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815E8E0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x2 - b _0815E8F0 - .pool -_0815E8E0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000fffe -_0815E8F0: - strh r1, [r0, 0x24] -_0815E8F2: - adds r0, r4, 0 - bl RunAffineAnimFromTaskData - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0815E94E - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] - ldrh r0, [r4, 0x8] - subs r0, 0x1 - strh r0, [r4, 0x8] - lsls r0, 16 - cmp r0, 0 - beq _0815E948 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldrh r1, [r0, 0x26] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_085CE87C - bl PrepareAffineAnimInTaskData - strh r5, [r4, 0xA] - strh r5, [r4, 0xC] - b _0815E94E - .pool -_0815E948: - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815E94E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_815E898 - - thumb_func_start sub_815E954 -sub_815E954: @ 815E954 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815E970 - ldr r4, =gBattleAnimAttacker - b _0815E972 - .pool -_0815E970: - ldr r4, =gBattleAnimTarget -_0815E972: - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - movs r1, 0x22 - ldrsh r0, [r5, r1] - cmp r0, 0x7 - bgt _0815E996 - movs r0, 0x8 - strh r0, [r5, 0x22] -_0815E996: - movs r2, 0 - strh r2, [r5, 0x2E] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x2] - strh r0, [r5, 0x30] - strh r2, [r5, 0x32] - ldrh r0, [r1, 0x4] - strh r0, [r5, 0x34] - ldr r0, =sub_815E9BC - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815E954 - - thumb_func_start sub_815E9BC -sub_815E9BC: @ 815E9BC - push {lr} - adds r3, r0, 0 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x30 - ldrsh r1, [r3, r2] - cmp r0, r1 - blt _0815EA10 - movs r0, 0 - strh r0, [r3, 0x2E] - ldrh r1, [r3, 0x32] - adds r1, 0x1 - movs r0, 0x1 - ands r1, r0 - strh r1, [r3, 0x32] - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - lsls r1, 2 - ldrb r2, [r0] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - movs r2, 0x32 - ldrsh r0, [r3, r2] - cmp r0, 0 - beq _0815EA10 - ldrh r0, [r3, 0x34] - subs r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - cmp r0, 0 - bne _0815EA10 - adds r0, r3, 0 - bl DestroyAnimSprite -_0815EA10: - pop {r0} - bx r0 - thumb_func_end sub_815E9BC - - thumb_func_start sub_815EA14 -sub_815EA14: @ 815EA14 - push {lr} - adds r3, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EA44 - ldrb r2, [r3, 0x3] - lsls r1, r2, 26 - lsrs r1, 27 - movs r0, 0x8 - orrs r1, r0 - lsls r1, 1 - subs r0, 0x47 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0x3] - movs r0, 0x64 - strh r0, [r3, 0x20] - movs r0, 0x1 - b _0815EA4A - .pool -_0815EA44: - movs r0, 0x8C - strh r0, [r3, 0x20] - ldr r0, =0x0000ffff -_0815EA4A: - strh r0, [r3, 0x3C] - movs r0, 0x38 - strh r0, [r3, 0x22] - ldr r0, =sub_815EA60 - str r0, [r3, 0x1C] - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EA14 - - thumb_func_start sub_815EA60 -sub_815EA60: @ 815EA60 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8 - bls _0815EA6E - b _0815EC40 -_0815EA6E: - lsls r0, 2 - ldr r1, =_0815EA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EA7C: - .4byte _0815EAA0 - .4byte _0815EAD2 - .4byte _0815EAE4 - .4byte _0815EB24 - .4byte _0815EB36 - .4byte _0815EB74 - .4byte _0815EBD8 - .4byte _0815EBF8 - .4byte _0815EC1E -_0815EAA0: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r0, 1 - ldrh r1, [r4, 0x22] - subs r1, r0 - strh r1, [r4, 0x22] - ldrh r2, [r4, 0x30] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _0815EAC2 - movs r0, 0x3C - ldrsh r1, [r4, r0] - lsls r1, 1 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] -_0815EAC2: - adds r0, r2, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - beq _0815EAD0 - b _0815EC40 -_0815EAD0: - b _0815EC12 -_0815EAD2: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - beq _0815EAE2 - b _0815EC40 -_0815EAE2: - b _0815EC12 -_0815EAE4: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - beq _0815EB1C - b _0815EC40 -_0815EB1C: - b _0815EC12 - .pool -_0815EB24: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - beq _0815EB34 - b _0815EC40 -_0815EB34: - b _0815EC12 -_0815EB36: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x22] - subs r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xC - bne _0815EC40 - b _0815EC16 - .pool -_0815EB74: - ldrh r2, [r4, 0x30] - adds r2, 0x1 - strh r2, [r4, 0x30] - movs r3, 0x3C - ldrsh r1, [r4, r3] - lsls r0, r1, 1 - adds r0, r1 - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r3, =gSineTable - movs r0, 0x30 - ldrsh r1, [r4, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x3C] - muls r0, r1 - strh r0, [r4, 0x24] - lsls r2, 16 - asrs r2, 16 - cmp r2, 0xF - bne _0815EBC0 - ldrh r2, [r4, 0x4] - lsls r1, r2, 22 - lsrs r1, 22 - adds r1, 0x10 - ldr r3, =0x000003ff - adds r0, r3, 0 - ands r1, r0 - ldr r0, =0xfffffc00 - ands r0, r2 - orrs r0, r1 - strh r0, [r4, 0x4] -_0815EBC0: - movs r1, 0x30 - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bne _0815EC40 - b _0815EC12 - .pool -_0815EBD8: - movs r3, 0x3C - ldrsh r0, [r4, r3] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 1 - ldrh r0, [r4, 0x20] - adds r1, r0 - strh r1, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815EC40 - b _0815EC12 -_0815EBF8: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r0, 1 - ldrh r3, [r4, 0x20] - adds r0, r3 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _0815EC40 -_0815EC12: - movs r0, 0 - strh r0, [r4, 0x30] -_0815EC16: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815EC40 -_0815EC1E: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsls r1, r0, 1 - adds r1, r0 - ldrh r0, [r4, 0x20] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EC40 - adds r0, r4, 0 - bl DestroyAnimSprite -_0815EC40: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815EA60 - - thumb_func_start sub_815EC48 -sub_815EC48: @ 815EC48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - bl IsDoubleBattle - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x1 - bne _0815ECB4 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815ECAC - strh r7, [r6, 0x24] - b _0815ECD4 - .pool -_0815ECAC: - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECB4: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815ECD0 - ldr r0, =0x0000ffff - b _0815ECD2 - .pool -_0815ECD0: - movs r0, 0x1 -_0815ECD2: - strh r0, [r6, 0x24] -_0815ECD4: - ldr r0, =sub_815ECE4 - str r0, [r6] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EC48 - - thumb_func_start sub_815ECE4 -sub_815ECE4: @ 815ECE4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r3, r0, r1 - movs r1, 0x8 - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bls _0815ECFE - b _0815EE78 -_0815ECFE: - lsls r0, 2 - ldr r1, =_0815ED10 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815ED10: - .4byte _0815ED34 - .4byte _0815ED46 - .4byte _0815ED78 - .4byte _0815EDA8 - .4byte _0815EDCE - .4byte _0815EDF8 - .4byte _0815EE08 - .4byte _0815EE28 - .4byte _0815EE60 -_0815ED34: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD - beq _0815ED44 - b _0815EE78 -_0815ED44: - b _0815EE50 -_0815ED46: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r2, r0, 1 - adds r2, r0 - ldrh r0, [r1, 0x24] - subs r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - beq _0815ED72 - b _0815EE78 -_0815ED72: - b _0815EE50 - .pool -_0815ED78: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r0, r2, 1 - adds r0, r2 - ldrh r2, [r1, 0x24] - adds r0, r2 - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDA8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - bne _0815EE78 - movs r0, 0 - strh r0, [r3, 0xA] - ldrh r1, [r3, 0xC] - movs r2, 0xC - ldrsh r0, [r3, r2] - cmp r0, 0 - bne _0815EE54 - adds r0, r1, 0x1 - strh r0, [r3, 0xC] - movs r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 -_0815EDCE: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r1, [r3, 0x24] - ldrh r2, [r0, 0x24] - adds r1, r2 - strh r1, [r0, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - bne _0815EE78 - b _0815EE50 - .pool -_0815EDF8: - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0815EE78 - b _0815EE50 -_0815EE08: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x24 - ldrsh r2, [r3, r0] - lsls r2, 2 - ldrh r0, [r1, 0x24] - subs r0, r2 - b _0815EE40 - .pool -_0815EE28: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r3, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r2, 0x24 - ldrsh r0, [r3, r2] - lsls r0, 2 - ldrh r2, [r1, 0x24] - adds r0, r2 -_0815EE40: - strh r0, [r1, 0x24] - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - bne _0815EE78 -_0815EE50: - movs r0, 0 - strh r0, [r3, 0xA] -_0815EE54: - ldrh r0, [r3, 0x8] - adds r0, 0x1 - strh r0, [r3, 0x8] - b _0815EE78 - .pool -_0815EE60: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl DestroyAnimVisualTask -_0815EE78: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815ECE4 - - thumb_func_start sub_815EE84 -sub_815EE84: @ 815EE84 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815EEA8 - adds r0, r4, 0 - movs r1, 0x1 - bl InitAnimSpritePos - ldr r0, =gBattleAnimAttacker - b _0815EEAA - .pool -_0815EEA8: - ldr r0, =gBattleAnimTarget -_0815EEAA: - ldrb r0, [r0] - strh r0, [r4, 0x3C] - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815EECE - ldrb r0, [r4, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r4, 0x3] -_0815EECE: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bl sub_80A8328 - movs r2, 0x3 - ands r2, r0 - lsls r2, 2 - ldrb r3, [r4, 0x5] - movs r1, 0xD - negs r1, r1 - adds r0, r1, 0 - ands r0, r3 - orrs r0, r2 - strb r0, [r4, 0x5] - ldrb r0, [r4, 0x1] - ands r1, r0 - movs r0, 0x4 - orrs r1, r0 - strb r1, [r4, 0x1] - ldr r0, =sub_815EF08 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815EE84 - - thumb_func_start sub_815EF08 -sub_815EF08: @ 815EF08 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x38 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815EF16 - b _0815F106 -_0815EF16: - lsls r0, 2 - ldr r1, =_0815EF24 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF24: - .4byte _0815EF38 - .4byte _0815F038 - .4byte _0815F0A0 - .4byte _0815F0B4 - .4byte _0815F100 -_0815EF38: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x5 - bhi _0815EF68 - lsls r0, 2 - ldr r1, =_0815EF50 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815EF50: - .4byte _0815EF6C - .4byte _0815EF88 - .4byte _0815EFAA - .4byte _0815EFC6 - .4byte _0815EF6C - .4byte _0815EFEC -_0815EF68: - movs r0, 0 - strh r0, [r4, 0x3A] -_0815EF6C: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EF88: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x5 - bl sub_80A861C - subs r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl sub_80A861C - adds r0, 0x4 - b _0815EFE6 -_0815EFAA: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - b _0815EFE0 -_0815EFC6: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x4 - bl sub_80A861C - adds r0, 0x4 - lsls r0, 16 - lsrs r5, r0, 16 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 -_0815EFE0: - bl sub_80A861C - subs r0, 0x4 -_0815EFE6: - lsls r0, 16 - lsrs r1, r0, 16 - b _0815F00C -_0815EFEC: - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r5, r0, 24 - ldrh r0, [r4, 0x3C] - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r1, r0, 24 -_0815F00C: - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmp r0, 0x4 - bne _0815F018 - movs r0, 0x18 - b _0815F022 -_0815F018: - cmp r0, 0x5 - bne _0815F020 - movs r0, 0x6 - b _0815F022 -_0815F020: - movs r0, 0xC -_0815F022: - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x30] - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x22] - strh r0, [r4, 0x34] - strh r1, [r4, 0x36] - adds r0, r4, 0 - bl InitAnimLinearTranslation - b _0815F0F8 -_0815F038: - adds r0, r4, 0 - bl TranslateAnimLinear - lsls r0, 24 - cmp r0, 0 - beq _0815F106 - movs r1, 0x3A - ldrsh r0, [r4, r1] - cmp r0, 0x4 - beq _0815F070 - cmp r0, 0x5 - beq _0815F090 - ldrh r0, [r4, 0x24] - ldrh r2, [r4, 0x20] - adds r0, r2 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x2E] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F088 -_0815F070: - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x20] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x26] - ldrh r2, [r4, 0x22] - adds r0, r2 - strh r0, [r4, 0x22] - strh r1, [r4, 0x26] - strh r1, [r4, 0x24] - strh r1, [r4, 0x38] -_0815F088: - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0815F106 -_0815F090: - movs r0, 0 - strh r0, [r4, 0x2E] - movs r1, 0x10 - strh r1, [r4, 0x30] - strh r0, [r4, 0x32] - movs r0, 0x3 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0A0: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _0815F106 - movs r0, 0 - strh r0, [r4, 0x38] - b _0815F106 -_0815F0B4: - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F0C6 - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - b _0815F0CC -_0815F0C6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_0815F0CC: - ldrh r1, [r4, 0x32] - lsls r1, 8 - ldrh r0, [r4, 0x30] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - bne _0815F106 - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] -_0815F0F8: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - b _0815F106 -_0815F100: - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F106: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815EF08 - - thumb_func_start sub_815F10C -sub_815F10C: @ 815F10C - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r5, r0, 0 - strh r5, [r4, 0x24] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r2, 0x30 - ldrsh r1, [r4, r2] - subs r0, r1 - movs r2, 0x38 - ldrsh r1, [r4, r2] - muls r0, r1 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl __divsi3 - adds r3, r0, 0 - strh r3, [r4, 0x26] - ldrh r1, [r4, 0x38] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F16A - ldr r0, =gUnknown_085CE3A0 - ldrh r1, [r4, 0x20] - adds r1, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x22] - adds r2, r3 - lsls r2, 16 - asrs r2, 16 - movs r3, 0x5 - bl CreateSprite -_0815F16A: - movs r0, 0x38 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0815F17C - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F17C: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F10C - - thumb_func_start sub_815F18C -sub_815F18C: @ 815F18C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - ldrb r0, [r4] - movs r1, 0x3 - bl GetBattlerSpriteCoord - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0815F1B8 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815F1D0 -_0815F1B8: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - subs r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - subs r1, r0 - b _0815F1DE - .pool -_0815F1D0: - ldr r2, =gBattleAnimArgs - ldrh r1, [r5, 0x20] - ldrh r0, [r2] - adds r0, r1, r0 - strh r0, [r5, 0x2E] - ldrh r0, [r2, 0x4] - adds r1, r0 -_0815F1DE: - strh r1, [r5, 0x32] - adds r3, r2, 0 - ldrh r1, [r5, 0x22] - ldrh r2, [r3, 0x2] - adds r2, r1, r2 - strh r2, [r5, 0x30] - ldrh r0, [r3, 0x6] - adds r1, r0 - strh r1, [r5, 0x34] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x36] - ldrh r0, [r5, 0x2E] - strh r0, [r5, 0x20] - strh r2, [r5, 0x22] - ldr r0, =sub_815F10C - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F18C - - thumb_func_start AnimTask_MonToSubstitute -AnimTask_MonToSubstitute: @ 815F20C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r5, r0, 24 - adds r2, r5, 0 - ldr r0, =gTasks - mov r9, r0 - lsls r7, r6, 2 - adds r0, r7, r6 - lsls r0, 3 - mov r8, r0 - mov r4, r8 - add r4, r9 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0815F254 - adds r0, r5, 0 - movs r1, 0 - bl PrepareBattlerSpriteForRotScale - movs r0, 0x80 - lsls r0, 1 - strh r0, [r4, 0xA] - strh r0, [r4, 0xC] - b _0815F2A0 - .pool -_0815F254: - cmp r0, 0x1 - bne _0815F2AC - ldrh r0, [r4, 0xA] - adds r0, 0x60 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0xC] - subs r0, 0xD - strh r0, [r4, 0xC] - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0xC - ldrsh r2, [r4, r0] - adds r0, r5, 0 - movs r3, 0 - bl SetSpriteRotScale - ldrh r0, [r4, 0xE] - adds r0, 0x1 - strh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x9 - bne _0815F310 - movs r0, 0 - strh r0, [r4, 0xE] - adds r0, r5, 0 - bl ResetSpriteRotScale - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] -_0815F2A0: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F310 - .pool -_0815F2AC: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0 - bl LoadBattleMonGfxAndAnimate - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815F2EE - ldr r3, =gSprites - ldr r2, =gBattlerSpriteIds - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r3, 0 - adds r1, 0x10 - adds r0, r1 - ldr r1, =gUnknown_082FF6C0 - str r1, [r0] - ldrb r0, [r4] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - movs r1, 0 - bl StartSpriteAffineAnim -_0815F2EE: - mov r4, r9 - adds r3, r7, 0 - ldr r5, =sub_815F330 - movs r1, 0xF - mov r2, r8 - adds r0, r4, r2 - adds r0, 0x26 - movs r2, 0 -_0815F2FE: - strh r2, [r0] - subs r0, 0x2 - subs r1, 0x1 - cmp r1, 0 - bge _0815F2FE - adds r0, r3, r6 - lsls r0, 3 - adds r0, r4 - str r5, [r0] -_0815F310: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_MonToSubstitute - - thumb_func_start sub_815F330 -sub_815F330: @ 815F330 - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r5, [r4, r0] - cmp r5, 0x1 - beq _0815F394 - cmp r5, 0x1 - bgt _0815F360 - cmp r5, 0 - beq _0815F36A - b _0815F482 - .pool -_0815F360: - cmp r5, 0x2 - beq _0815F400 - cmp r5, 0x3 - beq _0815F43C - b _0815F482 -_0815F36A: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldr r0, =0x0000ff38 - strh r0, [r1, 0x26] - movs r0, 0xC8 - strh r0, [r1, 0x24] - adds r1, 0x3E - ldrb r2, [r1] - subs r0, 0xCD - ands r0, r2 - strb r0, [r1] - strh r5, [r4, 0x1C] - b _0815F42E - .pool -_0815F394: - ldrh r1, [r4, 0x1C] - adds r1, 0x70 - movs r5, 0 - strh r1, [r4, 0x1C] - ldr r2, =gSprites - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r2, r0, r2 - lsls r1, 16 - asrs r1, 24 - ldrh r3, [r2, 0x26] - adds r1, r3 - strh r1, [r2, 0x26] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - blt _0815F3C4 - strh r5, [r2, 0x24] -_0815F3C4: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0815F3CE - strh r5, [r2, 0x26] -_0815F3CE: - movs r3, 0x26 - ldrsh r0, [r2, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - ldr r1, =0xfffff800 - adds r0, r1, 0 - ldrh r2, [r4, 0x1C] - adds r0, r2 - strh r0, [r4, 0x1C] - b _0815F42E - .pool -_0815F400: - ldrh r0, [r4, 0x1C] - subs r0, 0x70 - strh r0, [r4, 0x1C] - lsls r0, 16 - cmp r0, 0 - bge _0815F410 - movs r0, 0 - strh r0, [r4, 0x1C] -_0815F410: - ldr r0, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r0 - ldrh r2, [r4, 0x1C] - lsls r2, 16 - asrs r2, 24 - ldrh r0, [r1, 0x26] - subs r0, r2 - strh r0, [r1, 0x26] - movs r3, 0x1C - ldrsh r0, [r4, r3] - cmp r0, 0 - bne _0815F482 -_0815F42E: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815F482 - .pool -_0815F43C: - ldrh r0, [r4, 0x1C] - adds r0, 0x70 - strh r0, [r4, 0x1C] - ldr r2, =gSprites - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - adds r1, r2 - lsls r0, 16 - asrs r0, 24 - ldrh r2, [r1, 0x26] - adds r0, r2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0815F460 - movs r0, 0 - strh r0, [r1, 0x26] -_0815F460: - movs r3, 0x26 - ldrsh r0, [r1, r3] - cmp r0, 0 - bne _0815F482 - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7D - bl PlaySE12WithPanning - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0815F482: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F330 - - thumb_func_start sub_815F48C -sub_815F48C: @ 815F48C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815F4B8 - ldrb r0, [r4] - bl GetBattlerSpriteSubpriority - subs r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ff70 - b _0815F4C8 - .pool -_0815F4B8: - ldrb r0, [r4] - bl GetBattlerSpriteSubpriority - adds r0, 0x2 - adds r1, r5, 0 - adds r1, 0x43 - strb r0, [r1] - ldr r4, =0x0000ffa0 -_0815F4C8: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - strh r4, [r5, 0x26] - ldr r0, =sub_815F4F0 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F48C - - thumb_func_start sub_815F4F0 -sub_815F4F0: @ 815F4F0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _0815F4FE - b _0815F61A -_0815F4FE: - lsls r0, 2 - ldr r1, =_0815F50C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F50C: - .4byte _0815F520 - .4byte _0815F544 - .4byte _0815F584 - .4byte _0815F5B4 - .4byte _0815F5E0 -_0815F520: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x26] - b _0815F5D8 -_0815F544: - ldrh r1, [r4, 0x30] - adds r1, 0x4 - movs r5, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r3, 0x30 - ldrsh r0, [r4, r3] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xCD - bl PlaySE12WithPanning - strh r5, [r4, 0x30] - strh r5, [r4, 0x26] - b _0815F5D8 - .pool -_0815F584: - ldrh r1, [r4, 0x30] - adds r1, 0x6 - movs r3, 0 - strh r1, [r4, 0x30] - ldr r2, =gSineTable - movs r5, 0x30 - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 20 - negs r0, r0 - strh r0, [r4, 0x26] - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x7F - ble _0815F61A - strh r3, [r4, 0x30] - strh r3, [r4, 0x26] - b _0815F5D8 - .pool -_0815F5B4: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0xC0 - bl PlaySE12WithPanning - movs r0, 0 - strh r0, [r4, 0x30] -_0815F5D8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F61A -_0815F5E0: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0815F61A - movs r0, 0 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x32] - adds r1, 0x1 - strh r1, [r4, 0x32] - movs r0, 0x1 - ands r1, r0 - adds r3, r4, 0 - adds r3, 0x3E - lsls r1, 2 - ldrb r2, [r3] - subs r0, 0x6 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _0815F61A - adds r0, r4, 0 - bl DestroyAnimSprite -_0815F61A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_815F4F0 - - thumb_func_start sub_815F620 -sub_815F620: @ 815F620 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl IsContest - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0 - bne _0815F66E - movs r0, 0x1 - bl CloneBattlerSpriteWithBlend - lsls r0, 16 - lsrs r1, r0, 16 - mov r10, r1 - asrs r6, r0, 16 - cmp r6, 0 - blt _0815F66E - movs r0, 0x1 - bl CloneBattlerSpriteWithBlend - lsls r0, 16 - lsrs r1, r0, 16 - mov r9, r1 - asrs r1, r0, 16 - cmp r1, 0 - bge _0815F67C - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl obj_delete_but_dont_free_vram -_0815F66E: - mov r0, r8 - bl DestroyAnimVisualTask - b _0815F780 - .pool -_0815F67C: - ldr r4, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r5, r0, r4 - ldrh r0, [r5, 0x24] - adds r0, 0x18 - strh r0, [r5, 0x24] - lsls r0, r6, 4 - adds r0, r6 - lsls r0, 2 - adds r6, r0, r4 - ldrh r0, [r6, 0x24] - subs r0, 0x18 - strh r0, [r6, 0x24] - strh r7, [r5, 0x2E] - strh r7, [r6, 0x2E] - strh r7, [r5, 0x30] - strh r7, [r6, 0x30] - strh r7, [r5, 0x32] - strh r7, [r6, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000fff0 - strh r0, [r6, 0x34] - strh r7, [r5, 0x36] - movs r0, 0x80 - strh r0, [r6, 0x36] - movs r0, 0x18 - strh r0, [r5, 0x38] - strh r0, [r6, 0x38] - mov r0, r8 - strh r0, [r5, 0x3A] - strh r0, [r6, 0x3A] - strh r7, [r5, 0x3C] - strh r7, [r6, 0x3C] - ldr r2, =gTasks - mov r1, r8 - lsls r3, r1, 2 - adds r0, r3, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r7, r4, 0 - mov r12, r3 - cmp r0, 0 - bne _0815F720 - adds r2, r5, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r2, r6, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0815F736 - .pool -_0815F720: - adds r1, r5, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r2 - strb r0, [r1] -_0815F736: - mov r1, r9 - lsls r0, r1, 16 - asrs r0, 16 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r4, r2, r7 - ldrb r1, [r4, 0x1] - movs r3, 0xD - negs r3, r3 - adds r0, r3, 0 - ands r0, r1 - strb r0, [r4, 0x1] - mov r1, r10 - lsls r0, r1, 16 - asrs r0, 16 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r4, r1, r7 - ldrb r0, [r4, 0x1] - ands r3, r0 - strb r3, [r4, 0x1] - adds r3, r7, 0 - adds r3, 0x1C - adds r2, r3 - ldr r0, =sub_815F7C4 - str r0, [r2] - adds r1, r3 - str r0, [r1] - mov r0, r12 - add r0, r8 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldr r1, =sub_815F79C - str r1, [r0] -_0815F780: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F620 - - thumb_func_start sub_815F79C -sub_815F79C: @ 815F79C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815F7BA - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0815F7BA: - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F79C - - thumb_func_start sub_815F7C4 -sub_815F7C4: @ 815F7C4 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0815F80E - movs r0, 0 - strh r0, [r4, 0x30] - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0815F80E - adds r3, r4, 0 - adds r3, 0x3E - ldrb r2, [r3] - lsls r1, r2, 29 - lsrs r1, 31 - movs r0, 0x1 - eors r1, r0 - ands r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] -_0815F80E: - ldrh r0, [r4, 0x34] - ldrh r1, [r4, 0x36] - adds r0, r1 - movs r5, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815F840 - cmp r0, 0x1 - beq _0815F858 - b _0815F896 - .pool -_0815F840: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3C - bne _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0815F896 -_0815F858: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - cmp r0, 0 - ble _0815F896 - strh r5, [r4, 0x32] - ldrh r0, [r4, 0x38] - subs r0, 0x2 - strh r0, [r4, 0x38] - lsls r0, 16 - cmp r0, 0 - bge _0815F896 - ldr r3, =gTasks - movs r2, 0x3C - ldrsh r1, [r4, r2] - lsls r1, 1 - movs r0, 0x3A - ldrsh r2, [r4, r0] - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r3, 0x8 - adds r1, r3 - ldrh r0, [r1] - subs r0, 0x1 - strh r0, [r1] - adds r0, r4, 0 - bl obj_delete_but_dont_free_vram -_0815F896: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F7C4 - - thumb_func_start AnimTask_GetReturnPowerLevel -AnimTask_GetReturnPowerLevel: @ 815F8A0 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r3, =gBattleAnimArgs - movs r2, 0 - strh r2, [r3, 0xE] - ldr r1, =gAnimFriendship - ldrb r0, [r1] - ldrb r1, [r1] - adds r0, r1, 0 - subs r0, 0x3D - lsls r0, 24 - lsrs r0, 24 - adds r2, r1, 0 - cmp r0, 0x1E - bhi _0815F8C4 - movs r0, 0x1 - strh r0, [r3, 0xE] -_0815F8C4: - adds r0, r2, 0 - subs r0, 0x5C - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6C - bhi _0815F8D4 - movs r0, 0x2 - strh r0, [r3, 0xE] -_0815F8D4: - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0xC8 - bls _0815F8E0 - movs r0, 0x3 - strh r0, [r3, 0xE] -_0815F8E0: - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_GetReturnPowerLevel - - thumb_func_start sub_815F8F4 -sub_815F8F4: @ 815F8F4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - cmp r0, 0x4 - bls _0815F91A - b _0815FE68 -_0815F91A: - lsls r0, 2 - ldr r1, =_0815F92C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815F92C: - .4byte _0815F940 - .4byte _0815F9F4 - .4byte _0815FBE8 - .4byte _0815FD08 - .4byte _0815FD8C -_0815F940: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r2, r8 - lsls r4, r2, 2 - adds r0, r4, r2 - lsls r0, 3 - adds r6, r0, r1 - movs r3, 0x80 - lsls r3, 4 - adds r0, r3, 0 - ldrh r1, [r6, 0xA] - adds r0, r1 - strh r0, [r6, 0xA] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815F998 - ldr r2, =gSprites - lsls r3, r7, 4 - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] - b _0815F9B2 - .pool -_0815F998: - ldr r3, =gSprites - lsls r4, r7, 4 - adds r2, r4, r7 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 -_0815F9B2: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0xA] - strh r0, [r4, 0xA] - adds r1, r3, r7 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - movs r1, 0x80 - lsls r1, 14 - adds r0, r1 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815F9DE - b _0815FE68 -_0815F9DE: - movs r0, 0 - strh r0, [r4, 0xA] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0815FE68 - .pool -_0815F9F4: - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0815FA28 - ldr r0, =gContestResources - ldr r0, [r0] - ldr r0, [r0, 0x18] - ldr r2, [r0, 0x8] - mov r10, r2 - ldr r3, [r0, 0xC] - mov r9, r3 - ldrh r6, [r0] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSpriteSubpriority - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - b _0815FB4E - .pool -_0815FA28: - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FAC8 - ldr r7, =gBattlerPartyIndexes - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FA9C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FA9E - .pool -_0815FA9C: - ldrh r6, [r1, 0x2] -_0815FA9E: - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0 - movs r5, 0x88 - lsls r5, 1 - b _0815FB50 - .pool -_0815FAC8: - ldr r7, =gBattlerPartyIndexes - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gEnemyParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r10, r0 - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - mov r9, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldrb r2, [r4] - ldr r1, [r0] - lsls r0, r2, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - bne _0815FB2C - lsls r0, r2, 1 - adds r0, r7 - ldrh r0, [r0] - muls r0, r6 - adds r0, r5 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r6, r0, 16 - b _0815FB2E - .pool -_0815FB2C: - ldrh r6, [r1, 0x2] -_0815FB2E: - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r7, 0x1 -_0815FB4E: - ldr r5, =0x0000ffe0 -_0815FB50: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - lsls r3, r5, 16 - asrs r3, 16 - str r0, [sp] - str r4, [sp, 0x4] - mov r4, r10 - str r4, [sp, 0x8] - mov r0, r9 - str r0, [sp, 0xC] - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - str r0, [sp, 0x10] - movs r0, 0 - str r0, [sp, 0x14] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0 - bl sub_80A8394 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =gBattleSpritesDataPtr - ldr r1, [r0] - ldrb r0, [r4] - ldr r1, [r1] - lsls r0, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0815FBBA - ldr r1, =gSprites - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - orrs r0, r1 - ldr r3, =0x00007fff - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette -_0815FBBA: - ldr r0, =gTasks - mov r3, r8 - lsls r1, r3, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x26] - b _0815FD7E - .pool -_0815FBE8: - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r6, r0, r1 - ldrh r0, [r6, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r2, [r6, 0xA] - adds r0, r2 - strh r0, [r6, 0xA] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FC40 - ldr r3, =gSprites - lsls r4, r5, 4 - adds r2, r4, r5 - lsls r2, 2 - adds r2, r3 - ldrh r1, [r6, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r2, 0x24] - subs r0, r1 - strh r0, [r2, 0x24] - adds r2, r3, 0 - adds r3, r4, 0 - b _0815FC56 - .pool -_0815FC40: - ldr r2, =gSprites - lsls r3, r5, 4 - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r6, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r4, [r1, 0x24] - adds r0, r4 - strh r0, [r1, 0x24] -_0815FC56: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r6, r0, r1 - ldrb r0, [r6, 0xA] - strh r0, [r6, 0xA] - adds r1, r3, r5 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r1, 0x24] - ldrh r1, [r1, 0x20] - adds r0, r1 - lsls r0, 16 - lsrs r5, r0, 16 - movs r1, 0x24 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _0815FCD6 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FCB4 - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bge _0815FCD6 - b _0815FCCA - .pool -_0815FCB4: - lsls r4, r5, 16 - asrs r4, 16 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - ble _0815FCD6 -_0815FCCA: - ldrh r0, [r6, 0x24] - adds r0, 0x1 - strh r0, [r6, 0x24] - ldr r1, =gBattleAnimArgs - ldr r0, =0x0000ffff - strh r0, [r1, 0xE] -_0815FCD6: - lsls r0, r5, 16 - movs r2, 0x80 - lsls r2, 14 - adds r0, r2 - movs r1, 0x98 - lsls r1, 17 - cmp r0, r1 - bhi _0815FCE8 - b _0815FE68 -_0815FCE8: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 - movs r0, 0 - strh r0, [r1, 0xA] - b _0815FD7E - .pool -_0815FD08: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r3, r8 - lsls r4, r3, 2 - adds r0, r4, r3 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 4 - adds r0, r5 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - bl sub_80A8610 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - cmp r0, 0 - bne _0815FD60 - lsls r1, r7, 4 - adds r1, r7 - lsls r1, 2 - adds r1, r5 - ldrh r0, [r1, 0x20] - negs r0, r0 - subs r0, 0x20 - strh r0, [r1, 0x24] - b _0815FD74 - .pool -_0815FD60: - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - adds r0, r5 - ldrh r2, [r0, 0x20] - movs r4, 0x88 - lsls r4, 1 - adds r1, r4, 0 - subs r1, r2 - strh r1, [r0, 0x24] -_0815FD74: - ldr r0, =gTasks - mov r1, r9 - add r1, r8 - lsls r1, 3 - adds r1, r0 -_0815FD7E: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0815FE68 - .pool -_0815FD8C: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gTasks - mov r0, r8 - lsls r4, r0, 2 - adds r0, r4, r0 - lsls r0, 3 - adds r2, r0, r1 - movs r1, 0x80 - lsls r1, 4 - adds r0, r1, 0 - ldrh r3, [r2, 0xA] - adds r0, r3 - strh r0, [r2, 0xA] - ldr r0, =gBattleAnimAttacker - mov r10, r0 - ldrb r0, [r0] - str r2, [sp, 0x18] - bl GetBattlerSide - lsls r0, 24 - mov r9, r4 - ldr r2, [sp, 0x18] - cmp r0, 0 - bne _0815FE0C - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r6, 0x24] - adds r0, r1 - strh r0, [r6, 0x24] - movs r2, 0x24 - ldrsh r4, [r6, r2] - movs r3, 0x20 - ldrsh r0, [r6, r3] - adds r4, r0 - mov r1, r10 - ldrb r0, [r1] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - blt _0815FE44 - movs r2, 0 - strh r2, [r6, 0x24] - b _0815FE44 - .pool -_0815FE0C: - ldr r1, =gSprites - lsls r5, r7, 4 - adds r0, r5, r7 - lsls r0, 2 - adds r6, r0, r1 - ldrh r1, [r2, 0xA] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r6, 0x24] - subs r0, r1 - strh r0, [r6, 0x24] - movs r3, 0x24 - ldrsh r4, [r6, r3] - movs r1, 0x20 - ldrsh r0, [r6, r1] - adds r4, r0 - mov r2, r10 - ldrb r0, [r2] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r3, r5, 0 - cmp r4, r0 - bgt _0815FE44 - movs r4, 0 - strh r4, [r6, 0x24] -_0815FE44: - ldr r1, =gTasks - mov r0, r9 - add r0, r8 - lsls r0, 3 - adds r0, r1 - ldrb r1, [r0, 0xA] - strh r1, [r0, 0xA] - ldr r1, =gSprites - adds r0, r3, r7 - lsls r0, 2 - adds r0, r1 - movs r1, 0x24 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0815FE68 - mov r0, r8 - bl DestroyAnimVisualTask -_0815FE68: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815F8F4 - - thumb_func_start sub_815FE80 -sub_815FE80: @ 815FE80 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0815FE92 - cmp r0, 0x1 - beq _0815FF3A - b _0815FFBC -_0815FE92: - ldr r0, =gBattleAnimArgs - movs r2, 0xE - ldrsh r1, [r0, r2] - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - bne _0815FF2C - movs r0, 0x3F - bl BattleAnimAdjustPanning - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 24 - movs r0, 0x7A - bl PlaySE12WithPanning - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x10 - strh r0, [r4, 0x22] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x3C] - adds r0, 0x1 - strh r0, [r4, 0x3C] - adds r2, r4, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0815FFBC - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0815FFBC - movs r0, 0x1 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0x1 - adds r1, r4, 0 - adds r1, 0x43 - strb r0, [r1] - b _0815FFBC - .pool -_0815FF2C: - adds r0, r4, 0 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - b _0815FFBC -_0815FF3A: - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r2, 0x2E - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r2, [r4, 0x30] - adds r0, r2, 0x5 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0815FF6E - movs r1, 0x2E - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - adds r0, r2, 0 - subs r0, 0x7A - strh r0, [r4, 0x30] -_0815FF6E: - movs r2, 0x80 - lsls r2, 1 - adds r0, r2, 0 - ldrh r1, [r4, 0x32] - adds r0, r1 - strh r0, [r4, 0x32] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0815FF9C - ldrh r2, [r4, 0x32] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 - strh r0, [r4, 0x24] - adds r1, r2, 0 - b _0815FFA8 - .pool -_0815FF9C: - ldrh r1, [r4, 0x32] - lsls r0, r1, 16 - asrs r0, 24 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] -_0815FFA8: - movs r0, 0xFF - ands r0, r1 - strh r0, [r4, 0x32] - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, 0x2 - bne _0815FFBC - adds r0, r4, 0 - bl DestroyAnimSprite -_0815FFBC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_815FE80 - - thumb_func_start sub_815FFC4 -sub_815FFC4: @ 815FFC4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x26 - ldrsh r0, [r0, r2] - adds r3, r1, 0 - cmp r0, 0x4 - bls _0815FFE0 - b _08160132 -_0815FFE0: - lsls r0, 2 - ldr r1, =_0815FFF4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0815FFF4: - .4byte _08160008 - .4byte _08160058 - .4byte _081600B4 - .4byte _081600CC - .4byte _08160132 -_08160008: - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r1, r0, r1 - movs r0, 0x6 - strh r0, [r1, 0x8] - cmp r5, r2 - ble _0816003E - negs r0, r0 - strh r0, [r1, 0x8] -_0816003E: - strh r5, [r1, 0xA] - strh r2, [r1, 0xC] - ldrh r0, [r1, 0x26] - adds r0, 0x1 - strh r0, [r1, 0x26] - b _08160150 - .pool -_08160058: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _081600A0 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - b _08160126 - .pool -_081600A0: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xC - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A -_081600B4: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r3 - movs r2, 0x8 - ldrsh r1, [r0, r2] - negs r1, r1 - strh r1, [r0, 0x8] - ldrh r1, [r0, 0x26] - adds r1, 0x1 - strh r1, [r0, 0x26] - b _08160150 -_081600CC: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r1, r0, r1 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r2, r0, r3 - ldrh r0, [r2, 0x8] - ldrh r3, [r1, 0x24] - adds r0, r3 - strh r0, [r1, 0x24] - movs r3, 0x8 - ldrsh r0, [r2, r3] - cmp r0, 0 - bge _08160118 - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] - cmp r0, r1 - bgt _08160150 - b _0816012A - .pool -_08160118: - movs r3, 0x20 - ldrsh r0, [r1, r3] - movs r3, 0x24 - ldrsh r1, [r1, r3] - adds r0, r1 - movs r3, 0xA - ldrsh r1, [r2, r3] -_08160126: - cmp r0, r1 - blt _08160150 -_0816012A: - ldrh r0, [r2, 0x26] - adds r0, 0x1 - strh r0, [r2, 0x26] - b _08160150 -_08160132: - ldr r1, =gBattlerSpriteIds - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0x24] - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08160150: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_815FFC4 - - thumb_func_start sub_8160164 -sub_8160164: @ 8160164 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r4, r1, r0 - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - strh r0, [r4, 0xE] - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - movs r2, 0x1 - negs r2, r2 - adds r1, r2, 0 - cmp r0, 0 - bne _08160198 - movs r1, 0x1 -_08160198: - strh r1, [r4, 0x10] - ldr r2, =gSprites - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x22] - strh r0, [r4, 0x14] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x20] - strh r0, [r4, 0x12] - strh r5, [r4, 0x1A] - strh r5, [r4, 0x1E] - movs r0, 0x1 - strh r0, [r4, 0x1C] - strh r5, [r4, 0x20] - ldr r0, =sub_81601DC - str r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160164 - - thumb_func_start sub_81601DC -sub_81601DC: @ 81601DC - push {r4-r6,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _08160284 - cmp r0, 0x1 - bgt _08160204 - cmp r0, 0 - beq _0816020A - b _081602DA - .pool -_08160204: - cmp r0, 0x2 - beq _081602D4 - b _081602DA -_0816020A: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r2, 0xFF - ands r0, r2 - strh r0, [r4, 0x1E] - ldr r5, =gSprites - movs r6, 0xE - ldrsh r0, [r4, r6] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - ldr r3, =gSineTable - movs r6, 0x1E - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - ldrh r0, [r4, 0x1A] - adds r0, 0x2 - ands r0, r2 - strh r0, [r4, 0x1A] - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r5 - movs r6, 0x1A - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 19 - ldrh r1, [r4, 0x10] - muls r0, r1 - ldrh r1, [r4, 0x12] - adds r0, r1 - strh r0, [r2, 0x20] - movs r6, 0x1A - ldrsh r0, [r4, r6] - cmp r0, 0 - bne _081602DA - movs r0, 0xE - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldrh r1, [r4, 0x12] - strh r1, [r0, 0x20] - b _081602C4 - .pool -_08160284: - ldrh r0, [r4, 0x1E] - adds r0, 0x8 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x1E] - ldr r3, =gSprites - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldr r2, =gSineTable - movs r5, 0x1E - ldrsh r0, [r4, r5] - lsls r0, 1 - adds r0, r2 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 - strh r0, [r1, 0x24] - movs r6, 0x1E - ldrsh r2, [r4, r6] - cmp r2, 0 - bne _081602DA - movs r1, 0xE - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - strh r2, [r1, 0x24] -_081602C4: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _081602DA - .pool -_081602D4: - adds r0, r2, 0 - bl DestroyAnimVisualTask -_081602DA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81601DC - - thumb_func_start sub_81602E0 -sub_81602E0: @ 81602E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - ldrh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x30] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x30 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl Sin - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08160326 - adds r0, r4, 0 - bl DestroyAnimSprite -_08160326: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81602E0 - - thumb_func_start sub_8160338 -sub_8160338: @ 8160338 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0816037C - ldr r2, =gBattleAnimArgs - ldrh r0, [r4, 0x20] - ldrh r1, [r2] - subs r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r2, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] - ldr r0, =0x0000fff5 - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _08160396 - .pool -_0816037C: - movs r0, 0xB - strh r0, [r4, 0x2E] - movs r0, 0xC0 - strh r0, [r4, 0x30] - ldr r1, =gBattleAnimArgs - ldrh r0, [r1] - ldrh r2, [r4, 0x20] - adds r0, r2 - strh r0, [r4, 0x20] - ldrh r0, [r1, 0x2] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_08160396: - ldr r0, =sub_81602E0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160338 - - thumb_func_start sub_81603A8 -sub_81603A8: @ 81603A8 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimAttacker - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x2 - bl sub_80A861C - strh r0, [r5, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - bgt _081603D2 - movs r0, 0x10 - strh r0, [r5, 0x22] -_081603D2: - movs r0, 0 - strh r0, [r5, 0x3A] - movs r1, 0x10 - strh r1, [r5, 0x3C] - ldr r0, =sub_81603F4 - str r0, [r5, 0x1C] - lsls r1, 8 - movs r0, 0x52 - bl SetGpuReg - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81603A8 - - thumb_func_start sub_81603F4 -sub_81603F4: @ 81603F4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0816046C - cmp r1, 0x1 - bgt _0816040A - cmp r1, 0 - beq _08160414 - b _081604E8 -_0816040A: - cmp r1, 0x2 - beq _08160482 - cmp r1, 0x3 - beq _081604E2 - b _081604E8 -_08160414: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - strh r1, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0816043E - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _0816044C - adds r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0816044C -_0816043E: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0816044C - subs r0, r2, 0x1 - strh r0, [r4, 0x3C] -_0816044C: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081604E8 - b _081604DA -_0816046C: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _081604E8 - strh r1, [r4, 0x2E] - strh r1, [r4, 0x30] - b _081604DA -_08160482: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _081604E8 - movs r0, 0 - strh r0, [r4, 0x2E] - ldrh r1, [r4, 0x30] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081604AE - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _081604BC - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _081604BC -_081604AE: - ldrh r2, [r4, 0x3C] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r0, 0xF - bgt _081604BC - adds r0, r2, 0x1 - strh r0, [r4, 0x3C] -_081604BC: - adds r0, r1, 0x1 - strh r0, [r4, 0x30] - ldrh r1, [r4, 0x3C] - lsls r1, 8 - ldrh r0, [r4, 0x3A] - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0x10 - bne _081604E8 -_081604DA: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - b _081604E8 -_081604E2: - adds r0, r4, 0 - bl DestroySpriteAndMatrix -_081604E8: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81603F4 - - thumb_func_start AnimTask_GetWeather -AnimTask_GetWeather: @ 81604F0 - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gBattleAnimArgs - movs r0, 0 - strh r0, [r2, 0xE] - ldr r0, =gWeatherMoveAnim - ldrh r1, [r0] - movs r0, 0x60 - ands r0, r1 - cmp r0, 0 - beq _08160514 - movs r0, 0x1 - b _08160536 - .pool -_08160514: - movs r0, 0x7 - ands r0, r1 - cmp r0, 0 - beq _08160520 - movs r0, 0x2 - b _08160536 -_08160520: - movs r0, 0x18 - ands r0, r1 - cmp r0, 0 - beq _0816052C - movs r0, 0x3 - b _08160536 -_0816052C: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08160538 - movs r0, 0x4 -_08160536: - strh r0, [r2, 0xE] -_08160538: - adds r0, r3, 0 - bl DestroyAnimVisualTask - pop {r0} - bx r0 - thumb_func_end AnimTask_GetWeather - - thumb_func_start sub_8160544 -sub_8160544: @ 8160544 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - movs r0, 0 - strh r0, [r4, 0x8] - ldr r0, =gBattleAnimArgs - ldrb r0, [r0] - bl GetAnimBattlerSpriteId - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - strh r1, [r4, 0x26] - ldr r2, =gUnknown_085CE9C8 - adds r0, r4, 0 - bl PrepareAffineAnimInTaskData - ldr r0, =sub_816058C - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8160544 - - thumb_func_start sub_816058C -sub_816058C: @ 816058C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r2, =gTasks - adds r3, r0, r2 - ldrh r0, [r3, 0x8] - adds r1, r0, 0x1 - movs r5, 0 - strh r1, [r3, 0x8] - subs r0, 0x10 - lsls r0, 16 - lsrs r0, 16 - adds r6, r2, 0 - cmp r0, 0x16 - bhi _081605F0 - ldrh r0, [r3, 0xA] - adds r0, 0x1 - strh r0, [r3, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2 - ble _08160600 - strh r5, [r3, 0xA] - ldrh r0, [r3, 0xC] - adds r0, 0x1 - strh r0, [r3, 0xC] - movs r5, 0x1 - ands r0, r5 - cmp r0, 0 - bne _081605F0 - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =0x0000ffff - strh r1, [r0, 0x24] - b _08160600 - .pool -_081605F0: - ldr r2, =gSprites - movs r0, 0x26 - ldrsh r1, [r3, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - strh r5, [r0, 0x24] -_08160600: - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r6 - bl RunAffineAnimFromTaskData - lsls r0, 24 - cmp r0, 0 - bne _08160618 - adds r0, r4, 0 - bl DestroyAnimVisualTask -_08160618: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_816058C - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_effects_3.s b/asm/battle_anim_effects_3.s new file mode 100644 index 000000000..4b9466786 --- /dev/null +++ b/asm/battle_anim_effects_3.s @@ -0,0 +1,1632 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + + thumb_func_start AnimTask_GetReturnPowerLevel +AnimTask_GetReturnPowerLevel: @ 815F8A0 + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, =gBattleAnimArgs + movs r2, 0 + strh r2, [r3, 0xE] + ldr r1, =gAnimFriendship + ldrb r0, [r1] + ldrb r1, [r1] + adds r0, r1, 0 + subs r0, 0x3D + lsls r0, 24 + lsrs r0, 24 + adds r2, r1, 0 + cmp r0, 0x1E + bhi _0815F8C4 + movs r0, 0x1 + strh r0, [r3, 0xE] +_0815F8C4: + adds r0, r2, 0 + subs r0, 0x5C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6C + bhi _0815F8D4 + movs r0, 0x2 + strh r0, [r3, 0xE] +_0815F8D4: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xC8 + bls _0815F8E0 + movs r0, 0x3 + strh r0, [r3, 0xE] +_0815F8E0: + adds r0, r4, 0 + bl DestroyAnimVisualTask + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end AnimTask_GetReturnPowerLevel + + thumb_func_start sub_815F8F4 +sub_815F8F4: @ 815F8F4 + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, =gTasks + lsls r0, 2 + add r0, r8 + lsls r0, 3 + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, 0x4 + bls _0815F91A + b _0815FE68 +_0815F91A: + lsls r0, 2 + ldr r1, =_0815F92C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815F92C: + .4byte _0815F940 + .4byte _0815F9F4 + .4byte _0815FBE8 + .4byte _0815FD08 + .4byte _0815FD8C +_0815F940: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r2, r8 + lsls r4, r2, 2 + adds r0, r4, r2 + lsls r0, 3 + adds r6, r0, r1 + movs r3, 0x80 + lsls r3, 4 + adds r0, r3, 0 + ldrh r1, [r6, 0xA] + adds r0, r1 + strh r0, [r6, 0xA] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815F998 + ldr r2, =gSprites + lsls r3, r7, 4 + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] + b _0815F9B2 + .pool +_0815F998: + ldr r3, =gSprites + lsls r4, r7, 4 + adds r2, r4, r7 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 +_0815F9B2: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + strh r0, [r4, 0xA] + adds r1, r3, r7 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + movs r1, 0x80 + lsls r1, 14 + adds r0, r1 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815F9DE + b _0815FE68 +_0815F9DE: + movs r0, 0 + strh r0, [r4, 0xA] + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _0815FE68 + .pool +_0815F9F4: + bl IsContest + lsls r0, 24 + cmp r0, 0 + beq _0815FA28 + ldr r0, =gContestResources + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldr r2, [r0, 0x8] + mov r10, r2 + ldr r3, [r0, 0xC] + mov r9, r3 + ldrh r6, [r0] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSpriteSubpriority + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + b _0815FB4E + .pool +_0815FA28: + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FAC8 + ldr r7, =gBattlerPartyIndexes + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gPlayerParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gBattleSpritesDataPtr + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FA9C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FA9E + .pool +_0815FA9C: + ldrh r6, [r1, 0x2] +_0815FA9E: + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + adds r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0 + movs r5, 0x88 + lsls r5, 1 + b _0815FB50 + .pool +_0815FAC8: + ldr r7, =gBattlerPartyIndexes + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + movs r6, 0x64 + muls r0, r6 + ldr r5, =gEnemyParty + adds r0, r5 + movs r1, 0 + bl GetMonData + mov r10, r0 + ldrb r0, [r4] + lsls r0, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0x1 + bl GetMonData + mov r9, r0 + ldr r0, =gBattleSpritesDataPtr + ldr r0, [r0] + ldrb r2, [r4] + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, r0, r1 + ldrh r0, [r1, 0x2] + cmp r0, 0 + bne _0815FB2C + lsls r0, r2, 1 + adds r0, r7 + ldrh r0, [r0] + muls r0, r6 + adds r0, r5 + movs r1, 0xB + bl GetMonData + lsls r0, 16 + lsrs r6, r0, 16 + b _0815FB2E + .pool +_0815FB2C: + ldrh r6, [r1, 0x2] +_0815FB2E: + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + movs r7, 0x1 +_0815FB4E: + ldr r5, =0x0000ffe0 +_0815FB50: + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0x1 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + lsls r3, r5, 16 + asrs r3, 16 + str r0, [sp] + str r4, [sp, 0x4] + mov r4, r10 + str r4, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + str r0, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80A8394 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, =gBattleSpritesDataPtr + ldr r1, [r0] + ldrb r0, [r4] + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldrh r0, [r0, 0x2] + cmp r0, 0 + beq _0815FBBA + ldr r1, =gSprites + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + ldrb r0, [r0, 0x5] + lsrs r0, 4 + lsls r0, 4 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + orrs r0, r1 + ldr r3, =0x00007fff + movs r1, 0x10 + movs r2, 0x6 + bl BlendPalette +_0815FBBA: + ldr r0, =gTasks + mov r3, r8 + lsls r1, r3, 2 + add r1, r8 + lsls r1, 3 + adds r1, r0 + strh r5, [r1, 0x26] + b _0815FD7E + .pool +_0815FBE8: + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r6, r0, r1 + ldrh r0, [r6, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r6, 0xA] + adds r0, r2 + strh r0, [r6, 0xA] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FC40 + ldr r3, =gSprites + lsls r4, r5, 4 + adds r2, r4, r5 + lsls r2, 2 + adds r2, r3 + ldrh r1, [r6, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r2, 0x24] + subs r0, r1 + strh r0, [r2, 0x24] + adds r2, r3, 0 + adds r3, r4, 0 + b _0815FC56 + .pool +_0815FC40: + ldr r2, =gSprites + lsls r3, r5, 4 + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r6, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r4, [r1, 0x24] + adds r0, r4 + strh r0, [r1, 0x24] +_0815FC56: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r6, r0, r1 + ldrb r0, [r6, 0xA] + strh r0, [r6, 0xA] + adds r1, r3, r5 + lsls r1, 2 + adds r1, r2 + ldrh r0, [r1, 0x24] + ldrh r1, [r1, 0x20] + adds r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + movs r1, 0x24 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0815FCD6 + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FCB4 + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + bge _0815FCD6 + b _0815FCCA + .pool +_0815FCB4: + lsls r4, r5, 16 + asrs r4, 16 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + ble _0815FCD6 +_0815FCCA: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + ldr r1, =gBattleAnimArgs + ldr r0, =0x0000ffff + strh r0, [r1, 0xE] +_0815FCD6: + lsls r0, r5, 16 + movs r2, 0x80 + lsls r2, 14 + adds r0, r2 + movs r1, 0x98 + lsls r1, 17 + cmp r0, r1 + bhi _0815FCE8 + b _0815FE68 +_0815FCE8: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 + movs r0, 0 + strh r0, [r1, 0xA] + b _0815FD7E + .pool +_0815FD08: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r3, r8 + lsls r4, r3, 2 + adds r0, r4, r3 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x26] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r0, r5, 4 + adds r0, r5 + lsls r0, 2 + ldr r5, =gSprites + adds r0, r5 + bl sub_80A8610 + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0815FD60 + lsls r1, r7, 4 + adds r1, r7 + lsls r1, 2 + adds r1, r5 + ldrh r0, [r1, 0x20] + negs r0, r0 + subs r0, 0x20 + strh r0, [r1, 0x24] + b _0815FD74 + .pool +_0815FD60: + lsls r0, r7, 4 + adds r0, r7 + lsls r0, 2 + adds r0, r5 + ldrh r2, [r0, 0x20] + movs r4, 0x88 + lsls r4, 1 + adds r1, r4, 0 + subs r1, r2 + strh r1, [r0, 0x24] +_0815FD74: + ldr r0, =gTasks + mov r1, r9 + add r1, r8 + lsls r1, 3 + adds r1, r0 +_0815FD7E: + ldrh r0, [r1, 0x8] + adds r0, 0x1 + strh r0, [r1, 0x8] + b _0815FE68 + .pool +_0815FD8C: + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, =gTasks + mov r0, r8 + lsls r4, r0, 2 + adds r0, r4, r0 + lsls r0, 3 + adds r2, r0, r1 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r3, [r2, 0xA] + adds r0, r3 + strh r0, [r2, 0xA] + ldr r0, =gBattleAnimAttacker + mov r10, r0 + ldrb r0, [r0] + str r2, [sp, 0x18] + bl GetBattlerSide + lsls r0, 24 + mov r9, r4 + ldr r2, [sp, 0x18] + cmp r0, 0 + bne _0815FE0C + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 24 + ldrh r1, [r6, 0x24] + adds r0, r1 + strh r0, [r6, 0x24] + movs r2, 0x24 + ldrsh r4, [r6, r2] + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r4, r0 + mov r1, r10 + ldrb r0, [r1] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + blt _0815FE44 + movs r2, 0 + strh r2, [r6, 0x24] + b _0815FE44 + .pool +_0815FE0C: + ldr r1, =gSprites + lsls r5, r7, 4 + adds r0, r5, r7 + lsls r0, 2 + adds r6, r0, r1 + ldrh r1, [r2, 0xA] + lsls r1, 16 + asrs r1, 24 + ldrh r0, [r6, 0x24] + subs r0, r1 + strh r0, [r6, 0x24] + movs r3, 0x24 + ldrsh r4, [r6, r3] + movs r1, 0x20 + ldrsh r0, [r6, r1] + adds r4, r0 + mov r2, r10 + ldrb r0, [r2] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r3, r5, 0 + cmp r4, r0 + bgt _0815FE44 + movs r4, 0 + strh r4, [r6, 0x24] +_0815FE44: + ldr r1, =gTasks + mov r0, r9 + add r0, r8 + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0, 0xA] + strh r1, [r0, 0xA] + ldr r1, =gSprites + adds r0, r3, r7 + lsls r0, 2 + adds r0, r1 + movs r1, 0x24 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _0815FE68 + mov r0, r8 + bl DestroyAnimVisualTask +_0815FE68: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815F8F4 + + thumb_func_start sub_815FE80 +sub_815FE80: @ 815FE80 + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0815FE92 + cmp r0, 0x1 + beq _0815FF3A + b _0815FFBC +_0815FE92: + ldr r0, =gBattleAnimArgs + movs r2, 0xE + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0815FF2C + movs r0, 0x3F + bl BattleAnimAdjustPanning + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x7A + bl PlaySE12WithPanning + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0x1 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r0, 0x10 + strh r0, [r4, 0x22] + ldr r0, =0x0000ffe0 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x3C] + adds r0, 0x1 + strh r0, [r4, 0x3C] + adds r2, r4, 0 + adds r2, 0x3E + ldrb r1, [r2] + movs r0, 0x5 + negs r0, r0 + ands r0, r1 + strb r0, [r2] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0815FFBC + bl IsContest + lsls r0, 24 + cmp r0, 0 + bne _0815FFBC + movs r0, 0x1 + bl GetAnimBattlerSpriteId + ldr r2, =gSprites + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + adds r1, 0x43 + ldrb r0, [r1] + subs r0, 0x1 + adds r1, r4, 0 + adds r1, 0x43 + strb r0, [r1] + b _0815FFBC + .pool +_0815FF2C: + adds r0, r4, 0 + adds r0, 0x3E + ldrb r1, [r0] + movs r2, 0x4 + orrs r1, r2 + strb r1, [r0] + b _0815FFBC +_0815FF3A: + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r2, 0x2E + ldrsh r1, [r4, r2] + bl Sin + strh r0, [r4, 0x26] + ldrh r2, [r4, 0x30] + adds r0, r2, 0x5 + strh r0, [r4, 0x30] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7F + ble _0815FF6E + movs r1, 0x2E + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0x2E] + ldrh r0, [r4, 0x34] + adds r0, 0x1 + strh r0, [r4, 0x34] + adds r0, r2, 0 + subs r0, 0x7A + strh r0, [r4, 0x30] +_0815FF6E: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ldrh r1, [r4, 0x32] + adds r0, r1 + strh r0, [r4, 0x32] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0815FF9C + ldrh r2, [r4, 0x32] + lsls r1, r2, 16 + asrs r1, 24 + ldrh r0, [r4, 0x24] + subs r0, r1 + strh r0, [r4, 0x24] + adds r1, r2, 0 + b _0815FFA8 + .pool +_0815FF9C: + ldrh r1, [r4, 0x32] + lsls r0, r1, 16 + asrs r0, 24 + ldrh r2, [r4, 0x24] + adds r0, r2 + strh r0, [r4, 0x24] +_0815FFA8: + movs r0, 0xFF + ands r0, r1 + strh r0, [r4, 0x32] + movs r1, 0x34 + ldrsh r0, [r4, r1] + cmp r0, 0x2 + bne _0815FFBC + adds r0, r4, 0 + bl DestroyAnimSprite +_0815FFBC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_815FE80 + + thumb_func_start sub_815FFC4 +sub_815FFC4: @ 815FFC4 + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r1 + movs r2, 0x26 + ldrsh r0, [r0, r2] + adds r3, r1, 0 + cmp r0, 0x4 + bls _0815FFE0 + b _08160132 +_0815FFE0: + lsls r0, 2 + ldr r1, =_0815FFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_0815FFF4: + .4byte _08160008 + .4byte _08160058 + .4byte _081600B4 + .4byte _081600CC + .4byte _08160132 +_08160008: + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + movs r1, 0 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + ldr r1, =gTasks + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r1, r0, r1 + movs r0, 0x6 + strh r0, [r1, 0x8] + cmp r5, r2 + ble _0816003E + negs r0, r0 + strh r0, [r1, 0x8] +_0816003E: + strh r5, [r1, 0xA] + strh r2, [r1, 0xC] + ldrh r0, [r1, 0x26] + adds r0, 0x1 + strh r0, [r1, 0x26] + b _08160150 + .pool +_08160058: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _081600A0 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + b _08160126 + .pool +_081600A0: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A +_081600B4: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r3 + movs r2, 0x8 + ldrsh r1, [r0, r2] + negs r1, r1 + strh r1, [r0, 0x8] + ldrh r1, [r0, 0x26] + adds r1, 0x1 + strh r1, [r0, 0x26] + b _08160150 +_081600CC: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r1, r0, r1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r2, r0, r3 + ldrh r0, [r2, 0x8] + ldrh r3, [r1, 0x24] + adds r0, r3 + strh r0, [r1, 0x24] + movs r3, 0x8 + ldrsh r0, [r2, r3] + cmp r0, 0 + bge _08160118 + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] + cmp r0, r1 + bgt _08160150 + b _0816012A + .pool +_08160118: + movs r3, 0x20 + ldrsh r0, [r1, r3] + movs r3, 0x24 + ldrsh r1, [r1, r3] + adds r0, r1 + movs r3, 0xA + ldrsh r1, [r2, r3] +_08160126: + cmp r0, r1 + blt _08160150 +_0816012A: + ldrh r0, [r2, 0x26] + adds r0, 0x1 + strh r0, [r2, 0x26] + b _08160150 +_08160132: + ldr r1, =gBattlerSpriteIds + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + adds r0, r1 + ldrb r2, [r0] + ldr r1, =gSprites + lsls r0, r2, 4 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + strh r1, [r0, 0x24] + adds r0, r4, 0 + bl DestroyAnimVisualTask +_08160150: + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_815FFC4 + + thumb_func_start sub_8160164 +sub_8160164: @ 8160164 + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + ldr r0, =gTasks + adds r4, r1, r0 + movs r0, 0 + bl GetAnimBattlerSpriteId + lsls r0, 24 + lsrs r0, 24 + movs r5, 0 + strh r0, [r4, 0xE] + ldr r0, =gBattleAnimAttacker + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + cmp r0, 0 + bne _08160198 + movs r1, 0x1 +_08160198: + strh r1, [r4, 0x10] + ldr r2, =gSprites + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x22] + strh r0, [r4, 0x14] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrh r0, [r0, 0x20] + strh r0, [r4, 0x12] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1E] + movs r0, 0x1 + strh r0, [r4, 0x1C] + strh r5, [r4, 0x20] + ldr r0, =sub_81601DC + str r0, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160164 + + thumb_func_start sub_81601DC +sub_81601DC: @ 81601DC + push {r4-r6,lr} + lsls r0, 24 + lsrs r2, r0, 24 + lsls r0, r2, 2 + adds r0, r2 + lsls r0, 3 + ldr r1, =gTasks + adds r4, r0, r1 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _08160284 + cmp r0, 0x1 + bgt _08160204 + cmp r0, 0 + beq _0816020A + b _081602DA + .pool +_08160204: + cmp r0, 0x2 + beq _081602D4 + b _081602DA +_0816020A: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r2, 0xFF + ands r0, r2 + strh r0, [r4, 0x1E] + ldr r5, =gSprites + movs r6, 0xE + ldrsh r0, [r4, r6] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r5 + ldr r3, =gSineTable + movs r6, 0x1E + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + ldrh r0, [r4, 0x1A] + adds r0, 0x2 + ands r0, r2 + strh r0, [r4, 0x1A] + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r2, r0, 4 + adds r2, r0 + lsls r2, 2 + adds r2, r5 + movs r6, 0x1A + ldrsh r0, [r4, r6] + lsls r0, 1 + adds r0, r3 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + ldrh r1, [r4, 0x10] + muls r0, r1 + ldrh r1, [r4, 0x12] + adds r0, r1 + strh r0, [r2, 0x20] + movs r6, 0x1A + ldrsh r0, [r4, r6] + cmp r0, 0 + bne _081602DA + movs r0, 0xE + ldrsh r1, [r4, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r1, [r4, 0x12] + strh r1, [r0, 0x20] + b _081602C4 + .pool +_08160284: + ldrh r0, [r4, 0x1E] + adds r0, 0x8 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x1E] + ldr r3, =gSprites + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + ldr r2, =gSineTable + movs r5, 0x1E + ldrsh r0, [r4, r5] + lsls r0, 1 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 21 + strh r0, [r1, 0x24] + movs r6, 0x1E + ldrsh r2, [r4, r6] + cmp r2, 0 + bne _081602DA + movs r1, 0xE + ldrsh r0, [r4, r1] + lsls r1, r0, 4 + adds r1, r0 + lsls r1, 2 + adds r1, r3 + strh r2, [r1, 0x24] +_081602C4: + ldrh r0, [r4, 0x8] + adds r0, 0x1 + strh r0, [r4, 0x8] + b _081602DA + .pool +_081602D4: + adds r0, r2, 0 + bl DestroyAnimVisualTask +_081602DA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_81601DC + + thumb_func_start sub_81602E0 +sub_81602E0: @ 81602E0 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + ldrh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + adds r0, r1 + movs r1, 0xFF + ands r0, r1 + strh r0, [r4, 0x30] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Cos + strh r0, [r4, 0x24] + movs r1, 0x30 + ldrsh r0, [r4, r1] + movs r1, 0x14 + bl Sin + strh r0, [r4, 0x26] + adds r0, r4, 0 + adds r0, 0x3F + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08160326 + adds r0, r4, 0 + bl DestroyAnimSprite +_08160326: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81602E0 + + thumb_func_start sub_8160338 +sub_8160338: @ 8160338 + push {r4,lr} + adds r4, r0, 0 + ldr r0, =gBattleAnimTarget + ldrb r0, [r0] + bl GetBattlerSide + lsls r0, 24 + cmp r0, 0 + bne _0816037C + ldr r2, =gBattleAnimArgs + ldrh r0, [r4, 0x20] + ldrh r1, [r2] + subs r0, r1 + strh r0, [r4, 0x20] + ldrh r0, [r2, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] + ldr r0, =0x0000fff5 + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + adds r0, r4, 0 + movs r1, 0x1 + bl StartSpriteAffineAnim + b _08160396 + .pool +_0816037C: + movs r0, 0xB + strh r0, [r4, 0x2E] + movs r0, 0xC0 + strh r0, [r4, 0x30] + ldr r1, =gBattleAnimArgs + ldrh r0, [r1] + ldrh r2, [r4, 0x20] + adds r0, r2 + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x2] + ldrh r1, [r4, 0x22] + adds r0, r1 + strh r0, [r4, 0x22] +_08160396: + ldr r0, =sub_81602E0 + str r0, [r4, 0x1C] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160338 + + thumb_func_start sub_81603A8 +sub_81603A8: @ 81603A8 + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, =gBattleAnimAttacker + ldrb r0, [r4] + movs r1, 0x2 + bl GetBattlerSpriteCoord + lsls r0, 24 + lsrs r0, 24 + strh r0, [r5, 0x20] + ldrb r0, [r4] + movs r1, 0x2 + bl sub_80A861C + strh r0, [r5, 0x22] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xF + bgt _081603D2 + movs r0, 0x10 + strh r0, [r5, 0x22] +_081603D2: + movs r0, 0 + strh r0, [r5, 0x3A] + movs r1, 0x10 + strh r1, [r5, 0x3C] + ldr r0, =sub_81603F4 + str r0, [r5, 0x1C] + lsls r1, 8 + movs r0, 0x52 + bl SetGpuReg + pop {r4,r5} + pop {r0} + bx r0 + .pool + thumb_func_end sub_81603A8 + + thumb_func_start sub_81603F4 +sub_81603F4: @ 81603F4 + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x32 + ldrsh r1, [r4, r0] + cmp r1, 0x1 + beq _0816046C + cmp r1, 0x1 + bgt _0816040A + cmp r1, 0 + beq _08160414 + b _081604E8 +_0816040A: + cmp r1, 0x2 + beq _08160482 + cmp r1, 0x3 + beq _081604E2 + b _081604E8 +_08160414: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + strh r1, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0816043E + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _0816044C + adds r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _0816044C +_0816043E: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0816044C + subs r0, r2, 0x1 + strh r0, [r4, 0x3C] +_0816044C: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _081604E8 + b _081604DA +_0816046C: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _081604E8 + strh r1, [r4, 0x2E] + strh r1, [r4, 0x30] + b _081604DA +_08160482: + ldrh r0, [r4, 0x2E] + adds r0, 0x1 + strh r0, [r4, 0x2E] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _081604E8 + movs r0, 0 + strh r0, [r4, 0x2E] + ldrh r1, [r4, 0x30] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _081604AE + ldrh r2, [r4, 0x3A] + movs r3, 0x3A + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _081604BC + subs r0, r2, 0x1 + strh r0, [r4, 0x3A] + b _081604BC +_081604AE: + ldrh r2, [r4, 0x3C] + movs r3, 0x3C + ldrsh r0, [r4, r3] + cmp r0, 0xF + bgt _081604BC + adds r0, r2, 0x1 + strh r0, [r4, 0x3C] +_081604BC: + adds r0, r1, 0x1 + strh r0, [r4, 0x30] + ldrh r1, [r4, 0x3C] + lsls r1, 8 + ldrh r0, [r4, 0x3A] + orrs r1, r0 + lsls r1, 16 + lsrs r1, 16 + movs r0, 0x52 + bl SetGpuReg + movs r1, 0x3C + ldrsh r0, [r4, r1] + cmp r0, 0x10 + bne _081604E8 +_081604DA: + ldrh r0, [r4, 0x32] + adds r0, 0x1 + strh r0, [r4, 0x32] + b _081604E8 +_081604E2: + adds r0, r4, 0 + bl DestroySpriteAndMatrix +_081604E8: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_81603F4 + + thumb_func_start AnimTask_GetWeather +AnimTask_GetWeather: @ 81604F0 + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r2, =gBattleAnimArgs + movs r0, 0 + strh r0, [r2, 0xE] + ldr r0, =gWeatherMoveAnim + ldrh r1, [r0] + movs r0, 0x60 + ands r0, r1 + cmp r0, 0 + beq _08160514 + movs r0, 0x1 + b _08160536 + .pool +_08160514: + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08160520 + movs r0, 0x2 + b _08160536 +_08160520: + movs r0, 0x18 + ands r0, r1 + cmp r0, 0 + beq _0816052C + movs r0, 0x3 + b _08160536 +_0816052C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08160538 + movs r0, 0x4 +_08160536: + strh r0, [r2, 0xE] +_08160538: + adds r0, r3, 0 + bl DestroyAnimVisualTask + pop {r0} + bx r0 + thumb_func_end AnimTask_GetWeather + + thumb_func_start sub_8160544 +sub_8160544: @ 8160544 + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 3 + ldr r0, =gTasks + adds r4, r0 + movs r0, 0 + strh r0, [r4, 0x8] + ldr r0, =gBattleAnimArgs + ldrb r0, [r0] + bl GetAnimBattlerSpriteId + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + strh r1, [r4, 0x26] + ldr r2, =gUnknown_085CE9C8 + adds r0, r4, 0 + bl PrepareAffineAnimInTaskData + ldr r0, =sub_816058C + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .pool + thumb_func_end sub_8160544 + + thumb_func_start sub_816058C +sub_816058C: @ 816058C + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r2, =gTasks + adds r3, r0, r2 + ldrh r0, [r3, 0x8] + adds r1, r0, 0x1 + movs r5, 0 + strh r1, [r3, 0x8] + subs r0, 0x10 + lsls r0, 16 + lsrs r0, 16 + adds r6, r2, 0 + cmp r0, 0x16 + bhi _081605F0 + ldrh r0, [r3, 0xA] + adds r0, 0x1 + strh r0, [r3, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + ble _08160600 + strh r5, [r3, 0xA] + ldrh r0, [r3, 0xC] + adds r0, 0x1 + strh r0, [r3, 0xC] + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _081605F0 + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, =0x0000ffff + strh r1, [r0, 0x24] + b _08160600 + .pool +_081605F0: + ldr r2, =gSprites + movs r0, 0x26 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + strh r5, [r0, 0x24] +_08160600: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + adds r0, r6 + bl RunAffineAnimFromTaskData + lsls r0, 24 + cmp r0, 0 + bne _08160618 + adds r0, r4, 0 + bl DestroyAnimVisualTask +_08160618: + pop {r4-r6} + pop {r0} + bx r0 + .pool + thumb_func_end sub_816058C + + .align 2, 0 @ Don't pad with nop. diff --git a/include/battle_anim.h b/include/battle_anim.h index cdeb60e69..b25822992 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -144,6 +144,11 @@ void SetGreyscaleOrOriginalPalette(u16 a1, bool8 a2); void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds); bool8 RunAffineAnimFromTaskData(struct Task *task); void sub_80A78AC(struct Sprite *sprite); +void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused); +u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, u32 a10); +void sub_80A749C(struct Sprite *sprite); +void sub_80A6814(u8 taskId); +void sub_80A8610(struct Sprite *sprite); enum { @@ -185,6 +190,7 @@ u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, // battle_anim_utility_funcs.s void sub_8116EB4(u8); +void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u8 *arg8, const u8 *arg9, const u16 *palette); u32 UnpackSelectedBattleAnimPalettes(s16); diff --git a/include/graphics.h b/include/graphics.h index a7ee286b8..48e4532ac 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4154,6 +4154,8 @@ extern const u32 gBattleAnimSpriteSheet_050[]; extern const u32 gBattleAnimSpriteSheet_051[]; extern const u32 gBattleAnimSpriteSheet_052[]; extern const u32 gBattleAnimSpriteSheet_053[]; +extern const u32 gUnknown_08C2EA50[]; +extern const u32 gUnknown_08C2EA9C[]; extern const u32 gBattleAnimSpriteSheet_054[]; extern const u32 gBattleAnimSpriteSheet_055[]; extern const u32 gBattleAnimSpriteSheet_056[]; @@ -4619,6 +4621,9 @@ extern const u32 gBattleAnimSpritePalette_241[]; extern const u32 gBattleAnimSpritePalette_242[]; extern const u32 gBattleAnimSpritePalette_243[]; extern const u32 gBattleAnimSpritePalette_244[]; +extern const u8 gUnknown_08C2DC68[]; +extern const u16 gUnknown_08C2DDA4[]; +extern const u8 gUnknown_08C2DDC4[]; extern const u32 gBattleAnimSpritePalette_245[]; extern const u32 gBattleAnimSpritePalette_248[]; extern const u32 gBattleAnimSpritePalette_249[]; @@ -4697,6 +4702,9 @@ extern const u32 gBattleAnimBackgroundTilemap_07[]; extern const u32 gBattleAnimBackgroundTilemap_08[]; extern const u32 gBattleAnimBackgroundTilemap_09[]; extern const u32 gBattleAnimBackgroundTilemap_10[]; +extern const u32 gUnknown_08C2A634[]; +extern const u32 gUnknown_08C2A6D4[]; +extern const u32 gUnknown_08C2A6EC[]; extern const u32 gBattleAnimBackgroundTilemap_11[]; extern const u32 gBattleAnimBackgroundTilemap_12[]; extern const u32 gBattleAnimBackgroundTilemap_13[]; @@ -4757,9 +4765,4 @@ extern const u32 gCableCarDoor_Gfx[]; extern const u32 gCableCarCord_Gfx[]; extern const u16 gCableCar_Pal[]; -// Battle Anim -extern const u32 gUnknown_08C2DDA4[]; -extern const u32 gUnknown_08C2EA50[]; -extern const u32 gUnknown_08C2EA9C[]; - #endif //GUARD_GRAPHICS_H diff --git a/include/scanline_effect.h b/include/scanline_effect.h index eb837e7e2..5bd8b5546 100644 --- a/include/scanline_effect.h +++ b/include/scanline_effect.h @@ -3,6 +3,7 @@ // DMA control value to transfer a single 16-bit value at HBlank #define SCANLINE_EFFECT_DMACNT_16BIT (((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_INC | DMA_16BIT | DMA_DEST_RELOAD) << 16) | 1) +#define SCANLINE_EFFECT_DMACNT_32BIT (((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_INC | DMA_32BIT | DMA_DEST_RELOAD) << 16) | 1) #define SCANLINE_EFFECT_REG_BG0HOFS (REG_ADDR_BG0HOFS - REG_ADDR_BG0HOFS) #define SCANLINE_EFFECT_REG_BG0VOFS (REG_ADDR_BG0VOFS - REG_ADDR_BG0HOFS) diff --git a/ld_script.txt b/ld_script.txt index 4b56d0f4b..b8dcee092 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -224,8 +224,8 @@ SECTIONS { src/battle_anim_sound_tasks.o(.text); src/battle_controller_safari.o(.text); src/fldeff_sweetscent.o(.text); - src/battle_anim_815A0D4.o(.text); - asm/battle_anim_815A0D4.o(.text); + src/battle_anim_effects_3.o(.text); + asm/battle_anim_effects_3.o(.text); src/learn_move.o(.text); src/fldeff_softboiled.o(.text); src/decoration_inventory.o(.text); @@ -539,7 +539,7 @@ SECTIONS { data/field_effect_helpers.o(.rodata); src/contest_ai.o(.rodata); src/battle_controller_safari.o(.rodata); - src/battle_anim_815A0D4.o(.rodata); + src/battle_anim_effects_3.o(.rodata); src/learn_move.o(.rodata); src/roamer.o(.rodata); src/battle_tower.o(.rodata); diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index 28196a345..15a4d2b63 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -906,7 +906,7 @@ void sub_80A6B90(struct UnknownAnimStruct2 *unk, u32 arg1) } } -void sub_80A6BFC(struct UnknownAnimStruct2 *unk) +void sub_80A6BFC(struct UnknownAnimStruct2 *unk, u8 unused) { unk->bgTiles = gUnknown_0202305C; unk->unk4 = (u16 *)gUnknown_02023060; diff --git a/src/battle_anim_815A0D4.c b/src/battle_anim_815A0D4.c deleted file mode 100755 index 46de0d09d..000000000 --- a/src/battle_anim_815A0D4.c +++ /dev/null @@ -1,1092 +0,0 @@ -#include "global.h" -#include "battle.h" -#include "battle_anim.h" -#include "bg.h" -#include "contest.h" -#include "data2.h" -#include "decompress.h" -#include "dma3.h" -#include "gpu_regs.h" -#include "alloc.h" -#include "palette.h" -#include "pokemon_icon.h" -#include "sprite.h" -#include "task.h" -#include "trig.h" -#include "util.h" -#include "constants/battle_anim.h" -#include "constants/species.h" - -void sub_815A0D4(struct Sprite *); -void sub_815A1B0(struct Sprite *); -void sub_815A254(struct Sprite *); -void sub_815A2F0(struct Sprite *); -void sub_815A6C4(struct Sprite *); -void sub_815A7B0(struct Sprite *); -void sub_815A7EC(struct Sprite *); -void sub_815A8AC(struct Sprite *); -void sub_815A934(struct Sprite *); -void sub_815AAA4(struct Sprite *); -void sub_815ABD0(struct Sprite *); -void sub_815ACD0(struct Sprite *); -void sub_815B27C(struct Sprite *); -void sub_815B394(struct Sprite *); -void sub_815B49C(struct Sprite *); -void sub_815B570(struct Sprite *); -void sub_815B70C(struct Sprite *); -void sub_815BE04(struct Sprite *); -void sub_815C400(struct Sprite *); -void sub_815C6B0(struct Sprite *); -void sub_815C95C(struct Sprite *); -void sub_815CB88(struct Sprite *); -void sub_815CC94(struct Sprite *); -void sub_815CDB4(struct Sprite *); -void sub_815D7B4(struct Sprite *); -void sub_815D870(struct Sprite *); -void sub_815DEBC(struct Sprite *); -void sub_815E01C(struct Sprite *); -void sub_815E404(struct Sprite *); -void sub_815E444(struct Sprite *); -void sub_815E6D8(struct Sprite *); -void sub_815E954(struct Sprite *); -void sub_815EA14(struct Sprite *); -void sub_815EE84(struct Sprite *); -void sub_815F18C(struct Sprite *); -void sub_815F48C(struct Sprite *); -void sub_815FE80(struct Sprite *); -void sub_81061C4(struct Sprite *); -void sub_8160338(struct Sprite *); -void sub_81603A8(struct Sprite *); - -const union AnimCmd gUnknown_085CE004[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(16, 4), - ANIMCMD_FRAME(32, 4), - ANIMCMD_FRAME(48, 4), - ANIMCMD_FRAME(64, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE01C[] = -{ - gUnknown_085CE004, -}; - -const struct SpriteTemplate gUnknown_085CE020 = -{ - .tileTag = ANIM_TAG_SCRATCH, - .paletteTag = ANIM_TAG_SCRATCH, - .oam = &gUnknown_08524A34, - .anims = gUnknown_085CE01C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const struct SpriteTemplate gUnknown_085CE038 = -{ - .tileTag = ANIM_TAG_BLACK_SMOKE, - .paletteTag = ANIM_TAG_BLACK_SMOKE, - .oam = &gUnknown_08524934, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A0D4, -}; - -const struct SpriteTemplate gUnknown_085CE050 = -{ - .tileTag = ANIM_TAG_BLACK_BALL, - .paletteTag = ANIM_TAG_BLACK_BALL, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A78AC, -}; - -const union AnimCmd gUnknown_085CE068[] = -{ - ANIMCMD_FRAME(0, 40), - ANIMCMD_FRAME(16, 8), - ANIMCMD_FRAME(32, 40), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE078[] = -{ - gUnknown_085CE068, -}; - -const struct SpriteTemplate gUnknown_085CE07C = -{ - .tileTag = ANIM_TAG_OPENING_EYE, - .paletteTag = ANIM_TAG_OPENING_EYE, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE078, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const struct SpriteTemplate gUnknown_085CE094 = -{ - .tileTag = ANIM_TAG_ROUND_WHITE_HALO, - .paletteTag = ANIM_TAG_ROUND_WHITE_HALO, - .oam = &gUnknown_08524A3C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A1B0, -}; - -const struct SpriteTemplate gUnknown_085CE0AC = -{ - .tileTag = ANIM_TAG_TEAL_ALERT, - .paletteTag = ANIM_TAG_TEAL_ALERT, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A254, -}; - -const union AffineAnimCmd gUnknown_085CE0C4[] = -{ - AFFINEANIMCMD_FRAME(0x180, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(-0x20, 0x18, 0, 5), - AFFINEANIMCMD_FRAME(0x18, -0x20, 0, 5), - AFFINEANIMCMD_JUMP(1), -}; - -const union AffineAnimCmd gUnknown_085CE0E4[] = -{ - AFFINEANIMCMD_FRAME(0x30, 0x30, 0, 0), - AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 6), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE0FC[] = -{ - gUnknown_085CE0C4, - gUnknown_085CE0E4, -}; - -const struct SpriteTemplate gUnknown_085CE104 = -{ - .tileTag = ANIM_TAG_EYE, - .paletteTag = ANIM_TAG_EYE, - .oam = &gUnknown_08524AFC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE0FC, - .callback = sub_815A2F0, -}; - -const struct SpriteTemplate gUnknown_085CE11C = -{ - .tileTag = ANIM_TAG_SPIKES, - .paletteTag = ANIM_TAG_SPIKES, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A6C4, -}; - -const union AnimCmd gUnknown_085CE134[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_FRAME(64, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE14C[] = -{ - gUnknown_085CE134, -}; - -const struct SpriteTemplate gUnknown_085CE150 = -{ - .tileTag = ANIM_TAG_LEER, - .paletteTag = ANIM_TAG_LEER, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE14C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815A7B0, -}; - -const union AnimCmd gUnknown_085CE168[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE170[] = -{ - gUnknown_085CE168, -}; - -const union AffineAnimCmd gUnknown_085CE174[] = -{ - AFFINEANIMCMD_FRAME(-7, -7, -3, 16), - AFFINEANIMCMD_FRAME(7, 7, 3, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE18C[] = -{ - gUnknown_085CE174, -}; - -const struct SpriteTemplate gUnknown_085CE190 = -{ - .tileTag = ANIM_TAG_LETTER_Z, - .paletteTag = ANIM_TAG_LETTER_Z, - .oam = &gUnknown_08524974, - .anims = gUnknown_085CE170, - .images = NULL, - .affineAnims = gUnknown_085CE18C, - .callback = sub_815A7EC, -}; - -const union AnimCmd gUnknown_085CE1A8[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_FRAME(16, 16), - ANIMCMD_FRAME(32, 4), - ANIMCMD_FRAME(48, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE1BC[] = -{ - gUnknown_085CE1A8, -}; - -const union AffineAnimCmd gUnknown_085CE1C0[] = -{ - AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), - AFFINEANIMCMD_FRAME(-0x20, -0x20, 0, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE1D8[] = -{ - gUnknown_085CE1C0, -}; - -const struct SpriteTemplate gUnknown_085CE1DC = -{ - .tileTag = ANIM_TAG_FANG_ATTACK, - .paletteTag = ANIM_TAG_FANG_ATTACK, - .oam = &gUnknown_085249D4, - .anims = gUnknown_085CE1BC, - .images = NULL, - .affineAnims = gUnknown_085CE1D8, - .callback = sub_815A8AC, -}; - -const union AffineAnimCmd gUnknown_085CE1F4[] = -{ - AFFINEANIMCMD_FRAME(0x0, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(0x10, 0x0, 0, 20), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE20C[] = -{ - AFFINEANIMCMD_FRAME(0x140, 0x180, 0, 0), - AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 19), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE224[] = -{ - gUnknown_085CE1F4, - gUnknown_085CE20C, -}; - -const struct SpriteTemplate gUnknown_085CE22C = -{ - .tileTag = ANIM_TAG_SPOTLIGHT, - .paletteTag = ANIM_TAG_SPOTLIGHT, - .oam = &gUnknown_085249DC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE224, - .callback = sub_815A934, -}; - -const struct SpriteTemplate gUnknown_085CE244 = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815AAA4, -}; - -const struct SpriteTemplate gUnknown_085CE25C = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815ABD0, -}; - -const union AnimCmd gUnknown_085CE274[] = -{ - ANIMCMD_FRAME(0, 2), - ANIMCMD_FRAME(8, 2), - ANIMCMD_FRAME(16, 2), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd *const gUnknown_085CE284[] = -{ - gUnknown_085CE274, -}; - -const struct SpriteTemplate gUnknown_085CE288 = -{ - .tileTag = ANIM_TAG_RAPID_SPIN, - .paletteTag = ANIM_TAG_RAPID_SPIN, - .oam = &gUnknown_08524934, - .anims = gUnknown_085CE284, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815ACD0, -}; - -const union AffineAnimCmd gUnknown_085CE2A0[] = -{ - AFFINEANIMCMD_FRAME(-12, 8, 0, 4), - AFFINEANIMCMD_FRAME(20, -20, 0, 4), - AFFINEANIMCMD_FRAME(-8, 12, 0, 4), - AFFINEANIMCMD_END, -}; - -const union AnimCmd gUnknown_085CE2C0[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE2C8[] = -{ - gUnknown_085CE2C0, -}; - -const union AffineAnimCmd gUnknown_085CE2CC[] = -{ - AFFINEANIMCMD_FRAME(0, 0, 5, 40), - AFFINEANIMCMD_FRAME(0, 0, 10, 10), - AFFINEANIMCMD_FRAME(0, 0, 15, 10), - AFFINEANIMCMD_FRAME(0, 0, 20, 40), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE2F4[] = -{ - gUnknown_085CE2CC, -}; - -const struct SpriteTemplate gUnknown_085CE2F8 = -{ - .tileTag = ANIM_TAG_TRI_FORCE_TRIANGLE, - .paletteTag = ANIM_TAG_TRI_FORCE_TRIANGLE, - .oam = &gUnknown_085249DC, - .anims = gUnknown_085CE2C8, - .images = NULL, - .affineAnims = gUnknown_085CE2F4, - .callback = sub_815B27C, -}; - -const union AnimCmd gUnknown_085CE310[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_FRAME(32, 3, .hFlip = TRUE), - ANIMCMD_FRAME(16, 3, .hFlip = TRUE), - ANIMCMD_FRAME(0, 3, .hFlip = TRUE), - ANIMCMD_LOOP(1), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE334[] = -{ - gUnknown_085CE310, -}; - -const struct SpriteTemplate gUnknown_085CE338 = -{ - .tileTag = ANIM_TAG_ECLIPSING_ORB, - .paletteTag = ANIM_TAG_ECLIPSING_ORB, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE334, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80A77C8, -}; - -const union AffineAnimCmd gUnknown_085CE350[] = -{ - AFFINEANIMCMD_FRAME(-12, 20, 0, 8), - AFFINEANIMCMD_FRAME(12, -20, 0, 8), - AFFINEANIMCMD_LOOP(2), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE370 = -{ - .tileTag = ANIM_TAG_POKEBALL, - .paletteTag = ANIM_TAG_POKEBALL, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B394, -}; - -const struct SpriteTemplate gUnknown_085CE388 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B49C, -}; - -const struct SpriteTemplate gUnknown_085CE3A0 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B570, -}; - -const union AffineAnimCmd gUnknown_085CE3B8[] = -{ - AFFINEANIMCMD_FRAME(8, -8, 0, 12), - AFFINEANIMCMD_FRAME(-16, 16, 0, 12), - AFFINEANIMCMD_FRAME(8, -8, 0, 12), - AFFINEANIMCMD_LOOP(1), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE3E0[] = -{ - AFFINEANIMCMD_FRAME(0, 6, 0, 20), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(0, -18, 0, 6), - AFFINEANIMCMD_FRAME(-18, -18, 0, 3), - AFFINEANIMCMD_FRAME(0, 0, 0, 15), - AFFINEANIMCMD_FRAME(4, 4, 0, 13), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE418 = -{ - .tileTag = ANIM_TAG_BLUE_ORB, - .paletteTag = ANIM_TAG_BLUE_ORB, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815B70C, -}; - -const union AffineAnimCmd gUnknown_085CE430[] = -{ - AFFINEANIMCMD_FRAME(0, 6, 0, 20), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(7, -30, 0, 6), - AFFINEANIMCMD_FRAME(0, 0, 0, 20), - AFFINEANIMCMD_FRAME(-2, 3, 0, 20), - AFFINEANIMCMD_END, -}; - -const s8 gUnknown_085CE460[] = -{ - 0xE8, - 0x18, - 0xFC, - 0x00, -}; - -const union AnimCmd gUnknown_085CE464[] = -{ - ANIMCMD_FRAME(0, 6), - ANIMCMD_FRAME(4, 6), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE470[] = -{ - ANIMCMD_FRAME(8, 6), - ANIMCMD_END, -}; - -const union AnimCmd gUnknown_085CE478[] = -{ - ANIMCMD_FRAME(12, 6), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE480[] = -{ - gUnknown_085CE464, - gUnknown_085CE470, - gUnknown_085CE478, -}; - -const struct SpriteTemplate gUnknown_085CE48C = -{ - .tileTag = ANIM_TAG_GREEN_STAR, - .paletteTag = ANIM_TAG_GREEN_STAR, - .oam = &gUnknown_0852490C, - .anims = gUnknown_085CE480, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815BE04, -}; - -const s8 gUnknown_085CE4A4[] = -{ - 0x78, - 0x50, - 0x28, - 0x00, -}; - -const u8 gUnknown_085CE4A8[] = -{ - 0, - 0, - 0, - 0, - 50, -}; - -const union AffineAnimCmd gUnknown_085CE4B0[] = -{ - AFFINEANIMCMD_FRAME(0, -15, 0, 7), - AFFINEANIMCMD_FRAME(0, 15, 0, 7), - AFFINEANIMCMD_LOOP(2), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE4D0 = -{ - .tileTag = ANIM_TAG_ANGER, - .paletteTag = ANIM_TAG_ANGER, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C400, -}; - -const union AnimCmd gUnknown_085CE4E8[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_FRAME(1, 8), - ANIMCMD_FRAME(2, 8), - ANIMCMD_FRAME(3, 8), - ANIMCMD_FRAME(3, 8, .vFlip = TRUE), - ANIMCMD_FRAME(2, 8, .vFlip = TRUE), - ANIMCMD_FRAME(0, 8, .vFlip = TRUE), - ANIMCMD_FRAME(1, 8, .vFlip = TRUE), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE50C[] = -{ - ANIMCMD_FRAME(0, 8, .hFlip = TRUE), - ANIMCMD_FRAME(1, 8, .hFlip = TRUE), - ANIMCMD_FRAME(2, 8, .hFlip = TRUE), - ANIMCMD_FRAME(3, 8, .hFlip = TRUE), - ANIMCMD_FRAME(3, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(2, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(0, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_FRAME(1, 8, .vFlip = TRUE, .hFlip = TRUE), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE530[] = -{ - ANIMCMD_FRAME(0, 8), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE538[] = -{ - gUnknown_085CE4E8, - gUnknown_085CE50C, - gUnknown_085CE530, -}; - -const struct SpriteTemplate gUnknown_085CE544 = -{ - .tileTag = ANIM_TAG_PINK_PETAL, - .paletteTag = ANIM_TAG_PINK_PETAL, - .oam = &gUnknown_08524904, - .anims = gUnknown_085CE538, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C6B0, -}; - -const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); - -const union AnimCmd gUnknown_085CE57C[] = -{ - ANIMCMD_FRAME(0, 5), - ANIMCMD_FRAME(4, 9), - ANIMCMD_FRAME(8, 5), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE58C[] = -{ - gUnknown_085CE57C, -}; - -const struct SpriteTemplate gUnknown_085CE590 = -{ - .tileTag = ANIM_TAG_PAIN_SPLIT, - .paletteTag = ANIM_TAG_PAIN_SPLIT, - .oam = &gUnknown_0852490C, - .anims = gUnknown_085CE58C, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815C95C, -}; - -const struct SpriteTemplate gUnknown_085CE5A8 = -{ - .tileTag = ANIM_TAG_CONFETTI, - .paletteTag = ANIM_TAG_CONFETTI, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815CB88, -}; - -const struct SpriteTemplate gUnknown_085CE5C0 = -{ - .tileTag = ANIM_TAG_SPOTLIGHT, - .paletteTag = ANIM_TAG_SPOTLIGHT, - .oam = &gUnknown_085249DC, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE224, - .callback = sub_815CC94, -}; - -const struct SpriteTemplate gBattleAnimSpriteTemplate_85CE5D8 = -{ - .tileTag = ANIM_TAG_BLUE_ORB, - .paletteTag = ANIM_TAG_BLUE_ORB, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815CDB4, -}; - -const union AffineAnimCmd gUnknown_085CE5F0[] = -{ - AFFINEANIMCMD_FRAME(16, 0, 0, 4), - AFFINEANIMCMD_FRAME(0, -3, 0, 16), - AFFINEANIMCMD_FRAME(4, 0, 0, 4), - AFFINEANIMCMD_FRAME(0, 0, 0, 24), - AFFINEANIMCMD_FRAME(-5, 3, 0, 16), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE620[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE640[] = -{ - AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE660[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(8, 8, 0, 8), - AFFINEANIMCMD_FRAME(-8, -8, 0, 8), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE680[] = -{ - gUnknown_085CE620, - gUnknown_085CE640, - gUnknown_085CE660, -}; - -const struct SpriteTemplate gUnknown_085CE68C = -{ - .tileTag = ANIM_TAG_PINK_CLOUD, - .paletteTag = ANIM_TAG_PINK_CLOUD, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE680, - .callback = sub_815D7B4, -}; - -const union AffineAnimCmd gUnknown_085CE6A4[] = -{ - AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE6C4[] = -{ - AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE6E4[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(4, 6, 0, 16), - AFFINEANIMCMD_FRAME(-4, -6, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd gUnknown_085CE704[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(8, 10, 0, 30), - AFFINEANIMCMD_FRAME(-8, -10, 0, 16), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE724[] = -{ - gUnknown_085CE6A4, - gUnknown_085CE6C4, - gUnknown_085CE6E4, - gUnknown_085CE704, -}; - -const struct SpriteTemplate gUnknown_085CE734 = -{ - .tileTag = ANIM_TAG_PINK_CLOUD, - .paletteTag = ANIM_TAG_PINK_CLOUD, - .oam = &gUnknown_085249D4, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE724, - .callback = sub_815D870, -}; - -const union AffineAnimCmd gUnknown_085CE74C[] = -{ - AFFINEANIMCMD_FRAME(-16, 16, 0, 6), - AFFINEANIMCMD_FRAME(16, -16, 0, 12), - AFFINEANIMCMD_FRAME(-16, 16, 0, 6), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE76C = -{ - .tileTag = ANIM_TAG_SWEAT_DROP, - .paletteTag = ANIM_TAG_SWEAT_DROP, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815DEBC, -}; - -const u16 gUnknown_085CE784[] = INCBIN_U16("graphics/battle_anims/sprites/effect.gbapal"); - -const union AnimCmd gUnknown_085CE7B4[] = -{ - ANIMCMD_FRAME(0, 3), - ANIMCMD_FRAME(16, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd gUnknown_085CE7C0[] = -{ - ANIMCMD_FRAME(32, 3), - ANIMCMD_FRAME(48, 3), - ANIMCMD_JUMP(0), -}; - -const union AnimCmd *const gUnknown_085CE7CC[] = -{ - gUnknown_085CE7B4, - gUnknown_085CE7C0, -}; - -const struct SpriteTemplate gUnknown_085CE7D4 = -{ - .tileTag = ANIM_TAG_NOISE_LINE, - .paletteTag = ANIM_TAG_NOISE_LINE, - .oam = &gUnknown_08524914, - .anims = gUnknown_085CE7CC, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E01C, -}; - -const struct SpriteTemplate gUnknown_085CE7EC = -{ - .tileTag = ANIM_TAG_SMALL_RED_EYE, - .paletteTag = ANIM_TAG_SMALL_RED_EYE, - .oam = &gUnknown_08524904, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E404, -}; - -const struct SpriteTemplate gUnknown_085CE804 = -{ - .tileTag = ANIM_TAG_PAW_PRINT, - .paletteTag = ANIM_TAG_PAW_PRINT, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E444, -}; - -const union AffineAnimCmd gUnknown_085CE81C[] = -{ - AFFINEANIMCMD_FRAME(0, 0, -4, 24), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE82C[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, -64, 0), - AFFINEANIMCMD_FRAME(0, 0, 4, 24), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE844[] = -{ - gUnknown_085CE81C, - gUnknown_085CE82C, -}; - -const struct SpriteTemplate gUnknown_085CE84C = -{ - .tileTag = ANIM_TAG_RED_BALL, - .paletteTag = ANIM_TAG_RED_BALL, - .oam = &gUnknown_08524974, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE844, - .callback = SpriteCallbackDummy, -}; - -const struct SpriteTemplate gUnknown_085CE864 = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E6D8, -}; - -const union AffineAnimCmd gUnknown_085CE87C[] = -{ - AFFINEANIMCMD_FRAME(0, -16, 0, 6), - AFFINEANIMCMD_FRAME(0, 16, 0, 6), - AFFINEANIMCMD_END, -}; - -const struct SpriteTemplate gUnknown_085CE894 = -{ - .tileTag = ANIM_TAG_SMELLINGSALT_EFFECT, - .paletteTag = ANIM_TAG_SMELLINGSALT_EFFECT, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815E954, -}; - -const struct SpriteTemplate gUnknown_085CE8AC = -{ - .tileTag = ANIM_TAG_TAG_HAND, - .paletteTag = ANIM_TAG_TAG_HAND, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815EA14, -}; - -const struct SpriteTemplate gUnknown_085CE8C4 = -{ - .tileTag = ANIM_TAG_MAGNIFYING_GLASS, - .paletteTag = ANIM_TAG_MAGNIFYING_GLASS, - .oam = &gUnknown_08524A34, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815EE84, -}; - -const struct SpriteTemplate gUnknown_085CE8DC = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815F18C, -}; - -const struct SpriteTemplate gUnknown_085CE8F4 = -{ - .tileTag = ANIM_TAG_GOLD_STARS, - .paletteTag = ANIM_TAG_GOLD_STARS, - .oam = &gUnknown_0852490C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_81061C4, -}; - -const struct SpriteTemplate gUnknown_085CE90C = -{ - .tileTag = ANIM_TAG_X_SIGN, - .paletteTag = ANIM_TAG_X_SIGN, - .oam = &gUnknown_0852491C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815F48C, -}; - -const struct SpriteTemplate gUnknown_085CE924 = -{ - .tileTag = ANIM_TAG_ITEM_BAG, - .paletteTag = ANIM_TAG_ITEM_BAG, - .oam = &gUnknown_08524914, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_815FE80, -}; - -const union AnimCmd gUnknown_085CE93C[] = -{ - ANIMCMD_FRAME(0, 4), - ANIMCMD_FRAME(64, 4), - ANIMCMD_END, -}; - -const union AnimCmd *const gUnknown_085CE948[] = -{ - gUnknown_085CE93C, -}; - -const union AffineAnimCmd gUnknown_085CE94C[] = -{ - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0, 0, -4, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd gUnknown_085CE964[] = -{ - AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), - AFFINEANIMCMD_FRAME(0, 0, 4, 8), - AFFINEANIMCMD_END, -}; - -const union AffineAnimCmd *const gUnknown_085CE97C[] = -{ - gUnknown_085CE94C, - gUnknown_085CE964, -}; - -const struct SpriteTemplate gUnknown_085CE984 = -{ - .tileTag = ANIM_TAG_SLAM_HIT_2, - .paletteTag = ANIM_TAG_SLAM_HIT_2, - .oam = &gUnknown_0852497C, - .anims = gUnknown_085CE948, - .images = NULL, - .affineAnims = gUnknown_085CE97C, - .callback = sub_8160338, -}; - -const union AffineAnimCmd gUnknown_085CE99C[] = -{ - AFFINEANIMCMD_FRAME(0, 0, -4, 64), - AFFINEANIMCMD_JUMP(0), -}; - -const union AffineAnimCmd *const gUnknown_085CE9AC[] = -{ - gUnknown_085CE99C, -}; - -const struct SpriteTemplate gUnknown_085CE9B0 = -{ - .tileTag = ANIM_TAG_RECYCLE, - .paletteTag = ANIM_TAG_RECYCLE, - .oam = &gUnknown_08524A9C, - .anims = gDummySpriteAnimTable, - .images = NULL, - .affineAnims = gUnknown_085CE9AC, - .callback = sub_81603A8, -}; - -const union AffineAnimCmd gUnknown_085CE9C8[] = -{ - AFFINEANIMCMD_FRAME(0, 16, 0, 4), - AFFINEANIMCMD_FRAME(-2, 0, 0, 8), - AFFINEANIMCMD_FRAME(0, 4, 0, 4), - AFFINEANIMCMD_FRAME(0, 0, 0, 24), - AFFINEANIMCMD_FRAME(1, -5, 0, 16), - AFFINEANIMCMD_END, -}; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c new file mode 100755 index 000000000..5f65cb31f --- /dev/null +++ b/src/battle_anim_effects_3.c @@ -0,0 +1,4889 @@ +#include "global.h" +#include "alloc.h" +#include "battle.h" +#include "battle_anim.h" +#include "bg.h" +#include "contest.h" +#include "data2.h" +#include "decompress.h" +#include "dma3.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "palette.h" +#include "pokemon_icon.h" +#include "random.h" +#include "scanline_effect.h" +#include "sound.h" +#include "sprite.h" +#include "task.h" +#include "trig.h" +#include "util.h" +#include "constants/battle_anim.h" +#include "constants/rgb.h" +#include "constants/songs.h" +#include "constants/species.h" + +extern u8 sub_807521C(s16 x, s16 y, u8 a3); +extern void sub_810E2C8(struct Sprite *); + +extern const struct SpriteTemplate gUnknown_08593114; +extern const union AffineAnimCmd *const gUnknown_082FF6C0[]; +extern const union AffineAnimCmd *const gUnknown_082FF694[]; + +void sub_815A0D4(struct Sprite *); +void sub_815A1B0(struct Sprite *); +void sub_815A254(struct Sprite *); +void sub_815A2F0(struct Sprite *); +void sub_815A6C4(struct Sprite *); +void sub_815A7B0(struct Sprite *); +void sub_815A7EC(struct Sprite *); +void sub_815A8AC(struct Sprite *); +void sub_815A934(struct Sprite *); +void sub_815AAA4(struct Sprite *); +void sub_815ABD0(struct Sprite *); +void sub_815ACD0(struct Sprite *); +void sub_815B27C(struct Sprite *); +void sub_815B394(struct Sprite *); +void sub_815B49C(struct Sprite *); +void sub_815B570(struct Sprite *); +void sub_815B70C(struct Sprite *); +void sub_815BE04(struct Sprite *); +void sub_815C400(struct Sprite *); +void sub_815C6B0(struct Sprite *); +void sub_815C95C(struct Sprite *); +void sub_815CB88(struct Sprite *); +void sub_815CC94(struct Sprite *); +void sub_815CDB4(struct Sprite *); +void sub_815D7B4(struct Sprite *); +void sub_815D870(struct Sprite *); +void sub_815DEBC(struct Sprite *); +void sub_815E01C(struct Sprite *); +void sub_815E404(struct Sprite *); +void sub_815E444(struct Sprite *); +void sub_815E6D8(struct Sprite *); +void sub_815E954(struct Sprite *); +void sub_815EA14(struct Sprite *); +void sub_815EE84(struct Sprite *); +void sub_815F18C(struct Sprite *); +void sub_815F48C(struct Sprite *); +void sub_815FE80(struct Sprite *); +void sub_81061C4(struct Sprite *); +void sub_8160338(struct Sprite *); +void sub_81603A8(struct Sprite *); +static void sub_815A114(struct Sprite *); +static void sub_815A1F4(struct Sprite *); +static void sub_815A234(struct Sprite *); +static void sub_815A31C(struct Sprite *); +static void sub_815A3AC(struct Sprite *); +static void sub_815A3F0(struct Sprite *); +static void sub_815A49C(struct Sprite *); +static void sub_815A52C(u8); +static void sub_815A5F0(u8); +static void sub_815A73C(struct Sprite *); +static void sub_815A76C(struct Sprite *); +static void sub_815A9A0(struct Sprite *); +static void sub_815AA6C(struct Sprite *); +static void sub_815AB5C(struct Sprite *); +static void sub_815AD4C(struct Sprite *); +static void sub_815AED8(u8); +static void sub_815B054(u8); +static void sub_815B23C(struct Sprite *); +static void sub_815B4D4(struct Sprite *); +static void sub_815B5D0(struct Sprite *); +static void sub_815BF44(struct Sprite *); +static void sub_815BFF4(struct Sprite *); +static void sub_815C050(struct Sprite *); +static void sub_815C548(u8); +static void sub_815C700(struct Sprite *); +static void sub_815C7C4(u8); +static void sub_815CC34(struct Sprite *); +static void sub_815CD0C(struct Sprite *); +static void sub_815CDFC(struct Sprite *); +static void sub_815D1BC(u8); +static void sub_815D398(u8); +static void sub_815D694(u8); +static void sub_815D804(struct Sprite *); +static void sub_815DD48(u8); +static void sub_815DDE0(u8, bool8); +static void sub_815DF64(u8); +static void sub_815E0DC(struct Sprite *); +static void sub_815E20C(u8); +static void sub_815E34C(s16, s16, s16, s16, u8, u8, s16 *, s16 *); +static void sub_815E5CC(u8); +static void sub_815E784(struct Sprite *); +static void sub_815E898(u8); +static void sub_815E9BC(struct Sprite *); +static void sub_815EA60(struct Sprite *); +static void sub_815ECE4(u8); +static void sub_815EF08(struct Sprite *); +static void sub_815F330(u8); +static void sub_815F4F0(struct Sprite *); +static void sub_815F79C(u8); +static void sub_815F7C4(struct Sprite *); + +const union AnimCmd gUnknown_085CE004[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(16, 4), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE01C[] = +{ + gUnknown_085CE004, +}; + +const struct SpriteTemplate gUnknown_085CE020 = +{ + .tileTag = ANIM_TAG_SCRATCH, + .paletteTag = ANIM_TAG_SCRATCH, + .oam = &gUnknown_08524A34, + .anims = gUnknown_085CE01C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE038 = +{ + .tileTag = ANIM_TAG_BLACK_SMOKE, + .paletteTag = ANIM_TAG_BLACK_SMOKE, + .oam = &gUnknown_08524934, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A0D4, +}; + +const struct SpriteTemplate gUnknown_085CE050 = +{ + .tileTag = ANIM_TAG_BLACK_BALL, + .paletteTag = ANIM_TAG_BLACK_BALL, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A78AC, +}; + +const union AnimCmd gUnknown_085CE068[] = +{ + ANIMCMD_FRAME(0, 40), + ANIMCMD_FRAME(16, 8), + ANIMCMD_FRAME(32, 40), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE078[] = +{ + gUnknown_085CE068, +}; + +const struct SpriteTemplate gUnknown_085CE07C = +{ + .tileTag = ANIM_TAG_OPENING_EYE, + .paletteTag = ANIM_TAG_OPENING_EYE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE078, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const struct SpriteTemplate gUnknown_085CE094 = +{ + .tileTag = ANIM_TAG_ROUND_WHITE_HALO, + .paletteTag = ANIM_TAG_ROUND_WHITE_HALO, + .oam = &gUnknown_08524A3C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A1B0, +}; + +const struct SpriteTemplate gUnknown_085CE0AC = +{ + .tileTag = ANIM_TAG_TEAL_ALERT, + .paletteTag = ANIM_TAG_TEAL_ALERT, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A254, +}; + +const union AffineAnimCmd gUnknown_085CE0C4[] = +{ + AFFINEANIMCMD_FRAME(0x180, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, 0x18, 0, 5), + AFFINEANIMCMD_FRAME(0x18, -0x20, 0, 5), + AFFINEANIMCMD_JUMP(1), +}; + +const union AffineAnimCmd gUnknown_085CE0E4[] = +{ + AFFINEANIMCMD_FRAME(0x30, 0x30, 0, 0), + AFFINEANIMCMD_FRAME(0x20, 0x20, 0, 6), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE0FC[] = +{ + gUnknown_085CE0C4, + gUnknown_085CE0E4, +}; + +const struct SpriteTemplate gUnknown_085CE104 = +{ + .tileTag = ANIM_TAG_EYE, + .paletteTag = ANIM_TAG_EYE, + .oam = &gUnknown_08524AFC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE0FC, + .callback = sub_815A2F0, +}; + +const struct SpriteTemplate gUnknown_085CE11C = +{ + .tileTag = ANIM_TAG_SPIKES, + .paletteTag = ANIM_TAG_SPIKES, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A6C4, +}; + +const union AnimCmd gUnknown_085CE134[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(64, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE14C[] = +{ + gUnknown_085CE134, +}; + +const struct SpriteTemplate gUnknown_085CE150 = +{ + .tileTag = ANIM_TAG_LEER, + .paletteTag = ANIM_TAG_LEER, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE14C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815A7B0, +}; + +const union AnimCmd gUnknown_085CE168[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE170[] = +{ + gUnknown_085CE168, +}; + +const union AffineAnimCmd gUnknown_085CE174[] = +{ + AFFINEANIMCMD_FRAME(-7, -7, -3, 16), + AFFINEANIMCMD_FRAME(7, 7, 3, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE18C[] = +{ + gUnknown_085CE174, +}; + +const struct SpriteTemplate gUnknown_085CE190 = +{ + .tileTag = ANIM_TAG_LETTER_Z, + .paletteTag = ANIM_TAG_LETTER_Z, + .oam = &gUnknown_08524974, + .anims = gUnknown_085CE170, + .images = NULL, + .affineAnims = gUnknown_085CE18C, + .callback = sub_815A7EC, +}; + +const union AnimCmd gUnknown_085CE1A8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(16, 16), + ANIMCMD_FRAME(32, 4), + ANIMCMD_FRAME(48, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE1BC[] = +{ + gUnknown_085CE1A8, +}; + +const union AffineAnimCmd gUnknown_085CE1C0[] = +{ + AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), + AFFINEANIMCMD_FRAME(-0x20, -0x20, 0, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE1D8[] = +{ + gUnknown_085CE1C0, +}; + +const struct SpriteTemplate gUnknown_085CE1DC = +{ + .tileTag = ANIM_TAG_FANG_ATTACK, + .paletteTag = ANIM_TAG_FANG_ATTACK, + .oam = &gUnknown_085249D4, + .anims = gUnknown_085CE1BC, + .images = NULL, + .affineAnims = gUnknown_085CE1D8, + .callback = sub_815A8AC, +}; + +const union AffineAnimCmd gUnknown_085CE1F4[] = +{ + AFFINEANIMCMD_FRAME(0x0, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x0, 0, 20), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE20C[] = +{ + AFFINEANIMCMD_FRAME(0x140, 0x180, 0, 0), + AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 19), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE224[] = +{ + gUnknown_085CE1F4, + gUnknown_085CE20C, +}; + +const struct SpriteTemplate gUnknown_085CE22C = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815A934, +}; + +const struct SpriteTemplate gUnknown_085CE244 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815AAA4, +}; + +const struct SpriteTemplate gUnknown_085CE25C = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ABD0, +}; + +const union AnimCmd gUnknown_085CE274[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(8, 2), + ANIMCMD_FRAME(16, 2), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE284[] = +{ + gUnknown_085CE274, +}; + +const struct SpriteTemplate gUnknown_085CE288 = +{ + .tileTag = ANIM_TAG_RAPID_SPIN, + .paletteTag = ANIM_TAG_RAPID_SPIN, + .oam = &gUnknown_08524934, + .anims = gUnknown_085CE284, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815ACD0, +}; + +const union AffineAnimCmd gUnknown_085CE2A0[] = +{ + AFFINEANIMCMD_FRAME(-12, 8, 0, 4), + AFFINEANIMCMD_FRAME(20, -20, 0, 4), + AFFINEANIMCMD_FRAME(-8, 12, 0, 4), + AFFINEANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE2C0[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE2C8[] = +{ + gUnknown_085CE2C0, +}; + +const union AffineAnimCmd gUnknown_085CE2CC[] = +{ + AFFINEANIMCMD_FRAME(0, 0, 5, 40), + AFFINEANIMCMD_FRAME(0, 0, 10, 10), + AFFINEANIMCMD_FRAME(0, 0, 15, 10), + AFFINEANIMCMD_FRAME(0, 0, 20, 40), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE2F4[] = +{ + gUnknown_085CE2CC, +}; + +const struct SpriteTemplate gUnknown_085CE2F8 = +{ + .tileTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .paletteTag = ANIM_TAG_TRI_FORCE_TRIANGLE, + .oam = &gUnknown_085249DC, + .anims = gUnknown_085CE2C8, + .images = NULL, + .affineAnims = gUnknown_085CE2F4, + .callback = sub_815B27C, +}; + +const union AnimCmd gUnknown_085CE310[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_FRAME(32, 3, .hFlip = TRUE), + ANIMCMD_FRAME(16, 3, .hFlip = TRUE), + ANIMCMD_FRAME(0, 3, .hFlip = TRUE), + ANIMCMD_LOOP(1), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE334[] = +{ + gUnknown_085CE310, +}; + +const struct SpriteTemplate gUnknown_085CE338 = +{ + .tileTag = ANIM_TAG_ECLIPSING_ORB, + .paletteTag = ANIM_TAG_ECLIPSING_ORB, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE334, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80A77C8, +}; + +const union AffineAnimCmd gUnknown_085CE350[] = +{ + AFFINEANIMCMD_FRAME(-12, 20, 0, 8), + AFFINEANIMCMD_FRAME(12, -20, 0, 8), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE370 = +{ + .tileTag = ANIM_TAG_POKEBALL, + .paletteTag = ANIM_TAG_POKEBALL, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B394, +}; + +const struct SpriteTemplate gUnknown_085CE388 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B49C, +}; + +const struct SpriteTemplate gUnknown_085CE3A0 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B570, +}; + +const union AffineAnimCmd gUnknown_085CE3B8[] = +{ + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 12), + AFFINEANIMCMD_FRAME(8, -8, 0, 12), + AFFINEANIMCMD_LOOP(1), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE3E0[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(0, -18, 0, 6), + AFFINEANIMCMD_FRAME(-18, -18, 0, 3), + AFFINEANIMCMD_FRAME(0, 0, 0, 15), + AFFINEANIMCMD_FRAME(4, 4, 0, 13), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE418 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815B70C, +}; + +const union AffineAnimCmd gUnknown_085CE430[] = +{ + AFFINEANIMCMD_FRAME(0, 6, 0, 20), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(7, -30, 0, 6), + AFFINEANIMCMD_FRAME(0, 0, 0, 20), + AFFINEANIMCMD_FRAME(-2, 3, 0, 20), + AFFINEANIMCMD_END, +}; + +const s8 gUnknown_085CE460[] = +{ + 0xE8, + 0x18, + 0xFC, + 0x00, +}; + +const union AnimCmd gUnknown_085CE464[] = +{ + ANIMCMD_FRAME(0, 6), + ANIMCMD_FRAME(4, 6), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE470[] = +{ + ANIMCMD_FRAME(8, 6), + ANIMCMD_END, +}; + +const union AnimCmd gUnknown_085CE478[] = +{ + ANIMCMD_FRAME(12, 6), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE480[] = +{ + gUnknown_085CE464, + gUnknown_085CE470, + gUnknown_085CE478, +}; + +const struct SpriteTemplate gUnknown_085CE48C = +{ + .tileTag = ANIM_TAG_GREEN_STAR, + .paletteTag = ANIM_TAG_GREEN_STAR, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE480, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815BE04, +}; + +const s8 gUnknown_085CE4A4[] = +{ + 0x78, + 0x50, + 0x28, + 0x00, +}; + +const u8 gUnknown_085CE4A8[] = +{ + 0, + 0, + 0, + 0, + 50, +}; + +const union AffineAnimCmd gUnknown_085CE4B0[] = +{ + AFFINEANIMCMD_FRAME(0, -15, 0, 7), + AFFINEANIMCMD_FRAME(0, 15, 0, 7), + AFFINEANIMCMD_LOOP(2), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE4D0 = +{ + .tileTag = ANIM_TAG_ANGER, + .paletteTag = ANIM_TAG_ANGER, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C400, +}; + +const union AnimCmd gUnknown_085CE4E8[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_FRAME(1, 8), + ANIMCMD_FRAME(2, 8), + ANIMCMD_FRAME(3, 8), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE50C[] = +{ + ANIMCMD_FRAME(0, 8, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .hFlip = TRUE), + ANIMCMD_FRAME(3, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(2, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(0, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_FRAME(1, 8, .vFlip = TRUE, .hFlip = TRUE), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE530[] = +{ + ANIMCMD_FRAME(0, 8), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE538[] = +{ + gUnknown_085CE4E8, + gUnknown_085CE50C, + gUnknown_085CE530, +}; + +const struct SpriteTemplate gUnknown_085CE544 = +{ + .tileTag = ANIM_TAG_PINK_PETAL, + .paletteTag = ANIM_TAG_PINK_PETAL, + .oam = &gUnknown_08524904, + .anims = gUnknown_085CE538, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C6B0, +}; + +const u16 gUnknown_085CE55C[] = INCBIN_U16("graphics/unknown/unknown_85CE55C.gbapal"); + +const union AnimCmd gUnknown_085CE57C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_FRAME(4, 9), + ANIMCMD_FRAME(8, 5), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE58C[] = +{ + gUnknown_085CE57C, +}; + +const struct SpriteTemplate gUnknown_085CE590 = +{ + .tileTag = ANIM_TAG_PAIN_SPLIT, + .paletteTag = ANIM_TAG_PAIN_SPLIT, + .oam = &gUnknown_0852490C, + .anims = gUnknown_085CE58C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815C95C, +}; + +const struct SpriteTemplate gUnknown_085CE5A8 = +{ + .tileTag = ANIM_TAG_CONFETTI, + .paletteTag = ANIM_TAG_CONFETTI, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CB88, +}; + +const struct SpriteTemplate gUnknown_085CE5C0 = +{ + .tileTag = ANIM_TAG_SPOTLIGHT, + .paletteTag = ANIM_TAG_SPOTLIGHT, + .oam = &gUnknown_085249DC, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE224, + .callback = sub_815CC94, +}; + +const struct SpriteTemplate gBattleAnimSpriteTemplate_85CE5D8 = +{ + .tileTag = ANIM_TAG_BLUE_ORB, + .paletteTag = ANIM_TAG_BLUE_ORB, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815CDB4, +}; + +const union AffineAnimCmd gUnknown_085CE5F0[] = +{ + AFFINEANIMCMD_FRAME(16, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, -3, 0, 16), + AFFINEANIMCMD_FRAME(4, 0, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(-5, 3, 0, 16), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE620[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE640[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE660[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 8, 0, 8), + AFFINEANIMCMD_FRAME(-8, -8, 0, 8), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE680[] = +{ + gUnknown_085CE620, + gUnknown_085CE640, + gUnknown_085CE660, +}; + +const struct SpriteTemplate gUnknown_085CE68C = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE680, + .callback = sub_815D7B4, +}; + +const union AffineAnimCmd gUnknown_085CE6A4[] = +{ + AFFINEANIMCMD_FRAME(0x80, 0x80, 0, 0), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6C4[] = +{ + AFFINEANIMCMD_FRAME(0xC0, 0xC0, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE6E4[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(4, 6, 0, 16), + AFFINEANIMCMD_FRAME(-4, -6, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd gUnknown_085CE704[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(8, 10, 0, 30), + AFFINEANIMCMD_FRAME(-8, -10, 0, 16), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE724[] = +{ + gUnknown_085CE6A4, + gUnknown_085CE6C4, + gUnknown_085CE6E4, + gUnknown_085CE704, +}; + +const struct SpriteTemplate gUnknown_085CE734 = +{ + .tileTag = ANIM_TAG_PINK_CLOUD, + .paletteTag = ANIM_TAG_PINK_CLOUD, + .oam = &gUnknown_085249D4, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE724, + .callback = sub_815D870, +}; + +const union AffineAnimCmd gUnknown_085CE74C[] = +{ + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_FRAME(16, -16, 0, 12), + AFFINEANIMCMD_FRAME(-16, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE76C = +{ + .tileTag = ANIM_TAG_SWEAT_DROP, + .paletteTag = ANIM_TAG_SWEAT_DROP, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815DEBC, +}; + +const u16 gUnknown_085CE784[] = INCBIN_U16("graphics/battle_anims/sprites/effect.gbapal"); + +const union AnimCmd gUnknown_085CE7B4[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(16, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd gUnknown_085CE7C0[] = +{ + ANIMCMD_FRAME(32, 3), + ANIMCMD_FRAME(48, 3), + ANIMCMD_JUMP(0), +}; + +const union AnimCmd *const gUnknown_085CE7CC[] = +{ + gUnknown_085CE7B4, + gUnknown_085CE7C0, +}; + +const struct SpriteTemplate gUnknown_085CE7D4 = +{ + .tileTag = ANIM_TAG_NOISE_LINE, + .paletteTag = ANIM_TAG_NOISE_LINE, + .oam = &gUnknown_08524914, + .anims = gUnknown_085CE7CC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E01C, +}; + +const struct SpriteTemplate gUnknown_085CE7EC = +{ + .tileTag = ANIM_TAG_SMALL_RED_EYE, + .paletteTag = ANIM_TAG_SMALL_RED_EYE, + .oam = &gUnknown_08524904, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E404, +}; + +const struct SpriteTemplate gUnknown_085CE804 = +{ + .tileTag = ANIM_TAG_PAW_PRINT, + .paletteTag = ANIM_TAG_PAW_PRINT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E444, +}; + +const union AffineAnimCmd gUnknown_085CE81C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE82C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, -64, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 24), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE844[] = +{ + gUnknown_085CE81C, + gUnknown_085CE82C, +}; + +const struct SpriteTemplate gUnknown_085CE84C = +{ + .tileTag = ANIM_TAG_RED_BALL, + .paletteTag = ANIM_TAG_RED_BALL, + .oam = &gUnknown_08524974, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE844, + .callback = SpriteCallbackDummy, +}; + +const struct SpriteTemplate gUnknown_085CE864 = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E6D8, +}; + +const union AffineAnimCmd gUnknown_085CE87C[] = +{ + AFFINEANIMCMD_FRAME(0, -16, 0, 6), + AFFINEANIMCMD_FRAME(0, 16, 0, 6), + AFFINEANIMCMD_END, +}; + +const struct SpriteTemplate gUnknown_085CE894 = +{ + .tileTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .paletteTag = ANIM_TAG_SMELLINGSALT_EFFECT, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815E954, +}; + +const struct SpriteTemplate gUnknown_085CE8AC = +{ + .tileTag = ANIM_TAG_TAG_HAND, + .paletteTag = ANIM_TAG_TAG_HAND, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EA14, +}; + +const struct SpriteTemplate gUnknown_085CE8C4 = +{ + .tileTag = ANIM_TAG_MAGNIFYING_GLASS, + .paletteTag = ANIM_TAG_MAGNIFYING_GLASS, + .oam = &gUnknown_08524A34, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815EE84, +}; + +const struct SpriteTemplate gUnknown_085CE8DC = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F18C, +}; + +const struct SpriteTemplate gUnknown_085CE8F4 = +{ + .tileTag = ANIM_TAG_GOLD_STARS, + .paletteTag = ANIM_TAG_GOLD_STARS, + .oam = &gUnknown_0852490C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81061C4, +}; + +const struct SpriteTemplate gUnknown_085CE90C = +{ + .tileTag = ANIM_TAG_X_SIGN, + .paletteTag = ANIM_TAG_X_SIGN, + .oam = &gUnknown_0852491C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815F48C, +}; + +const struct SpriteTemplate gUnknown_085CE924 = +{ + .tileTag = ANIM_TAG_ITEM_BAG, + .paletteTag = ANIM_TAG_ITEM_BAG, + .oam = &gUnknown_08524914, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_815FE80, +}; + +const union AnimCmd gUnknown_085CE93C[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(64, 4), + ANIMCMD_END, +}; + +const union AnimCmd *const gUnknown_085CE948[] = +{ + gUnknown_085CE93C, +}; + +const union AffineAnimCmd gUnknown_085CE94C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, -4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_085CE964[] = +{ + AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0, 0, 4, 8), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_085CE97C[] = +{ + gUnknown_085CE94C, + gUnknown_085CE964, +}; + +const struct SpriteTemplate gUnknown_085CE984 = +{ + .tileTag = ANIM_TAG_SLAM_HIT_2, + .paletteTag = ANIM_TAG_SLAM_HIT_2, + .oam = &gUnknown_0852497C, + .anims = gUnknown_085CE948, + .images = NULL, + .affineAnims = gUnknown_085CE97C, + .callback = sub_8160338, +}; + +const union AffineAnimCmd gUnknown_085CE99C[] = +{ + AFFINEANIMCMD_FRAME(0, 0, -4, 64), + AFFINEANIMCMD_JUMP(0), +}; + +const union AffineAnimCmd *const gUnknown_085CE9AC[] = +{ + gUnknown_085CE99C, +}; + +const struct SpriteTemplate gUnknown_085CE9B0 = +{ + .tileTag = ANIM_TAG_RECYCLE, + .paletteTag = ANIM_TAG_RECYCLE, + .oam = &gUnknown_08524A9C, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_085CE9AC, + .callback = sub_81603A8, +}; + +const union AffineAnimCmd gUnknown_085CE9C8[] = +{ + AFFINEANIMCMD_FRAME(0, 16, 0, 4), + AFFINEANIMCMD_FRAME(-2, 0, 0, 8), + AFFINEANIMCMD_FRAME(0, 4, 0, 4), + AFFINEANIMCMD_FRAME(0, 0, 0, 24), + AFFINEANIMCMD_FRAME(1, -5, 0, 16), + AFFINEANIMCMD_END, +}; + +void sub_815A0D4(struct Sprite *sprite) +{ + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + + if (!gBattleAnimArgs[3]) + sprite->data[0] = gBattleAnimArgs[2]; + else + sprite->data[0] = -gBattleAnimArgs[2]; + + sprite->data[1] = gBattleAnimArgs[4]; + sprite->callback = sub_815A114; +} + +static void sub_815A114(struct Sprite *sprite) +{ + if (sprite->data[1] > 0) + { + sprite->pos2.x = sprite->data[2] >> 8; + sprite->data[2] += sprite->data[0]; + sprite->invisible ^= 1; + sprite->data[1]--; + } + else + { + DestroyAnimSprite(sprite); + } +} + +void sub_815A160(u8 taskId) +{ + sub_807521C( + GetBattlerSpriteCoord(gBattleAnimTarget, 2) + 8, + GetBattlerSpriteCoord(gBattleAnimTarget, 3) + 8, + 0); + DestroyAnimVisualTask(taskId); +} + +void sub_815A1B0(struct Sprite *sprite) +{ + sprite->data[0] = 90; + sprite->callback = WaitAnimForDuration; + sprite->data[1] = 7; + StoreSpriteCallbackInData6(sprite, sub_815A1F4); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); +} + +static void sub_815A1F4(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], 16 - sprite->data[1])); + if (--sprite->data[1] < 0) + { + sprite->invisible = 1; + sprite->callback = sub_815A234; + } +} + +static void sub_815A234(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); +} + +void sub_815A254(struct Sprite *sprite) +{ + u16 rotation; + u8 x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + u8 y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + + sub_80A6980(sprite, TRUE); + + rotation = ArcTan2Neg(sprite->pos1.x - x, sprite->pos1.y - y); + rotation += 0x6000; + if (IsContest()) + rotation += 0x4000; + + TrySetSpriteRotScale(sprite, FALSE, 0x100, 0x100, rotation); + + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[2] = x; + sprite->data[4] = y; + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_815A2F0(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + sprite->data[0] = 4; + sprite->callback = sub_815A31C; +} + +static void sub_815A31C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0])); + + if (sprite->data[1]) + sprite->data[0]--; + else + sprite->data[0]++; + + if (sprite->data[0] == 15 || sprite->data[0] == 4) + sprite->data[1] ^= 1; + + if (sprite->data[2]++ > 70) + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + StartSpriteAffineAnim(sprite, 1); + sprite->data[2] = 0; + sprite->invisible = 1; + sprite->affineAnimPaused = 1; + sprite->callback = sub_815A3AC; + } +} + +static void sub_815A3AC(struct Sprite *sprite) +{ + if (sprite->data[2]++ > 9) + { + sprite->invisible = 0; + sprite->affineAnimPaused = 0; + if (sprite->affineAnimEnded) + sprite->callback = sub_815A3F0; + } +} + +static void sub_815A3F0(struct Sprite *sprite) +{ + switch (sprite->data[3]) + { + case 0: + case 1: + sprite->pos2.x = 1; + sprite->pos2.y = 0; + break; + case 2: + case 3: + sprite->pos2.x = -1; + sprite->pos2.y = 0; + break; + case 4: + case 5: + sprite->pos2.x = 0; + sprite->pos2.y = 1; + break; + case 6: + default: + sprite->pos2.x = 0; + sprite->pos2.y = -1; + break; + } + + if (++sprite->data[3] > 7) + sprite->data[3] = 0; + + if (sprite->data[4]++ > 15) + { + sprite->data[0] = 16; + sprite->data[1] = 0; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 0)); + sprite->callback = sub_815A49C; + } +} + +static void sub_815A49C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[0], 16 - sprite->data[0])); + + if (sprite->data[1]++ > 1) + { + sprite->data[0]--; + sprite->data[1] = 0; + } + + if (sprite->data[0] == 0) + sprite->invisible = 1; + + if (sprite->data[0] < 0) + { + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimSprite(sprite); + } +} + +void sub_815A504(u8 taskId) +{ + gTasks[taskId].func = sub_815A52C; + gAnimVisualTaskCount--; +} + +static void sub_815A52C(u8 taskId) +{ + int i; + u16 lastColor; + u8 paletteIndex = sub_80A6D94(); + + if (++gTasks[taskId].data[5] == 4) + { + lastColor = gPlttBufferFaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferFaded[paletteIndex * 16 + i + 1] = gPlttBufferFaded[paletteIndex * 16 + i]; + + gPlttBufferFaded[paletteIndex * 16 + 1] = lastColor; + gTasks[taskId].data[5] = 0; + } + + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + DestroyTask(taskId); +} + +void sub_815A5C8(u8 taskId) +{ + gTasks[taskId].func = sub_815A5F0; + gAnimVisualTaskCount--; +} + +static void sub_815A5F0(u8 taskId) +{ + int i; + u16 lastColor; + u8 paletteIndex = sub_80A6D94(); + + if (++gTasks[taskId].data[5] == 4) + { + lastColor = gPlttBufferFaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferFaded[paletteIndex * 16 + i + 1] = gPlttBufferFaded[paletteIndex * 16 + i]; + gPlttBufferFaded[paletteIndex * 16 + 1] = lastColor; + + lastColor = gPlttBufferUnfaded[paletteIndex * 16 + 11]; + for (i = 10; i > 0; i--) + gPlttBufferUnfaded[paletteIndex * 16 + i + 1] = gPlttBufferUnfaded[paletteIndex * 16 + i]; + gPlttBufferUnfaded[paletteIndex * 16 + 1] = lastColor; + + gTasks[taskId].data[5] = 0; + } + + if ((u16)gBattleAnimArgs[7] == 0xFFFF) + DestroyTask(taskId); +} + +void sub_815A6C4(struct Sprite *sprite) +{ + u16 x; + u16 y; + + InitAnimSpritePos(sprite, TRUE); + SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattleAnimArgs[2] = -gBattleAnimArgs[2]; + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[2] = x + gBattleAnimArgs[2]; + sprite->data[4] = y + gBattleAnimArgs[3]; + sprite->data[5] = -50; + + InitAnimArcTranslation(sprite); + sprite->callback = sub_815A73C; +} + +static void sub_815A73C(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + { + sprite->data[0] = 30; + sprite->data[1] = 0; + sprite->callback = WaitAnimForDuration; + StoreSpriteCallbackInData6(sprite, sub_815A76C); + } +} + +static void sub_815A76C(struct Sprite *sprite) +{ + if (sprite->data[1] & 1) + sprite->invisible ^= 1; + + if (++sprite->data[1] == 16) + DestroyAnimSprite(sprite); +} + +void sub_815A7B0(struct Sprite *sprite) +{ + SetSpriteCoordsToAnimAttackerCoords(sprite); + sub_80A6864(sprite, gBattleAnimArgs[0]); + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->callback = RunStoredCallbackWhenAnimEnds; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +// This is likely fakematching due to some strange type casting behavior. +void sub_815A7EC(struct Sprite *sprite) +{ + int var0; + int var1; + if (sprite->data[0] == 0) + { + SetSpriteCoordsToAnimAttackerCoords(sprite); + sub_80A6864(sprite, gBattleAnimArgs[0]); + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[3]; + } + else + { + var1 = -gBattleAnimArgs[2]; + sprite->data[1] = var1; + var1 = -gBattleAnimArgs[3]; + sprite->data[2] = var1; + } + } + else + { + var1 = -gBattleAnimArgs[2]; + sprite->data[1] = var1; + sprite->data[2] = gBattleAnimArgs[3]; + } + } + + sprite->data[0]++; + var0 = (sprite->data[0] * 20) & 0xFF; + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x = (sprite->data[3] + (s32)((u32)sprite->data[3] >> 31)) >> 1; + sprite->pos2.y = Sin(var0 & 0xFF, 5) + ((s32)(sprite->data[4] + ((u32)sprite->data[4] >> 31)) >> 1); + + if ((u16)(sprite->pos1.x + sprite->pos2.x) > 240) + DestroyAnimSprite(sprite); +} + +void sub_815A8AC(struct Sprite *sprite) +{ + if (sprite->animEnded) + DestroyAnimSprite(sprite); +} + +void AnimTask_IsTargetPlayerSide(u8 taskId) +{ + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) + gBattleAnimArgs[7] = 0; + else + gBattleAnimArgs[7] = 1; + + DestroyAnimVisualTask(taskId); +} + +void AnimTask_IsHealingMove(u8 taskId) +{ + if (gAnimMoveDmg > 0) + gBattleAnimArgs[7] = 0; + else + gBattleAnimArgs[7] = 1; + + DestroyAnimVisualTask(taskId); +} + +void sub_815A934(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sub_80A6980(sprite, FALSE); + + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = 1; + sprite->callback = sub_815A9A0; +} + +static void sub_815A9A0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->invisible = 0; + if (sprite->affineAnimEnded) + sprite->data[0]++; + break; + case 1: + case 3: + sprite->data[1] += 117; + sprite->pos2.x = sprite->data[1] >> 8; + if (++sprite->data[2] == 21) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1] -= 117; + sprite->pos2.x = sprite->data[1] >> 8; + if (++sprite->data[2] == 41) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 4: + ChangeSpriteAffineAnim(sprite, 1); + sprite->data[0]++; + break; + case 5: + if (sprite->affineAnimEnded) + { + sprite->invisible = 1; + sprite->callback = sub_815AA6C; + } + break; + } +} + +static void sub_815AA6C(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); + SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) ^ DISPCNT_OBJWIN_ON); + DestroyAnimSprite(sprite); +} + +void sub_815AAA4(struct Sprite *sprite) +{ + if (gBattleAnimArgs[3] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + } + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->oam.tileNum += 16; + + if (gBattleAnimArgs[2] == 0) + { + sprite->oam.matrixNum = 8; + sprite->pos2.x = -12; + sprite->data[1] = 2; + } + else + { + sprite->pos2.x = 12; + sprite->data[1] = -2; + } + + sprite->data[0] = gBattleAnimArgs[4]; + + if (sprite->data[3] != 255) + sprite->data[3] = gBattleAnimArgs[2]; + + sprite->callback = sub_815AB5C; +} + +static void sub_815AB5C(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->pos2.x += sprite->data[1]; + if (sprite->pos2.x == 0) + { + sprite->data[2]++; + if (sprite->data[3] == 0) + { + PlaySE1WithPanning(SE_W227, BattleAnimAdjustPanning(-64)); + } + } + } + else + { + sprite->pos2.x -= sprite->data[1]; + if (abs(sprite->pos2.x) == 12) + { + sprite->data[0]--; + sprite->data[2]--; + } + + } + + if (sprite->data[0] == 0) + DestroyAnimSprite(sprite); +} + +void sub_815ABD0(struct Sprite *sprite) +{ + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->data[3] = 255; + sub_815AAA4(sprite); +} + +void sub_815ABEC(u8 taskId) +{ + if (IsContest()) + { + SetGpuReg(REG_OFFSET_WININ, 0x1F3F); + gBattle_WIN1H = 0x98F0; + gBattle_WIN1V = 0x00A0; + SetGpuReg(REG_OFFSET_WIN1H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN0V); + } + else + { + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ); + gBattle_WIN1H = 0x00F0; + gBattle_WIN1V = 0x78A0; + SetGpuReg(REG_OFFSET_WIN1H, 0x00F0); + SetGpuReg(REG_OFFSET_WIN1V, gBattle_WIN1V); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); + } + + DestroyAnimVisualTask(taskId); +} + +void sub_815AC8C(u8 taskId) +{ + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); + gBattle_WIN1H = 0; + gBattle_WIN1V = 0; + if (!IsContest()) + ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON); + + DestroyAnimVisualTask(taskId); +} + +void sub_815ACD0(struct Sprite *sprite) +{ + int var0; + if (gBattleAnimArgs[0] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + } + + sprite->pos2.y = gBattleAnimArgs[2]; + var0 = 0; + if (sprite->pos2.y > gBattleAnimArgs[3]) + var0 = 1; + + sprite->data[0] = var0; + sprite->data[1] = 0; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->callback = sub_815AD4C; +} + +static void sub_815AD4C(struct Sprite *sprite) +{ + sprite->data[1] = (sprite->data[1] + sprite->data[2]) & 0xFF; + sprite->pos2.x = gSineTable[sprite->data[1]] >> 4; + sprite->pos2.y += sprite->data[3]; + + if (sprite->data[0]) + { + if (sprite->pos2.y < sprite->data[4]) + DestroyAnimSprite(sprite); + } + else + { + if (sprite->pos2.y > sprite->data[4]) + DestroyAnimSprite(sprite); + } +} + +void sub_815ADB0(u8 taskId) +{ + s16 var0; + u8 toBG2; + s16 var2; + int var3; + int var4; + s16 i; + struct ScanlineEffectParams scanlineParams; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[0]) + { + var0 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); + toBG2 = sub_80A8364(gBattleAnimAttacker); + } + else + { + var0 = GetBattlerYCoordWithElevation(gBattleAnimTarget); + toBG2 = sub_80A8364(gBattleAnimTarget); + } + + task->data[0] = var0 + 36; + task->data[1] = task->data[0]; + task->data[2] = var0 - 33; + if (task->data[2] < 0) + task->data[2] = 0; + + task->data[3] = task->data[0]; + task->data[4] = 8; + task->data[5] = gBattleAnimArgs[1]; + task->data[6] = 0; + task->data[7] = 0; + + if (toBG2 == 1) + { + var3 = gBattle_BG1_X; + task->data[8] = var3; + var4 = var3 + 240; + } + else + { + var3 = gBattle_BG2_X; + task->data[8] = var3; + var4 = var3 + 240; + } + + task->data[9] = var4; + task->data[10] = gBattleAnimArgs[2]; + + if (!gBattleAnimArgs[2]) + { + task->data[11] = var4; + var2 = task->data[8]; + } + else + { + task->data[11] = var3; + var2 = task->data[9]; + } + + task->data[15] = 0; + + i = task->data[2]; + while (i <= task->data[3]) + { + gScanlineEffectRegBuffers[0][i] = var2; + gScanlineEffectRegBuffers[1][i] = var2; + i++; + } + + if (toBG2 == 1) + scanlineParams.dmaDest = ®_BG1HOFS; + else + scanlineParams.dmaDest = ®_BG2HOFS; + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + + task->func = sub_815AED8; +} + +static void sub_815AED8(u8 taskId) +{ + s16 i; + struct Task *task = &gTasks[taskId]; + + task->data[0] -= task->data[5]; + if (task->data[0] < task->data[2]) + task->data[0] = task->data[2]; + + if (task->data[4] == 0) + { + task->data[1] -= task->data[5]; + if (task->data[1] < task->data[2]) + { + task->data[1] = task->data[2]; + task->data[15] = 1; + } + } + else + { + task->data[4]--; + } + + if (++task->data[6] > 1) + { + task->data[6] = 0; + task->data[7] = task->data[7] == 0 ? 1 : 0; + + if (task->data[7]) + task->data[12] = task->data[8]; + else + task->data[12] = task->data[9]; + } + + i = task->data[0]; + while (i < task->data[1]) + { + gScanlineEffectRegBuffers[0][i] = task->data[12]; + gScanlineEffectRegBuffers[1][i] = task->data[12]; + i++; + } + + i = task->data[1]; + while (i <= task->data[3]) + { + gScanlineEffectRegBuffers[0][i] = task->data[11]; + gScanlineEffectRegBuffers[1][i] = task->data[11]; + i++; + } + + if (task->data[15]) + { + if (task->data[10]) + gScanlineEffect.state = 3; + + DestroyAnimVisualTask(taskId); + } +} + +void sub_815AFF0(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[3] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[4] = 32; + task->data[5] = -20; + task->data[6] = 0; + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + task->func = sub_815B054; +} + +static void sub_815B054(u8 taskId) +{ + int var0, var1; + s16 x, y; + u16 i, j; + u8 spriteId; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + var0 = task->data[2]; + if (task->data[1] & 1) + { + var1 = task->data[4]; + x = var0 - var1; + } + else + { + var1 = task->data[4]; + x = var0 + var1; + } + + y = task->data[3] + task->data[5]; + spriteId = CreateSprite(&gUnknown_08593114, x, y, 6 - task->data[1]); + PlaySE12WithPanning(SE_W118, BattleAnimAdjustPanning(-64)); + + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].hFlip = task->data[1] & 1; + gSprites[spriteId].callback = SpriteCallbackDummy; + } + + if (task->data[1] & 1) + { + task->data[4] -= 6; + task->data[5] -= 6; + } + + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE2A0); + task->data[1]++; + task->data[0] = 1; + break; + case 1: + if (!RunAffineAnimFromTaskData(task)) + { + if (task->data[1] == 6) + { + task->data[6] = 8; + task->data[0] = 3; + } + else + { + if (task->data[1] <= 2) + task->data[6] = 10; + else + task->data[6] = 0; + + task->data[0] = 2; + } + } + break; + case 2: + if (task->data[6] != 0) + task->data[6]--; + else + task->data[0] = 0; + break; + case 3: + if (task->data[6] != 0) + task->data[6]--; + else + task->data[0] = 4; + break; + case 4: + for (i = 0, j = 0; i < MAX_SPRITES; i++) + { + if (gSprites[i].template == &gUnknown_08593114) + { + gSprites[i].data[0] = taskId; + gSprites[i].data[1] = 6; + StartSpriteAnim(&gSprites[i], 2); + gSprites[i].callback = sub_815B23C; + + if (++j == 6) + break; + } + } + + task->data[6] = j; + task->data[0] = 5; + break; + case 5: + if (task->data[6] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815B23C(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + gTasks[sprite->data[0]].data[sprite->data[1]]--; + DestroySprite(sprite); + } +} + +void sub_815B27C(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + InitAnimSpritePos(sprite, FALSE); + + if (++sprite->data[0] < 40) + { + u16 var = sprite->data[0]; + if ((var & 1) == 0) + sprite->invisible = 1; + else + sprite->invisible = 0; + } + + if (sprite->data[0] > 30) + sprite->invisible = 0; + + if (sprite->data[0] == 61) + { + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[0] = 20; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->callback = StartAnimLinearTranslation; + } +} + +void sub_815B338(u8 taskId) +{ + switch (gTasks[taskId].data[0]) + { + case 0: + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE350); + gTasks[taskId].data[0]++; + break; + case 1: + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815B394(struct Sprite *sprite) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); + sprite->data[1] = 256; + sprite->data[2] = 256; + sprite->data[0]++; + break; + case 1: + sprite->data[1] += 96; + sprite->data[2] -= 26; + SetSpriteRotScale(spriteId, sprite->data[1], sprite->data[2], 0); + + if (++sprite->data[3] == 5) + sprite->data[0]++; + // fall through + case 2: + sprite->data[1] += 96; + sprite->data[2] += 48; + SetSpriteRotScale(spriteId, sprite->data[1], sprite->data[2], 0); + + if (++sprite->data[3] == 9) + { + sprite->data[3] = 0; + gSprites[spriteId].invisible = 1; + ResetSpriteRotScale(spriteId); + sprite->data[0]++; + } + break; + case 3: + sprite->pos2.y -= 6; + if (sprite->pos1.y + sprite->pos2.y < -32) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815B49C(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x = -16; + else + sprite->pos1.x = 256; + + sprite->pos1.y = 0; + sprite->callback = sub_815B4D4; +} + +static void sub_815B4D4(struct Sprite *sprite) +{ + u32 newX; + + sprite->data[0] += 72; + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos2.x = sprite->data[0] >> 4; + else + sprite->pos2.x = -(sprite->data[0] >> 4); + + sprite->data[1] += 16; + sprite->pos2.y += sprite->data[1] >> 8; + + if (++sprite->data[2] % 3 == 0) + { + CreateSpriteAndAnimate( + &gUnknown_085CE3A0, + sprite->pos1.x + sprite->pos2.x, + sprite->pos1.y + sprite->pos2.y, + sprite->subpriority + 1); + } + + newX = sprite->pos1.x + sprite->pos2.x + 32; + if (newX > 304) + DestroyAnimSprite(sprite); +} + +void sub_815B570(struct Sprite *sprite) +{ + u8 rand; + s8 y; + + rand = Random2() & 3; + if (rand == 0) + sprite->oam.tileNum += 4; + else + sprite->oam.tileNum += 5; + + y = Random2() & 7; + if (y > 3) + y = -y; + + sprite->pos2.y = y; + sprite->callback = sub_815B5D0; +} + +static void sub_815B5D0(struct Sprite *sprite) +{ + if (++sprite->data[0] < 30) + { + if (++sprite->data[1] == 2) + { + sprite->invisible ^= 1; + sprite->data[1] = 0; + } + } + else + { + if (sprite->data[1] == 2) + sprite->invisible = 0; + + if (sprite->data[1] == 3) + { + sprite->invisible = 1; + sprite->data[1] = -1; + } + + sprite->data[1]++; + } + + if (sprite->data[0] > 60) + DestroySprite(sprite); +} + +void sub_815B65C(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE3B8); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B6B4(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE3E0); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B70C(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + InitAnimSpritePos(sprite, FALSE); + sprite->data[1] = 0x900; + sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0]++; + break; + case 1: + sprite->pos2.y -= sprite->data[1] >> 8; + sprite->data[1] -= 96; + if (sprite->pos1.y + sprite->pos2.y > sprite->data[2]) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815B778(u8 taskId) +{ + if (!gTasks[taskId].data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(ANIM_ATTACKER), gUnknown_085CE430); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815B7D0(u8 taskId) +{ + int i, j; + u8 position; + struct UnknownAnimStruct2 unknownStruct; + u8 *dest; + u8 *src; + u16 *unk4; + u16 stretch; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_MOSAIC, 0); + if (sub_80A8364(gBattleAnimAttacker) == 1) + SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 1); + else + SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 1); + + gTasks[taskId].data[10] = gBattleAnimArgs[0]; + gTasks[taskId].data[0]++; + break; + case 1: + if (gTasks[taskId].data[2]++ > 1) + { + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[1]++; + stretch = gTasks[taskId].data[1]; + SetGpuReg(REG_OFFSET_MOSAIC, (stretch << 4) | stretch); + if (stretch == 15) + gTasks[taskId].data[0]++; + } + break; + case 2: + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, gTasks[taskId].data[10]); + sub_80A6BFC(&unknownStruct, gBattleAnimAttacker); + + if (IsContest()) + position = 0; + else + position = GetBattlerPosition(gBattleAnimAttacker); + + src = gMonSpritesGfxPtr->sprites[position] + (gBattleMonForms[gBattleAnimAttacker] << 11); + dest = unknownStruct.bgTiles; + CpuCopy32(src, dest, 0x800); + LoadBgTiles(1, unknownStruct.bgTiles, 0x800, unknownStruct.tilesOffset); + if (IsContest()) + { + if (IsSpeciesNotUnown(gContestResources->field_18->species) != IsSpeciesNotUnown(gContestResources->field_18->unk2)) + { + unk4 = (u16 *)unknownStruct.unk4; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 4; j++) + { + u16 temp = unk4[j + i * 0x20]; + unk4[j + i * 0x20] = unk4[(7 - j) + i * 0x20]; + unk4[(7 - j) + i * 0x20] = temp; + } + } + + for (i = 0; i < 8; i++) + { + for (j = 0; j < 8; j++) + { + unk4[j + i * 0x20] ^= 0x400; + } + } + } + + if (IsSpeciesNotUnown(gContestResources->field_18->unk2)) + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0; + else + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF694; + + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); + } + + gTasks[taskId].data[0]++; + break; + case 3: + if (gTasks[taskId].data[2]++ > 1) + { + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[1]--; + stretch = gTasks[taskId].data[1]; + SetGpuReg(REG_OFFSET_MOSAIC, (stretch << 4) | stretch); + + if (stretch == 0) + gTasks[taskId].data[0]++; + } + break; + case 4: + SetGpuReg(REG_OFFSET_MOSAIC, 0); + if (sub_80A8364(gBattleAnimAttacker) == 1) + SetAnimBgAttribute(1, BG_ANIM_MOSAIC, 0); + else + SetAnimBgAttribute(2, BG_ANIM_MOSAIC, 0); + + if (!IsContest()) + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + { + if (gTasks[taskId].data[10] == 0) + SetBattlerShadowSpriteCallback(gBattleAnimAttacker, gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].transformSpecies); + } + } + + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815BB18(u8 taskId) +{ + gBattleAnimArgs[7] = gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].invisible; + DestroyAnimVisualTask(taskId); +} + +void sub_815BB58(u8 taskId) +{ + HandleSpeciesGfxDataChange(gBattleAnimAttacker, gBattleAnimTarget, TRUE); + DestroyAnimVisualTask(taskId); +} + +void sub_815BB84(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + sub_80A6B30(&unknownStruct); + sub_80A6D60(&unknownStruct, &gUnknown_08C2A6EC, 0); + if (IsContest()) + { + gBattle_BG1_X = -56; + gBattle_BG1_Y = 0; + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + gBattle_BG1_X = -135; + else + gBattle_BG1_X = -10; + + gBattle_BG1_Y = 0; + } + + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + + gTasks[taskId].data[10] = gBattle_BG1_X; + gTasks[taskId].data[11] = gBattle_BG1_Y; + + gTasks[taskId].data[0]++; + PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64)); + break; + case 1: + if (gTasks[taskId].data[4]++ > 0) + { + gTasks[taskId].data[4] = 0; + if (++gTasks[taskId].data[1] > 12) + gTasks[taskId].data[1] = 12; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + if (gTasks[taskId].data[1] == 12) + gTasks[taskId].data[0]++; + } + break; + case 2: + if (--gTasks[taskId].data[1] < 0) + gTasks[taskId].data[1] = 0; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + if (!gTasks[taskId].data[1]) + { + gBattle_BG1_X = gUnknown_085CE460[gTasks[taskId].data[2]] + gTasks[taskId].data[10]; + if (++gTasks[taskId].data[2] == 4) + gTasks[taskId].data[0] = 4; + else + gTasks[taskId].data[0] = 3; + } + break; + case 3: + if (++gTasks[taskId].data[3] == 4) + { + gTasks[taskId].data[3] = 0; + gTasks[taskId].data[0] = 1; + PlaySE12WithPanning(SE_W234, BattleAnimAdjustPanning(-64)); + } + break; + case 4: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815BE04(struct Sprite *sprite) +{ + s16 xOffset; + u8 spriteId1; + u8 spriteId2; + + xOffset = Random2(); + xOffset &= 0x3F; + if (xOffset > 31) + xOffset = 32 - xOffset; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + xOffset; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; + sprite->data[1] = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + + spriteId1 = CreateSprite(&gUnknown_085CE48C, sprite->pos1.x, sprite->pos1.y, sprite->subpriority + 1); + spriteId2 = CreateSprite(&gUnknown_085CE48C, sprite->pos1.x, sprite->pos1.y, sprite->subpriority + 1); + StartSpriteAnim(&gSprites[spriteId1], 1); + StartSpriteAnim(&gSprites[spriteId2], 2); + + gSprites[spriteId1].data[1] = gBattleAnimArgs[0]; + gSprites[spriteId1].data[2] = gBattleAnimArgs[1]; + gSprites[spriteId2].data[1] = gBattleAnimArgs[0]; + gSprites[spriteId2].data[2] = gBattleAnimArgs[1]; + gSprites[spriteId1].data[7] = -1; + gSprites[spriteId2].data[7] = -1; + gSprites[spriteId1].invisible = 1; + gSprites[spriteId2].invisible = 1; + gSprites[spriteId1].callback = sub_815C050; + gSprites[spriteId2].callback = sub_815C050; + + sprite->data[6] = spriteId1; + sprite->data[7] = spriteId2; + sprite->callback = sub_815BF44; +} + +static void sub_815BF44(struct Sprite *sprite) +{ + int var0; + s8 var1; + + var0 = (u16)sprite->data[2] + (u16)sprite->data[3]; + var1 = var0 >> 8; + sprite->pos2.y -= var1; + sprite->data[3] = var0 & 0xFF; + if (sprite->data[4] == 0 && sprite->pos2.y < -8) + { + gSprites[sprite->data[6]].invisible = 0; + sprite->data[4]++; + } + + if (sprite->data[4] == 1 && sprite->pos2.y < -16) + { + gSprites[sprite->data[7]].invisible = 0; + sprite->data[4]++; + } + + if (--sprite->data[1] == -1) + { + sprite->invisible = 1; + sprite->callback = sub_815BFF4; + } +} + +static void sub_815BFF4(struct Sprite *sprite) +{ + if (gSprites[sprite->data[6]].callback == SpriteCallbackDummy + && gSprites[sprite->data[7]].callback == SpriteCallbackDummy) + { + DestroySprite(&gSprites[sprite->data[6]]); + DestroySprite(&gSprites[sprite->data[7]]); + DestroyAnimSprite(sprite); + } +} + +static void sub_815C050(struct Sprite *sprite) +{ + u16 d2; + register u16 d3 asm("r1"); + int var0; + s8 var1; + + if (!sprite->invisible) + { + d2 = sprite->data[2]; + d3 = sprite->data[3]; + var0 = d2 + d3; + var1 = var0 >> 8; + sprite->pos2.y -= var1; + sprite->data[3] = var0 & 0xFF; + if (--sprite->data[1] == -1) + { + sprite->invisible = 1; + sprite->callback = SpriteCallbackDummy; + } + } +} + +void sub_815C0A4(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + switch (gTasks[taskId].data[0]) + { + case 0: + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, 13)); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + sub_80A6B30(&unknownStruct); + sub_80A6D60(&unknownStruct, &gUnknown_08C2A6EC, 0); + if (IsContest()) + { + gBattle_BG1_X = -56; + gBattle_BG1_Y = 0; + } + else + { + u8 position = GetBattlerPosition(gBattleAnimTarget); + if (IsDoubleBattle() == TRUE) + { + if (position == B_POSITION_OPPONENT_LEFT) + gBattle_BG1_X = -155; + if (position == B_POSITION_OPPONENT_RIGHT) + gBattle_BG1_X = -115; + if (position == B_POSITION_PLAYER_LEFT) + gBattle_BG1_X = 14; + if (position == B_POSITION_PLAYER_RIGHT) + gBattle_BG1_X = -20; + } + else + { + if (position == B_POSITION_OPPONENT_LEFT) + gBattle_BG1_X = -135; + if (position == B_POSITION_PLAYER_LEFT) + gBattle_BG1_X = -10; + } + + gBattle_BG1_Y = 0; + } + + sub_80A6CC0(unknownStruct.bgId, &gUnknown_08C2A634, unknownStruct.tilesOffset); + LoadCompressedPalette(&gUnknown_08C2A6D4, unknownStruct.unk8 << 4, 32); + gTasks[taskId].data[10] = gBattle_BG1_X; + gTasks[taskId].data[11] = gBattle_BG1_Y; + gTasks[taskId].data[0]++; + break; + case 1: + gTasks[taskId].data[3] = 0; + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) + gBattle_BG1_X = gTasks[taskId].data[10] + gUnknown_085CE4A4[gTasks[taskId].data[2]]; + else + gBattle_BG1_X = gTasks[taskId].data[10] - gUnknown_085CE4A4[gTasks[taskId].data[2]]; + + if (++gTasks[taskId].data[2] == 5) + gTasks[taskId].data[0] = 5; + else + gTasks[taskId].data[0]++; + break; + case 2: + if (--gTasks[taskId].data[1] <= 4) + gTasks[taskId].data[1] = 5; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 5) + gTasks[taskId].data[0]++; + break; + case 3: + if (++gTasks[taskId].data[3] > gUnknown_085CE4A8[gTasks[taskId].data[2]]) + gTasks[taskId].data[0]++; + break; + case 4: + if (++gTasks[taskId].data[1] > 13) + gTasks[taskId].data[1] = 13; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(3, gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 13) + gTasks[taskId].data[0] = 1; + break; + case 5: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815C3A8(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], GetAnimBattlerSpriteId(0), gUnknown_085CE4B0); + gTasks[taskId].data[0]++; + } + else + { + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); + } +} + +void sub_815C400(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + InitAnimSpritePos(sprite, 0); + sprite->data[0]++; + } + else if (sprite->data[0]++ > 20) + { + sprite->data[1] += 160; + sprite->data[2] += 128; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos2.x = -(sprite->data[1] >> 8); + else + sprite->pos2.x = sprite->data[1] >> 8; + + sprite->pos2.y += sprite->data[2] >> 8; + if (sprite->pos2.y > 64) + DestroyAnimSprite(sprite); + } +} + +void sub_815C478(u8 taskId) +{ + u8 side; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[1]) + { + DestroyAnimVisualTask(taskId); + return; + } + + if (gBattleAnimArgs[2] < 0) + gBattleAnimArgs[2] = 0; + if (gBattleAnimArgs[2] > 2) + gBattleAnimArgs[2] = 2; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 8 - (2 * gBattleAnimArgs[2]); + task->data[4] = 0x100 + (gBattleAnimArgs[2] * 128); + task->data[5] = gBattleAnimArgs[2] + 2; + task->data[6] = gBattleAnimArgs[1] - 1; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + + if (!gBattleAnimArgs[0]) + side = GetBattlerSide(gBattleAnimAttacker); + else + side = GetBattlerSide(gBattleAnimTarget); + + if (side == B_SIDE_OPPONENT) + { + task->data[4] *= -1; + task->data[5] *= -1; + } + + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + task->func = sub_815C548; +} + +static void sub_815C548(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + gSprites[task->data[15]].pos2.x += task->data[5]; + task->data[2] -= task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3]) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 1: + gSprites[task->data[15]].pos2.x -= task->data[5]; + task->data[2] += task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3] * 2) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + gSprites[task->data[15]].pos2.x += task->data[5]; + task->data[2] -= task->data[4]; + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + if (++task->data[1] >= task->data[3]) + { + if (task->data[6]) + { + task->data[6]--; + task->data[1] = 0; + task->data[0] = 0; + } + else + { + task->data[0]++; + } + } + break; + case 3: + ResetSpriteRotScale(task->data[15]); + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815C6B0(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x = 0; + sprite->pos1.y = gBattleAnimArgs[0]; + } + else + { + sprite->pos1.x = 240; + sprite->pos1.y = gBattleAnimArgs[0] - 30; + } + + sprite->data[2] = gBattleAnimArgs[2]; + StartSpriteAnim(sprite, gBattleAnimArgs[1]); + sprite->callback = sub_815C700; +} + +static void sub_815C700(struct Sprite *sprite) +{ + sprite->data[0] += 3; + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + { + sprite->pos1.x += 5; + sprite->pos1.y -= 1; + + if (sprite->pos1.x > 240) + DestroyAnimSprite(sprite); + + sprite->pos2.y = Sin(sprite->data[0] & 0xFF, 16); + } + else + { + sprite->pos1.x -= 5; + sprite->pos1.y += 1; + + if (sprite->pos1.x < 0) + DestroyAnimSprite(sprite); + + sprite->pos2.y = Cos(sprite->data[0] & 0xFF, 16); + } +} + +void sub_815C770(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 0; + task->data[12] = 0x20; + task->data[13] = 0x40; + task->data[14] = 0x800; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + + PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL); + task->func = sub_815C7C4; +} + +static void sub_815C7C4(u8 taskId) +{ + int temp; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[2] += 0x200; + if (task->data[2] >= task->data[14]) + { + s16 diff = task->data[14] - task->data[2]; + s16 div = diff / (task->data[14] * 2); + s16 mod = diff % (task->data[14] * 2); + + if ((div & 1) == 0) + { + task->data[2] = task->data[14] - mod; + task->data[0] = 1; + } + else + { + task->data[2] = mod - task->data[14]; + } + } + break; + case 1: + task->data[2] -= 0x200; + if (task->data[2] <= -task->data[14]) + { + s16 diff = task->data[14] - task->data[2]; + s16 div = diff / (task->data[14] * 2); + s16 mod = diff % (task->data[14] * 2); + + if ((1 & div) == 0) + { + task->data[2] = mod - task->data[14]; + task->data[0] = 0; + } + else + { + task->data[2] = task->data[14] - mod; + } + } + break; + case 2: + ResetSpriteRotScale(task->data[15]); + DestroyAnimVisualTask(taskId); + return; + } + + SetSpriteRotScale(task->data[15], 0x100, 0x100, task->data[2]); + SetBattlerSpriteYOffsetFromRotation(task->data[15]); + gSprites[task->data[15]].pos2.x = -(((temp = task->data[2]) >= 0 ? task->data[2] : temp + 63) >> 6); + + if (++task->data[1] > 8) + { + if (task->data[12]) + { + task->data[12]--; + task->data[14] -= task->data[13]; + if (task->data[14] < 16) + task->data[14] = 16; + } + else + { + task->data[0] = 2; + } + } +} + +void sub_815C95C(struct Sprite *sprite) +{ + if (!sprite->data[0]) + { + if (!gBattleAnimArgs[2]) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + } + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + sprite->data[1] = 0x80; + sprite->data[2] = 0x300; + sprite->data[3] = gBattleAnimArgs[1]; + sprite->data[0]++; + } + else + { + sprite->pos2.x = sprite->data[1] >> 8; + sprite->pos2.y += sprite->data[2] >> 8; + if (sprite->data[4] == 0 && sprite->pos2.y > -sprite->data[3]) + { + sprite->data[4] = 1; + sprite->data[2] = (-sprite->data[2] / 3) * 2; + } + + sprite->data[1] += 192; + sprite->data[2] += 128; + if (sprite->animEnded) + DestroyAnimSprite(sprite); + } +} + +void sub_815CA20(u8 taskId) +{ + u8 spriteId; + + if (gTasks[taskId].data[0] == 0) + { + if (gBattleAnimArgs[0] == 0) + gTasks[taskId].data[11] = gBattleAnimAttacker; + else + gTasks[taskId].data[11] = gBattleAnimTarget; + + spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + gTasks[taskId].data[10] = spriteId; + PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL); + + switch (gBattleAnimArgs[1]) + { + case 0: + SetSpriteRotScale(spriteId, 0xE0, 0x140, 0); + SetBattlerSpriteYOffsetFromYScale(spriteId); + break; + case 1: + SetSpriteRotScale(spriteId, 0xD0, 0x130, 0xF00); + SetBattlerSpriteYOffsetFromYScale(spriteId); + if (IsContest() || GetBattlerSide(gTasks[taskId].data[11]) == B_SIDE_PLAYER) + gSprites[spriteId].pos2.y += 16; + break; + case 2: + SetSpriteRotScale(spriteId, 0xD0, 0x130, 0xF100); + SetBattlerSpriteYOffsetFromYScale(spriteId); + if (IsContest() || GetBattlerSide(gTasks[taskId].data[11]) == B_SIDE_PLAYER) + gSprites[spriteId].pos2.y += 16; + break; + } + + gSprites[spriteId].pos2.x = 2; + gTasks[taskId].data[0]++; + } + else + { + spriteId = gTasks[taskId].data[10]; + if (++gTasks[taskId].data[2] == 3) + { + gTasks[taskId].data[2] = 0; + gSprites[spriteId].pos2.x = -gSprites[spriteId].pos2.x; + } + + if (++gTasks[taskId].data[1] == 13) + { + ResetSpriteRotScale(spriteId); + gSprites[spriteId].pos2.x = 0; + gSprites[spriteId].pos2.y = 0; + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_815CB88(struct Sprite *sprite) +{ + u8 tileOffset; + int rand1; + int rand2; + + tileOffset = Random2() % 12; + sprite->oam.tileNum += tileOffset; + rand1 = Random2() & 0x1FF; + rand2 = Random2() & 0xFF; + + if (rand1 & 1) + sprite->data[0] = 0x5E0 + rand1; + else + sprite->data[0] = 0x5E0 - rand1; + + if (rand2 & 1) + sprite->data[1] = 0x480 + rand2; + else + sprite->data[1] = 0x480 - rand2; + + sprite->data[2] = gBattleAnimArgs[0]; + if (sprite->data[2] == 0) + sprite->pos1.x = -8; + else + sprite->pos1.x = 248; + + sprite->pos1.y = 104; + sprite->callback = sub_815CC34; +} + +static void sub_815CC34(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->pos2.x += sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + else + { + sprite->pos2.x -= sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + + sprite->data[0] -= 22; + sprite->data[1] -= 48; + if (sprite->data[0] < 0) + sprite->data[0] = 0; + + if (++sprite->data[3] == 31) + DestroyAnimSprite(sprite); +} + +void sub_815CC94(struct Sprite *sprite) +{ + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ); + SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJWIN_ON); + gBattle_WIN0H = 0; + gBattle_WIN0V = 0; + SetGpuReg(REG_OFFSET_WIN0H, gBattle_WIN0H); + SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V); + + sprite->data[0] = gBattleAnimArgs[2]; + sub_80A6980(sprite, FALSE); + sprite->oam.objMode = ST_OAM_OBJ_WINDOW; + sprite->invisible = 1; + sprite->callback = sub_815CD0C; +} + +static void sub_815CD0C(struct Sprite *sprite) +{ + switch (sprite->data[1]) + { + case 0: + sprite->invisible = 0; + if (sprite->affineAnimEnded) + sprite->data[1]++; + break; + case 1: + if (--sprite->data[0] == 0) + { + ChangeSpriteAffineAnim(sprite, 1); + sprite->data[1]++; + } + break; + case 2: + if (sprite->affineAnimEnded) + { + sprite->invisible = 1; + sprite->data[1]++; + } + break; + case 3: + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR | WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR); + SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) ^ DISPCNT_OBJWIN_ON); + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815CDB4(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->data[0] = gBattleAnimArgs[0]; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->callback = sub_815CDFC; + sprite->callback(sprite); +} + +static void sub_815CDFC(struct Sprite *sprite) +{ + sprite->pos2.x = Sin(sprite->data[1], sprite->data[2] >> 8); + sprite->pos2.y = Cos(sprite->data[1], sprite->data[3] >> 8); + sprite->data[1] = (sprite->data[1] + 9) & 0xFF; + + if ((u16)sprite->data[1] < 64 || sprite->data[1] > 195) + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1; + else + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1; + + if (!sprite->data[5]) + { + sprite->data[2] += 0x400; + sprite->data[3] += 0x100; + sprite->data[4]++; + if (sprite->data[4] == sprite->data[0]) + { + sprite->data[4] = 0; + sprite->data[5] = 1; + } + } + else if (sprite->data[5] == 1) + { + sprite->data[2] -= 0x400; + sprite->data[3] -= 0x100; + sprite->data[4]++; + if (sprite->data[4] == sprite->data[0]) + DestroyAnimSprite(sprite); + } +} + + + +extern void sub_815D160(u8); + +void sub_815CED8(u8 taskId) +{ + u8 isBackPic; + u32 personality; + u32 otId; + u16 species; + s16 xOffset; + u32 priority; + u8 spriteId; + s16 coord1, coord2; + + GetAnimBattlerSpriteId(ANIM_ATTACKER); + if (IsContest()) + { + isBackPic = 1; + personality = gContestResources->field_18->unk10; + otId = gContestResources->field_18->unkC; + species = gContestResources->field_18->unk2; + xOffset = 20; + priority = sub_80A8328(gBattleAnimAttacker); + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + isBackPic = 0; + personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY); + otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID); + if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE) + { + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + else + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + } + else + { + species = gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies; + } + + xOffset = 20; + priority = sub_80A8328(gBattleAnimAttacker); + } + else + { + isBackPic = 1; + personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY); + otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID); + if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE) + { + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + else + species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES); + } + else + { + species = gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies; + } + + xOffset = -20; + priority = sub_80A8328(gBattleAnimAttacker); + } + } + + coord1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + coord2 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + spriteId = sub_80A8394(species, isBackPic, 0, coord1 + xOffset, coord2, 5, personality, otId, gBattleAnimTarget, 1); + + gSprites[spriteId].oam.priority = priority; + gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND; + FillPalette(RGB(31, 31, 31), (gSprites[spriteId].oam.paletteNum << 4) + 0x100, 32); + gSprites[spriteId].oam.priority = priority; + SetGpuReg(REG_OFFSET_BLDCNT, 0x3F40); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + + gTasks[taskId].data[0] = spriteId; + gTasks[taskId].func = sub_815D160; +} + +void sub_815D160(u8 taskId) +{ + if (gTasks[taskId].data[10]++ > 1) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[1]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1])); + if (gTasks[taskId].data[1] == 10) + { + gTasks[taskId].data[10] = 256; + gTasks[taskId].data[11] = 256; + gTasks[taskId].func = sub_815D1BC; + } + } +} + +static void sub_815D1BC(u8 taskId) +{ + u8 spriteId = gTasks[taskId].data[0]; + gTasks[taskId].data[10] -= 16; + gTasks[taskId].data[11] += 128; + gSprites[spriteId].oam.affineMode |= ST_OAM_AFFINE_DOUBLE_MASK; + TrySetSpriteRotScale(&gSprites[spriteId], TRUE, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); + if (++gTasks[taskId].data[12] == 9) + { + sub_80A749C(&gSprites[spriteId]); + sub_80A8610(&gSprites[spriteId]); + gTasks[taskId].func = sub_80A6814; + } +} + +void sub_815D240(u8 taskId) +{ + u8 battler; + u16 bgX, bgY; + s16 y, i; + struct ScanlineEffectParams scanlineParams; + struct Task *task = &gTasks[taskId]; + + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = 16; + task->data[4] = 0; + task->data[5] = battler; + task->data[6] = 32; + task->data[7] = 0; + task->data[8] = 24; + + if (GetBattlerSide(battler) == B_SIDE_OPPONENT) + task->data[8] *= -1; + + task->data[13] = GetBattlerYCoordWithElevation(battler) - 34; + if (task->data[13] < 0) + task->data[13] = 0; + + task->data[14] = task->data[13] + 66; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + if (sub_80A8364(battler) == 1) + { + scanlineParams.dmaDest = ®_BG1HOFS; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); + bgX = gBattle_BG1_X; + bgY = gBattle_BG1_Y; + } + else + { + scanlineParams.dmaDest = ®_BG2HOFS; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2); + bgX = gBattle_BG2_X; + bgY = gBattle_BG2_Y; + } + + for (y = 0, i = 0; y < 160; y++, i += 2) + { + gScanlineEffectRegBuffers[0][i] = bgX; + gScanlineEffectRegBuffers[1][i] = bgX; + gScanlineEffectRegBuffers[0][i + 1] = bgY; + gScanlineEffectRegBuffers[1][i + 1] = bgY; + } + + scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_32BIT; + scanlineParams.initState = 1; + scanlineParams.unused9 = 0; + ScanlineEffect_SetParams(scanlineParams); + task->func = sub_815D398; +} + +static void sub_815D398(u8 taskId) +{ + struct Task *task; + s16 var1; + s16 var2; + s16 bgX, bgY; + s16 offset; + s16 var0; + s16 i; + s16 sineIndex; + s16 var3; + + task = &gTasks[taskId]; + if (sub_80A8364(task->data[5]) == 1) + { + bgX = gBattle_BG1_X; + bgY = gBattle_BG1_Y; + } + else + { + bgX = gBattle_BG2_X; + bgY = gBattle_BG2_Y; + } + + switch (task->data[0]) + { + case 0: + offset = task->data[14] * 2; + var1 = 0; + var2 = 0; + i = 0; + task->data[1] = (task->data[1] + 2) & 0xFF; + sineIndex = task->data[1]; + task->data[9] = 0x7E0 / task->data[6]; + task->data[10] = -((task->data[7] * 2) / task->data[9]); + task->data[11] = task->data[7]; + var3 = task->data[11] >> 5; + task->data[12] = var3; + var0 = task->data[14]; + while (var0 > task->data[13]) + { + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][offset + 1] = (i - var2) + bgY; + gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][offset] = bgX + var3 + (gSineTable[sineIndex] >> 5); + sineIndex = (sineIndex + 10) & 0xFF; + task->data[11] += task->data[10]; + var3 = task->data[11] >> 5; + task->data[12] = var3; + + i++; + offset -= 2; + var1 += task->data[6]; + var2 = var1 >> 5; + var0--; + } + + var0 *= 2; + while (var0 >= 0) + { + gScanlineEffectRegBuffers[0][var0] = bgX + 240; + gScanlineEffectRegBuffers[1][var0] = bgX + 240; + var0 -= 2; + } + + if (++task->data[6] > 63) + { + task->data[6] = 64; + task->data[2]++; + if (task->data[2] & 1) + task->data[3]--; + else + task->data[4]++; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4])); + if (task->data[3] == 0 && task->data[4] == 16) + { + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + } + else + { + task->data[7] += task->data[8]; + } + break; + case 1: + if (++task->data[2] > 12) + { + gScanlineEffect.state = 3; + task->data[2] = 0; + task->data[0]++; + } + break; + case 2: + task->data[2]++; + if (task->data[2] & 1) + task->data[3]++; + else + task->data[4]--; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(task->data[3], task->data[4])); + if (task->data[3] == 16 && task->data[4] == 0) + { + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } + break; + case 3: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815D64C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + task->data[0] = 0; + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(&gTasks[taskId], task->data[15], gUnknown_085CE5F0); + task->func = sub_815D694; +} + +static void sub_815D694(u8 taskId) +{ + u16 var0; + + struct Task *task = &gTasks[taskId]; + var0 = task->data[0]; + task->data[0]++; + var0 -= 20; + if (var0 < 23) + { + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + if (task->data[2] & 1) + gSprites[task->data[15]].pos2.x = 1; + else + gSprites[task->data[15]].pos2.x = -1; + } + } + else + { + gSprites[task->data[15]].pos2.x = 0; + } + + if (!RunAffineAnimFromTaskData(&gTasks[taskId])) + DestroyAnimVisualTask(taskId); +} + +void sub_815D72C(struct Sprite *sprite, s16 b, s16 c, s16 d, s16 e, u16 f) +{ + sprite->pos1.x = b; + sprite->pos1.y = c; + sprite->data[4] = b << 4; + sprite->data[5] = c << 4; + sprite->data[6] = ((d - b) << 4) / f; + sprite->data[7] = ((e - c) << 4) / f; +} + +void sub_815D794(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[6]; + sprite->data[5] += sprite->data[7]; + sprite->pos1.x = sprite->data[4] >> 4; + sprite->pos1.y = sprite->data[5] >> 4; +} + +void sub_815D7B4(struct Sprite *sprite) +{ + s16 x = sprite->pos1.x; + s16 y = sprite->pos1.y; + + SetSpriteCoordsToAnimAttackerCoords(sprite); + StartSpriteAffineAnim(sprite, gBattleAnimArgs[0]); + sub_815D72C(sprite, sprite->pos1.x, sprite->pos1.y, x, y, 64); + sprite->data[0] = 0; + sprite->callback = sub_815D804; +} + +static void sub_815D804(struct Sprite *sprite) +{ + int index; + + sprite->data[0]++; + index = (sprite->data[0] * 8) & 0xFF; + sub_815D794(sprite); + sprite->pos2.y = Sin(index, 8); + if (sprite->data[0] > 58) + { + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + sprite->data[2]++; + sprite->invisible = sprite->data[2] & 1; + if (sprite->data[2] > 3) + DestroySpriteAndMatrix(sprite); + } + } +} + +void sub_815D870(struct Sprite *sprite) +{ + sprite->data[0] = gBattleAnimArgs[3]; + StartSpriteAffineAnim(sprite, gBattleAnimArgs[0]); + if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER) + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; + sprite->callback = sub_810E2C8; +} + +static void sub_815D8D8(u8 taskId) +{ + u16 var0 = 0; + u16 var1 = 0; + + gTasks[taskId].data[0]--; + if ((gTasks[taskId].data[6] & 0x8000) && (--gTasks[taskId].data[1] == -1)) + { + if (gTasks[taskId].data[9] == 0) + { + gTasks[taskId].data[9] = gTasks[taskId].data[4]; + gTasks[taskId].data[4] = -gTasks[taskId].data[4]; + } + else + { + gTasks[taskId].data[9] = 0; + } + + if (gTasks[taskId].data[10] == 0) + { + gTasks[taskId].data[10] = gTasks[taskId].data[5]; + gTasks[taskId].data[5] = -gTasks[taskId].data[5]; + } + else + { + gTasks[taskId].data[10] = 0; + } + + gTasks[taskId].data[1] = gTasks[taskId].data[13]; + } + + var0 = gTasks[taskId].data[7]; + var1 = gTasks[taskId].data[8]; + if (gTasks[taskId].data[2] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] - (var0 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] + (var0 >> 8); + + if (gTasks[taskId].data[3] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] - (var1 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] + (var1 >> 8); + + if (gTasks[taskId].data[0] < 1) + { + DestroyTask(taskId); + gAnimVisualTaskCount--; + } +} + +static void sub_815DA20(u8 taskId) +{ + u16 var0 = 0; + u16 var1 = 0; + + gTasks[taskId].data[0]--; + if ((gTasks[taskId].data[6] & 0x8000) && (--gTasks[taskId].data[1] == -1)) + { + if (gTasks[taskId].data[9] == 0) + { + gTasks[taskId].data[9] = gTasks[taskId].data[4]; + gTasks[taskId].data[4] = -gTasks[taskId].data[4]; + } + else + { + gTasks[taskId].data[9] = var0; + } + + if (gTasks[taskId].data[10] == 0) + { + gTasks[taskId].data[10] = gTasks[taskId].data[5]; + gTasks[taskId].data[5] = -gTasks[taskId].data[5]; + } + else + { + gTasks[taskId].data[10] = 0; + } + + gTasks[taskId].data[1] = gTasks[taskId].data[13]; + } + + var0 = (gTasks[taskId].data[2] & 0x7FFF) + gTasks[taskId].data[7]; + var1 = (gTasks[taskId].data[3] & 0x7FFF) + gTasks[taskId].data[8]; + if (gTasks[taskId].data[2] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] - (var0 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.x = gTasks[taskId].data[9] + (var0 >> 8); + + if (gTasks[taskId].data[3] & 0x8000) + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] - (var1 >> 8); + else + gSprites[gTasks[taskId].data[15]].pos2.y = gTasks[taskId].data[10] + (var1 >> 8); + + gTasks[taskId].data[7] = var0; + gTasks[taskId].data[8] = var1; + if (gTasks[taskId].data[0] < 1) + { + gTasks[taskId].data[0] = 30; + gTasks[taskId].data[13] = 0; + gTasks[taskId].func = sub_815D8D8; + } +} + +void sub_815DB90(u8 taskId) +{ + gTasks[taskId].data[15] = gBattlerSpriteIds[gBattleAnimAttacker]; + gTasks[taskId].data[14] = gBattleAnimArgs[0]; + gTasks[taskId].data[0] = gBattleAnimArgs[0]; + gTasks[taskId].data[13] = gBattleAnimArgs[6]; + if (gBattleAnimArgs[3]) + gTasks[taskId].data[6] = gTasks[taskId].data[6] | -0x8000; + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + gTasks[taskId].data[2] = gBattleAnimArgs[1]; + gTasks[taskId].data[3] = gBattleAnimArgs[2]; + } + else + { + if (gBattleAnimArgs[1] & 0x8000) + gTasks[taskId].data[2] = gBattleAnimArgs[1] & 0x7FFF; + else + gTasks[taskId].data[2] = gBattleAnimArgs[1] | -0x8000; + + if (gBattleAnimArgs[2] & 0x8000) + gTasks[taskId].data[3] = gBattleAnimArgs[2] & 0x7FFF; + else + gTasks[taskId].data[3] = gBattleAnimArgs[2] | -0x8000; + } + + gTasks[taskId].data[8] = 0; + gTasks[taskId].data[7] = 0; + gTasks[taskId].data[4] = gBattleAnimArgs[4]; + gTasks[taskId].data[5] = gBattleAnimArgs[5]; + gTasks[taskId].func = sub_815DA20; +} + +void sub_815DCA4(u8 taskId) +{ + u8 battler; + struct Task *task = &gTasks[taskId]; + + if (!gBattleAnimArgs[1]) + DestroyAnimVisualTask(taskId); + + task->data[0] = 0; + task->data[1] = 0; + task->data[2] = 0; + task->data[3] = gBattleAnimArgs[1]; + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + task->data[4] = GetBattlerSpriteCoord(battler, 0); + task->data[5] = GetBattlerSpriteCoord(battler, 1); + task->data[6] = GetBattlerSpriteSubpriority(battler); + task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE74C); + task->func = sub_815DD48; +} + +static void sub_815DD48(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] == 6) + sub_815DDE0(taskId, TRUE); + + if (task->data[1] == 18) + sub_815DDE0(taskId, FALSE); + + if (!RunAffineAnimFromTaskData(task)) + { + if (--task->data[3] == 0) + { + task->data[0]++; + } + else + { + task->data[1] = 0; + PrepareAffineAnimInTaskData(task, task->data[15], gUnknown_085CE74C); + } + } + break; + case 1: + if (task->data[2] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815DDE0(u8 taskId, bool8 arg1) +{ + u8 i; + s8 xOffset, yOffset; + struct Task *task; + s16 xCoords[4]; + s16 yCoords[2]; + + task = &gTasks[taskId]; + if (!arg1) + { + xOffset = 18; + yOffset = -20; + } + else + { + xOffset = 30; + yOffset = 20; + } + + xCoords[0] = task->data[4] - xOffset; + xCoords[1] = task->data[4] - xOffset - 4; + xCoords[2] = task->data[4] + xOffset; + xCoords[3] = task->data[4] + xOffset + 4; + yCoords[0] = task->data[5] + yOffset; + yCoords[1] = task->data[5] + yOffset + 6; + + for (i = 0; i < 4; i++) + { + u8 spriteId = CreateSprite(&gUnknown_085CE76C, xCoords[i], yCoords[i & 1], task->data[6] - 5); + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[1] = i < 2 ? -2 : 2; + gSprites[spriteId].data[2] = -1; + gSprites[spriteId].data[3] = taskId; + gSprites[spriteId].data[4] = 2; + task->data[2]++; + } + } +} + +void sub_815DEBC(struct Sprite *sprite) +{ + sprite->pos1.x += sprite->data[1]; + sprite->pos1.y += sprite->data[2]; + if (++sprite->data[0] > 6) + { + gTasks[sprite->data[3]].data[sprite->data[4]]--; + DestroySprite(sprite); + } +} + +void sub_815DF0C(u8 taskId) +{ + u8 spriteId; + + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = gBattleAnimArgs[1]; + spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + gTasks[taskId].data[2] = 0x100 + gSprites[spriteId].oam.paletteNum * 16; + gTasks[taskId].func = sub_815DF64; +} + +static void sub_815DF64(u8 taskId) +{ + if (gTasks[taskId].data[1]) + { + BlendPalette(gTasks[taskId].data[2], 16, 8, gUnknown_085CE784[gTasks[taskId].data[0]]); + if (++gTasks[taskId].data[0] > 23) + gTasks[taskId].data[0] = 0; + + gTasks[taskId].data[1]--; + } + else + { + BlendPalette(gTasks[taskId].data[2], 16, 0, RGB(0, 0, 0)); + DestroyAnimVisualTask(taskId); + } +} + +void sub_815DFCC(u8 taskId) +{ + sub_8117854( + taskId, + 0, + 0x1A0, + gBattleAnimAttacker, + gBattleAnimArgs[0], + 10, + 2, + 30, + gUnknown_08C2DC68, + gUnknown_08C2DDC4, + gUnknown_08C2DDA4); +} + +void sub_815E01C(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + gBattleAnimArgs[0] = -gBattleAnimArgs[0]; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0) + gBattleAnimArgs[0]; + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + gBattleAnimArgs[1]; + if (gBattleAnimArgs[2] == 0) + { + sprite->data[0] = 640; + sprite->data[1] = -640; + } + else if (gBattleAnimArgs[2] == 1) + { + sprite->vFlip = 1; + sprite->data[0] = 640; + sprite->data[1] = 640; + } + else + { + StartSpriteAnim(sprite, 1); + sprite->data[0] = 640; + } + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->data[0] = -sprite->data[0]; + sprite->hFlip = 1; + } + + sprite->callback = sub_815E0DC; +} + +static void sub_815E0DC(struct Sprite *sprite) +{ + sprite->data[6] += sprite->data[0]; + sprite->data[7] += sprite->data[1]; + sprite->pos2.x = sprite->data[6] >> 8; + sprite->pos2.y = sprite->data[7] >> 8; + if (++sprite->data[5] == 14) + DestroyAnimSprite(sprite); +} + +void sub_815E114(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (IsContest()) + { + task->data[5] = 8; + task->data[6] = 3; + task->data[7] = 1; + } + else + { + task->data[5] = 12; + task->data[6] = 3; + task->data[7] = 0; + } + + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + sub_80A861C(gBattleAnimAttacker, 0) / 4; + else + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) - sub_80A861C(gBattleAnimAttacker, 0) / 4; + + task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) - sub_80A861C(gBattleAnimAttacker, 0) / 4; + task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + task->func = sub_815E20C; +} + +static void sub_815E20C(u8 taskId) +{ + u8 i; + s16 x, y; + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 3) + { + task->data[1] = 0; + sub_815E34C( + task->data[11], + task->data[12], + task->data[13], + task->data[14], + task->data[5], + task->data[2], + &x, + &y); + + for (i = 0; i < 2; i++) + { + u8 spriteId = CreateSprite(&gUnknown_085CE7EC, x, y, 35); + if (spriteId != MAX_SPRITES) + { + if (task->data[7] == 0) + { + if (i == 0) + gSprites[spriteId].pos2.x = gSprites[spriteId].pos2.y = -task->data[6]; + else + gSprites[spriteId].pos2.x = gSprites[spriteId].pos2.y = task->data[6]; + } + else + { + if (i == 0) + { + gSprites[spriteId].pos2.x = -task->data[6]; + gSprites[spriteId].pos2.y = task->data[6]; + } + else + { + gSprites[spriteId].pos2.x = task->data[6]; + gSprites[spriteId].pos2.y = -task->data[6]; + } + } + + gSprites[spriteId].data[0] = 0; + gSprites[spriteId].data[1] = taskId; + gSprites[spriteId].data[2] = 10; + task->data[10]++; + } + } + + if (task->data[2] == task->data[5]) + task->data[0]++; + + task->data[2]++; + } + break; + case 1: + if (task->data[10] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_815E34C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y) +{ + int x2; + int y2; + + if (arg5 == 0) + { + *x = arg0; + *y = arg1; + return; + } + + if (arg5 >= arg4) + { + *x = arg2; + *y = arg3; + return; + } + + arg4--; + x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4); + y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4); + *x = x2 >> 8; + *y = y2 >> 8; +} + +void sub_815E404(struct Sprite *sprite) +{ + if (++sprite->data[0] > 36) + { + gTasks[sprite->data[1]].data[sprite->data[2]]--; + DestroySprite(sprite); + } +} + +void sub_815E444(struct Sprite *sprite) +{ + sprite->pos1.x = gBattleAnimArgs[0]; + sprite->pos1.y = gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[2]; + sprite->data[4] = gBattleAnimArgs[3]; + sprite->data[0] = gBattleAnimArgs[4]; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); + sprite->callback = sub_80A70C0; +} + +void sub_815E47C(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + sub_80A861C(gBattleAnimTarget, 0) / 4; + task->data[15] = CreateSprite(&gUnknown_085CE84C, task->data[11], task->data[12], GetBattlerSpriteSubpriority(gBattleAnimTarget) - 5); + if (task->data[15] != MAX_SPRITES) + { + gSprites[task->data[15]].data[0] = 16; + gSprites[task->data[15]].data[2] = task->data[13]; + gSprites[task->data[15]].data[4] = task->data[14]; + gSprites[task->data[15]].data[5] = -32; + InitAnimArcTranslation(&gSprites[task->data[15]]); + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + StartSpriteAffineAnim(&gSprites[task->data[15]], 1); + + task->func = sub_815E5CC; + } + else + { + DestroyAnimVisualTask(taskId); + } +} + +static void sub_815E5CC(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] > 1) + { + task->data[1] = 0; + TranslateAnimArc(&gSprites[task->data[15]]); + if (++task->data[2] > 7) + task->data[0]++; + } + break; + case 1: + if (TranslateAnimArc(&gSprites[task->data[15]])) + { + task->data[1] = 0; + task->data[2] = 0; + task->data[0]++; + } + break; + case 2: + if (++task->data[1] > 1) + { + task->data[1] = 0; + task->data[2]++; + gSprites[task->data[15]].invisible = task->data[2] & 1; + if (task->data[2] == 16) + { + FreeOamMatrix(gSprites[task->data[15]].oam.matrixNum); + DestroySprite(&gSprites[task->data[15]]); + task->data[0]++; + } + } + break; + case 3: + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815E6D8(struct Sprite *sprite) +{ + u8 battler; + + if (gBattleAnimArgs[0] == 0) + battler = gBattleAnimAttacker; + else + battler = gBattleAnimTarget; + + sprite->oam.tileNum += 16; + sprite->data[6] = gBattleAnimArgs[2]; + sprite->data[7] = gBattleAnimArgs[1] == 0 ? -1 : 1; + sprite->pos1.y = GetBattlerSpriteCoord(battler, 3); + if (gBattleAnimArgs[1] == 0) + { + sprite->oam.matrixNum |= 0x8; + sprite->pos1.x = sub_80A861C(battler, 4) - 8; + } + else + { + sprite->pos1.x = sub_80A861C(battler, 5) + 8; + } + + sprite->callback = sub_815E784; +} + +static void sub_815E784(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + sprite->pos2.x += sprite->data[7]; + if (++sprite->data[2] == 12) + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] == 8) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->pos2.x -= sprite->data[7] * 4; + if (++sprite->data[1] == 6) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 3: + sprite->pos2.x += sprite->data[7] * 3; + if (++sprite->data[1] == 8) + { + if (--sprite->data[6]) + { + sprite->data[1] = 0; + sprite->data[0]--; + } + else + { + DestroyAnimSprite(sprite); + } + } + break; + } +} + +void sub_815E840(u8 taskId) +{ + if (gBattleAnimArgs[0] == 0) + { + DestroyAnimVisualTask(taskId); + } + else + { + gTasks[taskId].data[0] = gBattleAnimArgs[1]; + gTasks[taskId].data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]); + PrepareAffineAnimInTaskData(&gTasks[taskId], gTasks[taskId].data[15], gUnknown_085CE87C); + gTasks[taskId].func = sub_815E898; + } +} + +static void sub_815E898(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + if (++task->data[1] > 1) + { + task->data[1] = 0; + if (!(task->data[2] & 1)) + gSprites[task->data[15]].pos2.x = 2; + else + gSprites[task->data[15]].pos2.x = -2; + } + + if (!RunAffineAnimFromTaskData(task)) + { + gSprites[task->data[15]].pos2.x = 0; + if (--task->data[0]) + { + PrepareAffineAnimInTaskData(&gTasks[taskId], gTasks[taskId].data[15], gUnknown_085CE87C); + task->data[1] = 0; + task->data[2] = 0; + } + else + { + DestroyAnimVisualTask(taskId); + } + } +} + +void sub_815E954(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = sub_80A861C(gBattleAnimAttacker, 2); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + sprite->pos1.y = sub_80A861C(gBattleAnimTarget, 2); + } + + if (sprite->pos1.y < 8) + sprite->pos1.y = 8; + + sprite->data[0] = 0; + sprite->data[1] = gBattleAnimArgs[1]; + sprite->data[2] = 0; + sprite->data[3] = gBattleAnimArgs[2]; + sprite->callback = sub_815E9BC; +} + +static void sub_815E9BC(struct Sprite *sprite) +{ + if (++sprite->data[0] >= sprite->data[1]) + { + sprite->data[0] = 0; + sprite->data[2] = (sprite->data[2] + 1) & 1; + sprite->invisible = sprite->data[2]; + if (sprite->data[2] && --sprite->data[3] == 0) + DestroyAnimSprite(sprite); + } +} + +void sub_815EA14(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + sprite->oam.matrixNum |= 0x8; + sprite->pos1.x = 100; + sprite->data[7] = 1; + } + else + { + sprite->pos1.x = 140; + sprite->data[7] = -1; + } + + sprite->pos1.y = 56; + sprite->callback = sub_815EA60; +} + +static void sub_815EA60(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.y -= sprite->data[7] * 2; + if (sprite->data[1] & 1) + sprite->pos1.x -= sprite->data[7] * 2; + + if (++sprite->data[1] == 9) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] == 4) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1]++; + sprite->pos1.y += sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 12) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 3: + if (++sprite->data[1] == 2) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 4: + sprite->data[1]++; + sprite->pos1.y -= sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 12) + sprite->data[0]++; + break; + case 5: + sprite->data[1]++; + sprite->pos1.y += sprite->data[7] * 3; + sprite->pos2.x = sprite->data[7] * (gSineTable[sprite->data[1] * 10] >> 3); + if (sprite->data[1] == 15) + sprite->oam.tileNum += 16; + + if (sprite->data[1] == 18) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 6: + sprite->pos1.x += sprite->data[7] * 6; + if (++sprite->data[1] == 9) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 7: + sprite->pos1.x += sprite->data[7] * 2; + if (++sprite->data[1] == 1) + { + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 8: + sprite->pos1.x -= sprite->data[7] * 3; + if (++sprite->data[1] == 5) + DestroyAnimSprite(sprite); + break; + } +} + +void sub_815EC48(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER); + if (!IsContest()) + { + if (IsDoubleBattle() == TRUE) + { + int x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + int y = GetBattlerSpriteCoord(BATTLE_PARTNER(gBattleAnimAttacker), 0); + if (x > y) + task->data[14] = 1; + else + task->data[14] = -1; + } + else + { + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) + task->data[14] = -1; + else + task->data[14] = 1; + } + } + else + { + task->data[14] = 1; + } + + task->func = sub_815ECE4; +} + +static void sub_815ECE4(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + if (++task->data[1] == 13) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 1: + gSprites[task->data[15]].pos2.x -= task->data[14] * 3; + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 2: + gSprites[task->data[15]].pos2.x += task->data[14] * 3; + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 3: + if (++task->data[1] == 2) + { + task->data[1] = 0; + if (task->data[2] == 0) + { + task->data[2]++; + task->data[0] = 1; + } + else + { + task->data[0]++; + } + } + break; + case 4: + gSprites[task->data[15]].pos2.x += task->data[14]; + if (++task->data[1] == 3) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 5: + if (++task->data[1] == 6) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 6: + gSprites[task->data[15]].pos2.x -= task->data[14] * 4; + if (++task->data[1] == 5) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 7: + gSprites[task->data[15]].pos2.x += task->data[14] * 4; + if (++task->data[1] == 5) + { + task->data[1] = 0; + task->data[0]++; + } + break; + case 8: + gSprites[task->data[15]].pos2.x = 0; + DestroyAnimVisualTask(taskId); + break; + } +} + +void sub_815EE84(struct Sprite *sprite) +{ + if (gBattleAnimArgs[0] == 0) + { + InitAnimSpritePos(sprite, TRUE); + sprite->data[7] = gBattleAnimAttacker; + } + else + { + sprite->data[7] = gBattleAnimTarget; + } + + if (GetBattlerSide(sprite->data[7]) == B_SIDE_OPPONENT) + sprite->oam.matrixNum = 8; + + sprite->oam.priority = sub_80A8328(sprite->data[7]); + sprite->oam.objMode = ST_OAM_OBJ_BLEND; + sprite->callback = sub_815EF08; +} + +static void sub_815EF08(struct Sprite *sprite) +{ + u16 x, y; + + switch (sprite->data[5]) + { + case 0: + switch (sprite->data[6]) + { + default: + sprite->data[6] = 0; + case 0: + case 4: + x = sub_80A861C(sprite->data[7], 5) - 4; + y = sub_80A861C(sprite->data[7], 3) - 4; + break; + case 1: + x = sub_80A861C(sprite->data[7], 5) - 4; + y = sub_80A861C(sprite->data[7], 2) + 4; + break; + case 2: + x = sub_80A861C(sprite->data[7], 4) + 4; + y = sub_80A861C(sprite->data[7], 3) - 4; + break; + case 3: + x = sub_80A861C(sprite->data[7], 4) + 4; + y = sub_80A861C(sprite->data[7], 2) - 4; + break; + case 5: + x = GetBattlerSpriteCoord(sprite->data[7], 2); + y = GetBattlerSpriteCoord(sprite->data[7], 3); + break; + } + + if (sprite->data[6] == 4) + sprite->data[0] = 24; + else if (sprite->data[6] == 5) + sprite->data[0] = 6; + else + sprite->data[0] = 12; + + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = x; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = y; + InitAnimLinearTranslation(sprite); + sprite->data[5]++; + break; + case 1: + if (TranslateAnimLinear(sprite)) + { + switch (sprite->data[6]) + { + default: + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[0] = 0; + sprite->data[5]++; + sprite->data[6]++; + break; + case 4: + sprite->pos1.x += sprite->pos2.x; + sprite->pos1.y += sprite->pos2.y; + sprite->pos2.y = 0; + sprite->pos2.x = 0; + sprite->data[5] = 0; + sprite->data[6]++; + break; + case 5: + sprite->data[0] = 0; + sprite->data[1] = 16; + sprite->data[2] = 0; + sprite->data[5] = 3; + break; + } + } + break; + case 2: + if (++sprite->data[0] == 4) + sprite->data[5] = 0; + break; + case 3: + if (!(sprite->data[0] & 1)) + sprite->data[1]--; + else + sprite->data[2]++; + + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[1], sprite->data[2])); + if (++sprite->data[0] == 32) + { + sprite->invisible = 1; + sprite->data[5]++; + } + break; + case 4: + DestroyAnimSprite(sprite); + break; + } +} + +static void sub_815F10C(struct Sprite *sprite) +{ + sprite->pos2.x = ((sprite->data[2] - sprite->data[0]) * sprite->data[5]) / sprite->data[4]; + sprite->pos2.y = ((sprite->data[3] - sprite->data[1]) * sprite->data[5]) / sprite->data[4]; + if (!(sprite->data[5] & 1)) + { + CreateSprite( + &gUnknown_085CE3A0, + sprite->pos1.x + sprite->pos2.x, + sprite->pos1.y + sprite->pos2.y, 5); + } + + if (sprite->data[5] == sprite->data[4]) + DestroyAnimSprite(sprite); + + sprite->data[5]++; +} + +void sub_815F18C(struct Sprite *sprite) +{ + GetBattlerSpriteCoord(gBattleAnimTarget, 2); // unused local variable + GetBattlerSpriteCoord(gBattleAnimTarget, 3); // unused local variable + + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER || IsContest()) + { + sprite->data[0] = sprite->pos1.x - gBattleAnimArgs[0]; + sprite->data[2] = sprite->pos1.x - gBattleAnimArgs[2]; + } + else + { + sprite->data[0] = sprite->pos1.x + gBattleAnimArgs[0]; + sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2]; + } + + sprite->data[1] = sprite->pos1.y + gBattleAnimArgs[1]; + sprite->data[3] = sprite->pos1.y + gBattleAnimArgs[3]; + sprite->data[4] = gBattleAnimArgs[4]; + sprite->pos1.x = sprite->data[0]; + sprite->pos1.y = sprite->data[1]; + sprite->callback = sub_815F10C; +} + +void AnimTask_MonToSubstitute(u8 taskId) +{ + int i; + u8 spriteId = GetAnimBattlerSpriteId(0); + + if (gTasks[taskId].data[0] == 0) + { + PrepareBattlerSpriteForRotScale(spriteId, FALSE); + gTasks[taskId].data[1] = 0x100; + gTasks[taskId].data[2] = 0x100; + gTasks[taskId].data[0]++; + } + else if (gTasks[taskId].data[0] == 1) + { + gTasks[taskId].data[1] += 0x60; + gTasks[taskId].data[2] -= 0xD; + SetSpriteRotScale(spriteId, gTasks[taskId].data[1], gTasks[taskId].data[2], 0); + if (++gTasks[taskId].data[3] == 9) + { + gTasks[taskId].data[3] = 0; + ResetSpriteRotScale(spriteId); + gSprites[spriteId].invisible = 1; + gTasks[taskId].data[0]++; + } + } + else + { + LoadBattleMonGfxAndAnimate(gBattleAnimAttacker, 0, spriteId); + if (IsContest()) + { + gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gUnknown_082FF6C0; + StartSpriteAffineAnim(&gSprites[gBattlerSpriteIds[gBattleAnimAttacker]], 0); + } + + for (i = 0; i < 16; i++) + gTasks[taskId].data[i] = 0; + + gTasks[taskId].func = sub_815F330; + } +} + +static void sub_815F330(u8 taskId) +{ + u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); + + switch (gTasks[taskId].data[0]) + { + case 0: + gSprites[spriteId].pos2.y = -200; + gSprites[spriteId].pos2.x = 200; + gSprites[spriteId].invisible = 0; + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[0]++; + break; + case 1: + gTasks[taskId].data[10] += 112; + gSprites[spriteId].pos2.y += gTasks[taskId].data[10] >> 8; + if (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y >= -32) + gSprites[spriteId].pos2.x = 0; + + if (gSprites[spriteId].pos2.y > 0) + gSprites[spriteId].pos2.y = 0; + + if (gSprites[spriteId].pos2.y == 0) + { + PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64)); + gTasks[taskId].data[10] -= 0x800; + gTasks[taskId].data[0]++; + } + break; + case 2: + gTasks[taskId].data[10] -= 112; + if (gTasks[taskId].data[10] < 0) + gTasks[taskId].data[10] = 0; + + gSprites[spriteId].pos2.y -= gTasks[taskId].data[10] >> 8; + if (gTasks[taskId].data[10] == 0) + gTasks[taskId].data[0]++; + break; + case 3: + gTasks[taskId].data[10] += 112; + gSprites[spriteId].pos2.y += gTasks[taskId].data[10] >> 8; + if (gSprites[spriteId].pos2.y > 0) + gSprites[spriteId].pos2.y = 0; + + if (gSprites[spriteId].pos2.y == 0) + { + PlaySE12WithPanning(SE_W145B, BattleAnimAdjustPanning(-64)); + DestroyAnimVisualTask(taskId); + } + break; + } +} + +void sub_815F48C(struct Sprite *sprite) +{ + s16 y2; + + if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER) + { + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 2; + y2 = -144; + } + else + { + sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 2; + y2 = -96; + } + + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 3); + sprite->pos2.y = y2; + sprite->callback = sub_815F4F0; +} + +static void sub_815F4F0(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos2.y += 10; + if (sprite->pos2.y >= 0) + { + PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63)); + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 1: + sprite->data[1] += 4; + sprite->pos2.y = -(gSineTable[sprite->data[1]] >> 3); + if (sprite->data[1] > 127) + { + PlaySE12WithPanning(SE_W166, BattleAnimAdjustPanning(63)); + sprite->data[1] = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 2: + sprite->data[1] += 6; + sprite->pos2.y = -(gSineTable[sprite->data[1]] >> 4); + if (sprite->data[1] > 127) + { + sprite->data[1] = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + } + break; + case 3: + if (++sprite->data[1] > 8) + { + PlaySE12WithPanning(SE_W043, BattleAnimAdjustPanning(63)); + sprite->data[1] = 0; + sprite->data[0]++; + } + break; + case 4: + if (++sprite->data[1] > 8) + { + sprite->data[1] = 0; + sprite->data[2]++; + sprite->invisible = sprite->data[2] & 1; + if (sprite->data[2] == 7) + DestroyAnimSprite(sprite); + } + break; + } +} + +void sub_815F620(u8 taskId) +{ + s16 spriteId1, spriteId2; + + if (IsContest()) + { + DestroyAnimVisualTask(taskId); + return; + } + + spriteId1 = CloneBattlerSpriteWithBlend(ANIM_TARGET); + if (spriteId1 < 0) + { + DestroyAnimVisualTask(taskId); + return; + } + + spriteId2 = CloneBattlerSpriteWithBlend(ANIM_TARGET); + if (spriteId2 < 0) + { + obj_delete_but_dont_free_vram(&gSprites[spriteId1]); + DestroyAnimVisualTask(taskId); + return; + } + + gSprites[spriteId2].pos2.x += 24; + gSprites[spriteId1].pos2.x -= 24; + gSprites[spriteId2].data[0] = 0; + gSprites[spriteId1].data[0] = 0; + gSprites[spriteId2].data[1] = 0; + gSprites[spriteId1].data[1] = 0; + gSprites[spriteId2].data[2] = 0; + gSprites[spriteId1].data[2] = 0; + gSprites[spriteId2].data[3] = 16; + gSprites[spriteId1].data[3] = -16; + gSprites[spriteId2].data[4] = 0; + gSprites[spriteId1].data[4] = 128; + gSprites[spriteId2].data[5] = 24; + gSprites[spriteId1].data[5] = 24; + gSprites[spriteId2].data[6] = taskId; + gSprites[spriteId1].data[6] = taskId; + gSprites[spriteId2].data[7] = 0; + gSprites[spriteId1].data[7] = 0; + gTasks[taskId].data[0] = 2; + + if (!gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].invisible) + { + gSprites[spriteId2].invisible = 0; + gSprites[spriteId1].invisible = 1; + } + else + { + gSprites[spriteId2].invisible = 1; + gSprites[spriteId1].invisible = 1; + } + + + gSprites[spriteId2].oam.objMode = ST_OAM_OBJ_NORMAL; + gSprites[spriteId1].oam.objMode = ST_OAM_OBJ_NORMAL; + gSprites[spriteId2].callback = sub_815F7C4; + gSprites[spriteId1].callback = sub_815F7C4; + gTasks[taskId].func = sub_815F79C; +} + +static void sub_815F79C(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + DestroyAnimVisualTask(taskId); +} + +static void sub_815F7C4(struct Sprite *sprite) +{ + int zero = 0; + if (++sprite->data[1] > 1) + { + sprite->data[1] = 0; + if (!gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].invisible) + sprite->invisible ^= 1; + } + + sprite->data[4] = sprite->data[4] + sprite->data[3]; + sprite->data[4] &= 0xFF; + sprite->pos2.x = Cos(sprite->data[4], sprite->data[5]); + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[2] == 60) + { + sprite->data[2] = 0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[2] > 0) + { + sprite->data[2] = 0; + sprite->data[5] -= 2; + if (sprite->data[5] < 0) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + obj_delete_but_dont_free_vram(sprite); + } + } + break; + } +} diff --git a/src/graphics.c b/src/graphics.c index b2de074bc..c0deb2883 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -897,9 +897,9 @@ const u32 gBattleStatMask6_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat6 const u32 gBattleStatMask7_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat7.gbapal.lz"); const u32 gBattleStatMask8_Pal[] = INCBIN_U32("graphics/battle_anims/masks/stat8.gbapal.lz"); -const u32 gUnknown_08C2DC68[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); -const u32 gUnknown_08C2DDA4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); -const u32 gUnknown_08C2DDC4[] = INCBIN_U32("graphics/battle_anims/masks/cure_bubbles.bin.lz"); +const u8 gUnknown_08C2DC68[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.4bpp.lz"); +const u16 gUnknown_08C2DDA4[] = INCBIN_U16("graphics/battle_anims/masks/cure_bubbles.gbapal.lz"); +const u8 gUnknown_08C2DDC4[] = INCBIN_U8("graphics/battle_anims/masks/cure_bubbles.bin.lz"); const u32 gBattleAnimSpritePalette_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.gbapal.lz"); const u32 gBattleAnimSpriteSheet_245[] = INCBIN_U32("graphics/battle_anims/sprites/245.4bpp.lz");