diff --git a/asm/pokemon_animation.s b/asm/pokemon_animation.s index 96ec4f77a..919c1a31e 100644 --- a/asm/pokemon_animation.s +++ b/asm/pokemon_animation.s @@ -5,1458 +5,8 @@ .text - - thumb_func_start pokemonanimfunc_5C -pokemonanimfunc_5C: @ 8183618 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x28 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5C - thumb_func_start pokemonanimfunc_5D -pokemonanimfunc_5D: @ 8183638 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x46 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_817FCDC - ldr r0, =sub_817FCDC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5D - - thumb_func_start pokemonanimfunc_5E -pokemonanimfunc_5E: @ 8183658 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x14 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - bl sub_817F8FC - ldr r0, =sub_817F8FC - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_5E - - thumb_func_start pokemonanimfunc_5F -pokemonanimfunc_5F: @ 8183674 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _08183690 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r0, 0 - b _081836CA - .pool -_08183690: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _0818369C - movs r5, 0x1 -_0818369C: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081836B0 - adds r0, 0xFF -_081836B0: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x9 - bl Sin - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 -_081836CA: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_5F - - thumb_func_start pokemonanimfunc_60 -pokemonanimfunc_60: @ 81836D8 - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x32] - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0x28 - ble _081836F4 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r0, 0 - b _0818372E - .pool -_081836F4: - movs r0, 0x1 - ands r0, r1 - movs r5, 0xFF - cmp r0, 0 - bne _08183700 - movs r5, 0x1 -_08183700: - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r1, 0x28 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _08183714 - adds r0, 0xFF -_08183714: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0xC - bl Sin - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 -_0818372E: - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_60 - - thumb_func_start pokemonanimfunc_61 -pokemonanimfunc_61: @ 818373C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x46 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183140 - ldr r0, =sub_8183140 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_61 - - thumb_func_start pokemonanimfunc_62 -pokemonanimfunc_62: @ 818375C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x18 - strh r0, [r4, 0x2E] - movs r0, 0x6 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_62 - - thumb_func_start pokemonanimfunc_63 -pokemonanimfunc_63: @ 818377C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x38 - strh r0, [r4, 0x2E] - movs r0, 0x9 - strh r0, [r4, 0x3C] - adds r0, r4, 0 - bl sub_8183574 - ldr r0, =sub_8183574 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_63 - - thumb_func_start pokemonanimfunc_64 -pokemonanimfunc_64: @ 818379C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F758 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x2E] - ldr r2, =gUnknown_03001240 - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - movs r0, 0x80 - lsls r0, 3 - strh r0, [r1, 0x6] - movs r0, 0x6 - strh r0, [r1, 0x8] - movs r0, 0x18 - strh r0, [r1, 0x2] - adds r0, r4, 0 - bl sub_817FFF0 - ldr r0, =sub_817FFF0 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_64 - - thumb_func_start sub_81837DC -sub_81837DC: @ 81837DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r7, r0, 0 - movs r5, 0 - movs r0, 0x38 - ldrsh r1, [r7, r0] - movs r2, 0x3A - ldrsh r0, [r7, r2] - cmp r1, r0 - ble _0818382C - strh r5, [r7, 0x26] - strh r5, [r7, 0x38] - movs r2, 0x80 - lsls r2, 1 - adds r0, r7, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - ldrh r1, [r7, 0x36] - movs r2, 0x36 - ldrsh r0, [r7, r2] - cmp r0, 0x1 - bgt _08183824 - adds r0, r7, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r7, 0x1C] - b _0818392C - .pool -_08183824: - subs r0, r1, 0x1 - strh r0, [r7, 0x36] - strh r5, [r7, 0x3C] - b _0818392C -_0818382C: - movs r0, 0x38 - ldrsh r6, [r7, r0] - lsls r0, r6, 7 - movs r1, 0x3A - ldrsh r4, [r7, r1] - adds r1, r4, 0 - bl __divsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r4, 0 - bge _08183846 - adds r4, 0x3 -_08183846: - asrs r1, r4, 2 - lsls r1, 24 - lsrs r1, 24 - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - cmp r6, r1 - blt _08183866 - cmp r6, r0 - bge _08183866 - ldrh r0, [r7, 0x3C] - adds r0, 0x33 - strh r0, [r7, 0x3C] - movs r5, 0xFF - ands r5, r0 -_08183866: - ldrh r0, [r7, 0x34] - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - movs r1, 0x30 - ldrsh r0, [r7, r1] - cmp r0, 0 - bne _081838B0 - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - mov r1, r9 - bl Sin - adds r4, r0, 0 - lsls r6, r5, 16 - asrs r5, r6, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r5, 0 - bl Sin - ldr r2, =0xffffff00 - adds r4, r2 - adds r0, r4 - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - mov r0, r8 - b _081838EA - .pool -_081838B0: - lsls r2, 16 - mov r8, r2 - asrs r0, r2, 16 - mov r1, r9 - bl Sin - adds r6, r0, 0 - lsls r5, 16 - asrs r4, r5, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 23 - adds r0, r4, 0 - bl Sin - movs r2, 0x80 - lsls r2, 1 - adds r1, r2, 0 - subs r1, r6 - subs r1, r0 - lsls r1, 16 - lsrs r1, 16 - mov r10, r1 - mov r0, r8 - adds r6, r5, 0 -_081838EA: - asrs r0, 16 - mov r1, r9 - bl Sin - adds r5, r0, 0 - asrs r4, r6, 16 - mov r0, r9 - movs r1, 0x5 - bl __udivsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl Sin - movs r1, 0x80 - lsls r1, 1 - adds r2, r1, 0 - subs r2, r5 - subs r2, r0 - mov r0, r10 - lsls r1, r0, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - adds r0, r7, 0 - movs r3, 0 - bl SetAffineData - ldrh r0, [r7, 0x38] - adds r0, 0x1 - strh r0, [r7, 0x38] -_0818392C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81837DC - - thumb_func_start pokemonanimfunc_65 -pokemonanimfunc_65: @ 818393C - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _0818395E - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl HandleStartAffineAnim - strh r4, [r5, 0x36] - movs r0, 0x28 - strh r0, [r5, 0x3A] - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_0818395E: - adds r0, r5, 0 - bl sub_81837DC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_65 - - thumb_func_start pokemonanimfunc_66 -pokemonanimfunc_66: @ 818396C - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _08183990 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08183A54 - .pool -_08183990: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _0818399E - ldr r1, =0x000001ff - adds r0, r2, r1 -_0818399E: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _081839AA - adds r0, r1, 0x3 -_081839AA: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08183A00 - cmp r0, 0x1 - bgt _081839C8 - cmp r0, 0 - beq _081839D2 - b _08183A30 - .pool -_081839C8: - cmp r0, 0x2 - beq _081839E4 - cmp r0, 0x3 - beq _08183A1C - b _08183A30 -_081839D2: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _081839E0 - adds r0, 0x1F -_081839E0: - asrs r0, 5 - b _08183A2E -_081839E4: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _081839F6 - ldr r1, =0x000001ff - adds r0, r1 -_081839F6: - asrs r0, 9 - b _08183A2E - .pool -_08183A00: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183A12 - ldr r1, =0x000001ff - adds r0, r1 -_08183A12: - asrs r0, 9 - adds r0, 0x10 - b _08183A2E - .pool -_08183A1C: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183A2A - adds r0, 0x1F -_08183A2A: - asrs r0, 5 - subs r0, 0x10 -_08183A2E: - strh r0, [r4, 0x24] -_08183A30: - movs r0, 0x32 - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08183A3C - adds r0, 0x7F -_08183A3C: - asrs r0, 7 - lsls r0, 7 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x30 - strh r0, [r4, 0x32] -_08183A54: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_66 - - thumb_func_start pokemonanimfunc_67 -pokemonanimfunc_67: @ 8183A60 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r1, [r4, r0] - movs r0, 0x80 - lsls r0, 4 - cmp r1, r0 - ble _08183A84 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x3A] - b _08183B40 - .pool -_08183A84: - movs r1, 0x32 - ldrsh r2, [r4, r1] - adds r0, r2, 0 - cmp r2, 0 - bge _08183A92 - ldr r1, =0x000001ff - adds r0, r2, r1 -_08183A92: - asrs r3, r0, 9 - adds r1, r3, 0 - adds r0, r1, 0 - cmp r1, 0 - bge _08183A9E - adds r0, r1, 0x3 -_08183A9E: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - beq _08183AF4 - cmp r0, 0x1 - bgt _08183ABC - cmp r0, 0 - beq _08183AC6 - b _08183B24 - .pool -_08183ABC: - cmp r0, 0x2 - beq _08183AD8 - cmp r0, 0x3 - beq _08183B10 - b _08183B24 -_08183AC6: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183AD4 - adds r0, 0x1F -_08183AD4: - asrs r0, 5 - b _08183B22 -_08183AD8: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183AEA - ldr r1, =0x000001ff - adds r0, r1 -_08183AEA: - asrs r0, 9 - b _08183B22 - .pool -_08183AF4: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 12 - negs r0, r0 - cmp r0, 0 - bge _08183B06 - ldr r1, =0x000001ff - adds r0, r1 -_08183B06: - asrs r0, 9 - adds r0, 0x10 - b _08183B22 - .pool -_08183B10: - lsls r0, r3, 9 - subs r0, r2, r0 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _08183B1E - adds r0, 0x1F -_08183B1E: - asrs r0, 5 - subs r0, 0x10 -_08183B22: - strh r0, [r4, 0x24] -_08183B24: - movs r1, 0x32 - ldrsh r0, [r4, r1] - movs r1, 0x60 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x4 - bl Sin - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x40 - strh r0, [r4, 0x32] -_08183B40: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_67 - - thumb_func_start sub_8183B4C -sub_8183B4C: @ 8183B4C - push {r4-r7,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183B5E - strh r0, [r4, 0x34] -_08183B5E: - ldr r7, =gUnknown_0860ADBE - movs r2, 0x34 - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - adds r5, r7, 0x2 - adds r0, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl __divsi3 - movs r2, 0x32 - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08183B8C - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x34] - strh r1, [r4, 0x32] -_08183B8C: - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r6, r0, r1 - adds r0, r6, r5 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - movs r1, 0x38 - ldrsh r5, [r4, r1] - adds r1, r5, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bne _08183BCC - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bne _08183BC8 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _08183C06 - .pool -_08183BC8: - strh r1, [r4, 0x32] - b _08183C06 -_08183BCC: - adds r0, r6, r7 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - muls r0, r5 - ldrh r2, [r4, 0x24] - adds r0, r2 - strh r0, [r4, 0x24] - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - adds r1, r7, 0x1 - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - ldrh r0, [r4, 0x38] - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl sub_817F70C -_08183C06: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8183B4C - - thumb_func_start pokemonanimfunc_68 -pokemonanimfunc_68: @ 8183C0C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - strh r0, [r4, 0x38] - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_68 - - thumb_func_start pokemonanimfunc_69 -pokemonanimfunc_69: @ 8183C2C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - strh r0, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_69 - - thumb_func_start pokemonanimfunc_6A -pokemonanimfunc_6A: @ 8183C4C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x2 - strh r0, [r4, 0x38] - strh r0, [r4, 0x3A] - adds r0, r4, 0 - bl sub_8183B4C - ldr r0, =sub_8183B4C - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_6A - - thumb_func_start sub_8183C6C -sub_8183C6C: @ 8183C6C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x3C] - movs r2, 0x3C - ldrsh r0, [r4, r2] - cmp r0, 0xFF - ble _08183CAE - ldrh r1, [r4, 0x38] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _08183CA4 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - b _08183CE8 - .pool -_08183CA4: - subs r0, r1, 0x1 - movs r1, 0 - strh r0, [r4, 0x38] - strh r1, [r4, 0x3C] - b _08183CE8 -_08183CAE: - ldrh r0, [r4, 0x3A] - adds r0, r1, r0 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - movs r5, 0x80 - lsls r5, 1 - cmp r0, r5 - ble _08183CC2 - strh r5, [r4, 0x3C] -_08183CC2: - movs r1, 0x3C - ldrsh r0, [r4, r1] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r1, 0x40 - bl Sin - adds r2, r0, 0 - lsls r2, 16 - asrs r2, 16 - subs r2, r5, r2 - lsls r2, 16 - asrs r2, 16 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData -_08183CE8: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8183C6C - - thumb_func_start pokemonanimfunc_6B -pokemonanimfunc_6B: @ 8183CF0 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D16 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] - movs r0, 0x1 - strh r0, [r4, 0x38] -_08183D16: - adds r0, r4, 0 - bl sub_8183C6C - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6B - - thumb_func_start pokemonanimfunc_6C -pokemonanimfunc_6C: @ 8183D28 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_817F70C - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D4E - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x2 - strh r0, [r4, 0x38] -_08183D4E: - adds r0, r4, 0 - bl sub_8183C6C - adds r0, r4, 0 - bl sub_817F70C - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6C - - thumb_func_start pokemonanimfunc_6D -pokemonanimfunc_6D: @ 8183D60 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183D88 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183D88: - adds r0, r4, 0 - bl sub_8182764 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6D - - thumb_func_start pokemonanimfunc_6E -pokemonanimfunc_6E: @ 8183D94 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183DBA - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] - adds r0, 0xFC - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183DBA: - adds r0, r4, 0 - bl sub_8182764 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6E - - thumb_func_start pokemonanimfunc_6F -pokemonanimfunc_6F: @ 8183DC8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183DF0 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - movs r0, 0x10 - strh r0, [r4, 0x36] -_08183DF0: - adds r0, r4, 0 - bl sub_8182830 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_6F - - thumb_func_start pokemonanimfunc_70 -pokemonanimfunc_70: @ 8183DFC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183E22 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - strh r5, [r4, 0x3C] - movs r1, 0x8 - strh r1, [r4, 0x3A] - movs r0, 0x80 - lsls r0, 2 - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] -_08183E22: - adds r0, r4, 0 - bl sub_8182830 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_70 - - thumb_func_start pokemonanimfunc_71 -pokemonanimfunc_71: @ 8183E30 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183E4A - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x5 - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] -_08183E4A: - adds r0, r4, 0 - bl sub_8180828 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_71 - - thumb_func_start pokemonanimfunc_72 -pokemonanimfunc_72: @ 8183E58 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08183E72 - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x3 - strh r0, [r4, 0x3C] - movs r0, 0x4 - strh r0, [r4, 0x3A] -_08183E72: - adds r0, r4, 0 - bl sub_8180828 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_72 - - thumb_func_start pokemonanimfunc_73 -pokemonanimfunc_73: @ 8183E80 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183EA2 - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl HandleStartAffineAnim - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x3C] -_08183EA2: - adds r0, r5, 0 - bl sub_81832C8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_73 - - thumb_func_start pokemonanimfunc_74 -pokemonanimfunc_74: @ 8183EB0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183ED4 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x3C] -_08183ED4: - adds r0, r4, 0 - bl sub_81832C8 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_74 - - thumb_func_start pokemonanimfunc_75 -pokemonanimfunc_75: @ 8183EE0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183F06 - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x38] - strh r5, [r4, 0x3C] -_08183F06: - adds r0, r4, 0 - bl sub_8183418 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_75 - - thumb_func_start pokemonanimfunc_76 -pokemonanimfunc_76: @ 8183F14 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183F38 - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl HandleStartAffineAnim - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_08183F38: - adds r0, r5, 0 - bl sub_8183418 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_76 - - thumb_func_start pokemonanimfunc_77 -pokemonanimfunc_77: @ 8183F44 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08183F6A - movs r0, 0x1 - strh r0, [r4, 0x32] - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x2 - strh r0, [r4, 0x36] - movs r0, 0x14 - strh r0, [r4, 0x3A] - movs r0, 0x46 - strh r0, [r4, 0x34] - strh r5, [r4, 0x38] - strh r5, [r4, 0x3C] -_08183F6A: - adds r0, r4, 0 - bl sub_81837DC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_77 - - thumb_func_start pokemonanimfunc_78 -pokemonanimfunc_78: @ 8183F78 - push {r4-r6,lr} - adds r5, r0, 0 - movs r0, 0x32 - ldrsh r6, [r5, r0] - cmp r6, 0 - bne _08183F9C - movs r4, 0x1 - strh r4, [r5, 0x32] - adds r0, r5, 0 - bl HandleStartAffineAnim - strh r4, [r5, 0x36] - movs r0, 0x1E - strh r0, [r5, 0x3A] - movs r0, 0x3C - strh r0, [r5, 0x34] - strh r6, [r5, 0x38] - strh r6, [r5, 0x3C] -_08183F9C: - adds r0, r5, 0 - bl sub_81837DC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_78 - - thumb_func_start sub_8183FA8 -sub_8183FA8: @ 8183FA8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r4, r1] - cmp r0, 0xFF - ble _08183FEA - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r0, 0x1 - bgt _08183FD0 - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - b _0818403E - .pool -_08183FD0: - movs r0, 0x3C - ldrsh r1, [r4, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08183FDC - adds r0, 0xFF -_08183FDC: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - strh r0, [r4, 0x3C] - subs r0, r2, 0x1 - strh r0, [r4, 0x3A] - b _0818403E -_08183FEA: - movs r1, 0x3C - ldrsh r0, [r4, r1] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Sin - negs r0, r0 - strh r0, [r4, 0x24] - movs r3, 0x3C - ldrsh r2, [r4, r3] - adds r1, r2, 0 - adds r1, 0xC0 - adds r0, r1, 0 - cmp r1, 0 - bge _0818400C - ldr r3, =0x000001bf - adds r0, r2, r3 -_0818400C: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x36 - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - ble _0818402E - movs r3, 0x26 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x26] -_0818402E: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x26] - adds r0, r1 - strh r0, [r4, 0x26] - ldrh r0, [r4, 0x34] - ldrh r2, [r4, 0x3C] - adds r0, r2 - strh r0, [r4, 0x3C] -_0818403E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8183FA8 - - thumb_func_start pokemonanimfunc_79 -pokemonanimfunc_79: @ 8184048 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _08184066 - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x4 - strh r0, [r1, 0x34] -_08184066: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_79 - - thumb_func_start pokemonanimfunc_7A -pokemonanimfunc_7A: @ 8184070 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _0818408E - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x6 - strh r0, [r1, 0x34] -_0818408E: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7A - - thumb_func_start pokemonanimfunc_7B -pokemonanimfunc_7B: @ 8184098 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _081840B8 - movs r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0x2 - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0xC - strh r0, [r1, 0x38] - strh r0, [r1, 0x36] - movs r0, 0x8 - strh r0, [r1, 0x34] -_081840B8: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7B thumb_func_start sub_81840C4 sub_81840C4: @ 81840C4 diff --git a/data/pokemon_animation.s b/data/pokemon_animation.s index 08254b40d..cbab5295f 100644 --- a/data/pokemon_animation.s +++ b/data/pokemon_animation.s @@ -3,6 +3,7 @@ .section .rodata + .align 2 gUnknown_0860ADCC:: @ 860ADCC .byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 .byte 0x00, 0x0f, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 1496069df..67915d228 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -2025,8 +2025,6 @@ void pokemonanimfunc_05(struct Sprite *sprite) sprite->callback = sub_8180900; } -const u8 gUnknown_0860ADBE[] = {0x01, 0x01, 0x0c, 0xfe, 0x00, 0x0c, 0x01, 0xff, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}; - void pokemonanimfunc_20(struct Sprite *sprite) { if (sprite->data[2] == 0) @@ -4194,3 +4192,607 @@ void sub_8183574(struct Sprite *sprite) } } } + +void pokemonanimfunc_5C(struct Sprite *sprite) +{ + sprite->data[0] = 40; + sprite->data[7] = 6; + sub_8183574(sprite); + sprite->callback = sub_8183574; +} + +void pokemonanimfunc_5D(struct Sprite *sprite) +{ + sprite->data[0] = 70; + sprite->data[7] = 6; + sub_817FCDC(sprite); + sprite->callback = sub_817FCDC; +} + +void pokemonanimfunc_5E(struct Sprite *sprite) +{ + sprite->data[0] = 20; + sub_817F8FC(sprite); + sprite->callback = sub_817F8FC; +} + +void pokemonanimfunc_5F(struct Sprite *sprite) +{ + if (sprite->data[2] > 40) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->pos2.x = 0; + } + else + { + s8 sign; + if (!(sprite->data[2] & 1)) + sign = 1; + else + sign = -1; + + sprite->pos2.x = Sin((sprite->data[2] * 128 / 40) % 256, 9) * sign; + } + + sprite->data[2]++; +} + +void pokemonanimfunc_60(struct Sprite *sprite) +{ + if (sprite->data[2] > 40) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->pos2.x = 0; + } + else + { + s8 sign; + if (!(sprite->data[2] & 1)) + sign = 1; + else + sign = -1; + + sprite->pos2.x = Sin((sprite->data[2] * 128 / 40) % 256, 12) * sign; + } + + sprite->data[2]++; +} + +void pokemonanimfunc_61(struct Sprite *sprite) +{ + sprite->data[0] = 70; + sprite->data[7] = 6; + sub_8183140(sprite); + sprite->callback = sub_8183140; +} + +void pokemonanimfunc_62(struct Sprite *sprite) +{ + sprite->data[0] = 24; + sprite->data[7] = 6; + sub_8183574(sprite); + sprite->callback = sub_8183574; +} + +void pokemonanimfunc_63(struct Sprite *sprite) +{ + sprite->data[0] = 56; + sprite->data[7] = 9; + sub_8183574(sprite); + sprite->callback = sub_8183574; +} + +void pokemonanimfunc_64(struct Sprite *sprite) +{ + u8 id = sprite->data[0] = sub_817F758(); + + gUnknown_03001240[id].field_6 = 1024; + gUnknown_03001240[id].field_8 = 6; + gUnknown_03001240[id].field_2 = 24; + sub_817FFF0(sprite); + sprite->callback = sub_817FFF0; +} + +void sub_81837DC(struct Sprite *sprite) +{ + s16 index1 = 0, index2 = 0; + if (sprite->data[5] > sprite->data[6]) + { + sprite->pos2.y = 0; + sprite->data[5] = 0; + HandleSetAffineData(sprite, 0x100, 0x100, 0); + if (sprite->data[4] <= 1) + { + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + else + { + sprite->data[4]--; + sprite->data[7] = 0; + } + } + else + { + u8 amplitude, cmpVal1, cmpVal2; + s16 xScale, yScale; + + index2 = (sprite->data[5] * 128) / sprite->data[6]; + cmpVal1 = sprite->data[6] / 4; + cmpVal2 = cmpVal1 * 3; + if (sprite->data[5] >= cmpVal1 && sprite->data[5] < cmpVal2) + { + sprite->data[7] += 51; + index1 = sprite->data[7] & 0xFF; + } + + amplitude = sprite->data[3]; + + if (sprite->data[1] == 0) + xScale = Sin(index2, amplitude) + (Sin(index1, amplitude / 5 * 2) - 0x100); + else + xScale = 0x100 - Sin(index1, amplitude / 5 * 2) - Sin(index2, amplitude); + + yScale = 0x100 - Sin(index1, amplitude / 5) - Sin(index2, amplitude); + SetAffineData(sprite, xScale, yScale, 0); + sprite->data[5]++; + } +} + +void pokemonanimfunc_65(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 1; + sprite->data[6] = 40; + sprite->data[3] = 40; + sprite->data[5] = 0; + sprite->data[7] = 0; + } + + sub_81837DC(sprite); +} + +void pokemonanimfunc_66(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[2] > 2048) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->data[6] = 0; + } + else + { + s16 divCase = (sprite->data[2] / 512) % 4; + switch (divCase) + { + case 0: + sprite->pos2.x = (sprite->data[2] % 512) / 32; + break; + case 2: + sprite->pos2.x = -(sprite->data[2] % 512 * 16) / 512; + break; + case 1: + sprite->pos2.x = -(sprite->data[2] % 512 * 16) / 512 + 16; + break; + case 3: + sprite->pos2.x = (sprite->data[2] % 512) / 32 - 16; + break; + } + + sprite->pos2.y = Sin(sprite->data[2] % 128, 4); + sprite->data[2] += 48; + } + + sub_817F70C(sprite); +} + +void pokemonanimfunc_67(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[2] > 2048) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->data[6] = 0; + } + else + { + s16 divCase = (sprite->data[2] / 512) % 4; + switch (divCase) + { + case 0: + sprite->pos2.x = (sprite->data[2] % 512) / 32; + break; + case 2: + sprite->pos2.x = -(sprite->data[2] % 512 * 16) / 512; + break; + case 1: + sprite->pos2.x = -(sprite->data[2] % 512 * 16) / 512 + 16; + break; + case 3: + sprite->pos2.x = (sprite->data[2] % 512) / 32 - 16; + break; + } + + sprite->pos2.y = Sin(sprite->data[2] % 96, 4); + sprite->data[2] += 64; + } + + sub_817F70C(sprite); +} + +static const s8 gUnknown_0860ADBE[][3] = +{ +// x y timer + {1, 1, 12}, + {-2, 0, 12}, + {1, -1, 12}, + {0, 0, 0} +}; + +void sub_8183B4C(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[2] == 0) + sprite->data[3] = 0; + + if (gUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == sprite->data[2]) + { + sprite->data[3]++; + sprite->data[2] = 0; + } + + if (gUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == 0) + { + if (--sprite->data[6] == 0) + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + else + sprite->data[2] = 0; + } + else + { + s32 amplitude = sprite->data[5]; + sprite->pos2.x += (gUnknown_0860ADBE[sprite->data[3]][0] * amplitude); + sprite->pos2.y += (gUnknown_0860ADBE[sprite->data[3]][1] * sprite->data[5]); // what's the point of the var if you're not reusing it? + sprite->data[2]++; + sub_817F70C(sprite); + } +} + +void pokemonanimfunc_68(struct Sprite *sprite) +{ + sprite->data[5] = 1; + sprite->data[6] = 1; + sub_8183B4C(sprite); + sprite->callback = sub_8183B4C; +} + +void pokemonanimfunc_69(struct Sprite *sprite) +{ + sprite->data[5] = 2; + sprite->data[6] = 1; + sub_8183B4C(sprite); + sprite->callback = sub_8183B4C; +} + +void pokemonanimfunc_6A(struct Sprite *sprite) +{ + sprite->data[5] = 2; + sprite->data[6] = 2; + sub_8183B4C(sprite); + sprite->callback = sub_8183B4C; +} + +void sub_8183C6C(struct Sprite *sprite) +{ + if (sprite->data[7] > 255) + { + if (sprite->data[5] <= 1) + { + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + HandleSetAffineData(sprite, 0x100, 0x100, 0); + } + else + { + sprite->data[5]--; + sprite->data[7] = 0; + } + } + else + { + s16 scale; + + sprite->data[7] += sprite->data[6]; + if (sprite->data[7] > 256) + sprite->data[7] = 256; + + scale = Sin(sprite->data[7] / 2, 64); + HandleSetAffineData(sprite, 0x100 - scale, 0x100 - scale, 0); + } +} + +void pokemonanimfunc_6B(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 4; + sprite->data[5] = 1; + } + + sub_8183C6C(sprite); + sub_817F70C(sprite); +} + +void pokemonanimfunc_6C(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 8; + sprite->data[5] = 2; + } + + sub_8183C6C(sprite); + sub_817F70C(sprite); +} + +void pokemonanimfunc_6D(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 8; + sprite->data[5] = 512; + sprite->data[4] = 16; + } + + sub_8182764(sprite); +} + +void pokemonanimfunc_6E(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 4; + sprite->data[5] = 256; + sprite->data[4] = 16; + } + + sub_8182764(sprite); +} + +void pokemonanimfunc_6F(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 8; + sprite->data[5] = 512; + sprite->data[4] = 16; + } + + sub_8182830(sprite); +} + +void pokemonanimfunc_70(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[2]++; + sprite->data[7] = 0; + sprite->data[6] = 8; + sprite->data[5] = 512; + sprite->data[4] = 8; + } + + sub_8182830(sprite); +} + +void pokemonanimfunc_71(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[7] = 5; + sprite->data[6] = 8; + } + + sub_8180828(sprite); +} + +void pokemonanimfunc_72(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[7] = 3; + sprite->data[6] = 4; + } + + sub_8180828(sprite); +} + +void pokemonanimfunc_73(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 1; + sprite->data[6] = 30; + sprite->data[3] = 60; + sprite->data[7] = 0; + } + + sub_81832C8(sprite); +} + +void pokemonanimfunc_74(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 2; + sprite->data[6] = 20; + sprite->data[3] = 70; + sprite->data[7] = 0; + } + + sub_81832C8(sprite); +} + +void pokemonanimfunc_75(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 2; + sprite->data[6] = 20; + sprite->data[3] = 70; + sprite->data[5] = 0; + sprite->data[7] = 0; + } + + sub_8183418(sprite); +} + +void pokemonanimfunc_76(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 1; + sprite->data[6] = 30; + sprite->data[3] = 60; + sprite->data[5] = 0; + sprite->data[7] = 0; + } + + sub_8183418(sprite); +} + +void pokemonanimfunc_77(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 2; + sprite->data[6] = 20; + sprite->data[3] = 70; + sprite->data[5] = 0; + sprite->data[7] = 0; + } + + sub_81837DC(sprite); +} + +void pokemonanimfunc_78(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + HandleStartAffineAnim(sprite); + sprite->data[4] = 1; + sprite->data[6] = 30; + sprite->data[3] = 60; + sprite->data[5] = 0; + sprite->data[7] = 0; + } + + sub_81837DC(sprite); +} + +void sub_8183FA8(struct Sprite *sprite) +{ + if (sprite->data[7] > 255) + { + if (sprite->data[6] <= 1) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + } + else + { + sprite->data[7] %= 256; + sprite->data[6]--; + } + } + else + { + sprite->pos2.x = -(Sin(sprite->data[7], sprite->data[5])); + sprite->pos2.y = Sin((sprite->data[7] + 192) % 256, sprite->data[4]); + if (sprite->pos2.y > 0) + sprite->pos2.y *= -1; + + sprite->pos2.y += sprite->data[4]; + sprite->data[7] += sprite->data[3]; + } +} + +void pokemonanimfunc_79(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 1; + sprite->data[7] = 0; + sprite->data[5] = 12; + sprite->data[4] = 12; + sprite->data[3] = 4; + } + + sub_8183FA8(sprite); +} + +void pokemonanimfunc_7A(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 1; + sprite->data[7] = 0; + sprite->data[5] = 12; + sprite->data[4] = 12; + sprite->data[3] = 6; + } + + sub_8183FA8(sprite); +} + +void pokemonanimfunc_7B(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 2; + sprite->data[7] = 0; + sprite->data[5] = 12; + sprite->data[4] = 12; + sprite->data[3] = 8; + } + + sub_8183FA8(sprite); +}