diff --git a/asm/pokemon_animation.s b/asm/pokemon_animation.s deleted file mode 100644 index 919c1a31e..000000000 --- a/asm/pokemon_animation.s +++ /dev/null @@ -1,1770 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - - - thumb_func_start sub_81840C4 -sub_81840C4: @ 81840C4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - ble _081840FC - movs r2, 0x3A - ldrsh r1, [r5, r2] - ldrh r2, [r5, 0x36] - movs r3, 0x36 - ldrsh r0, [r5, r3] - cmp r1, r0 - bgt _081840EC - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r5, 0x1C] - b _081840F4 - .pool -_081840EC: - adds r0, r2, 0x1 - movs r1, 0 - strh r0, [r5, 0x36] - strh r1, [r5, 0x3C] -_081840F4: - movs r0, 0 - strh r0, [r5, 0x24] - strh r0, [r5, 0x26] - b _08184188 -_081840FC: - cmp r0, 0x9F - ble _08184126 - cmp r0, r1 - ble _08184106 - strh r1, [r5, 0x3C] -_08184106: - movs r0, 0x3C - ldrsh r1, [r5, r0] - adds r0, r1, 0 - cmp r1, 0 - bge _08184112 - adds r0, 0xFF -_08184112: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x8 - bl Sin - negs r0, r0 - b _08184154 -_08184126: - cmp r0, 0x5F - ble _0818414A - movs r0, 0x60 - movs r1, 0x6 - bl Sin - adds r4, r0, 0 - movs r1, 0x3C - ldrsh r0, [r5, r1] - subs r0, 0x60 - lsls r0, 17 - asrs r0, 16 - movs r1, 0x4 - bl Sin - subs r4, r0 - strh r4, [r5, 0x26] - b _08184156 -_0818414A: - movs r2, 0x3C - ldrsh r0, [r5, r2] - movs r1, 0x6 - bl Sin -_08184154: - strh r0, [r5, 0x26] -_08184156: - movs r3, 0x3C - ldrsh r0, [r5, r3] - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - movs r2, 0x38 - ldrsh r1, [r5, r2] - bl Sin - negs r0, r0 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r5, 0x36] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0818417E - lsls r0, r2, 16 - negs r0, r0 - lsrs r2, r0, 16 -_0818417E: - strh r2, [r5, 0x24] - ldrh r0, [r5, 0x34] - ldrh r3, [r5, 0x3C] - adds r0, r3 - strh r0, [r5, 0x3C] -_08184188: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81840C4 - - thumb_func_start pokemonanimfunc_7C -pokemonanimfunc_7C: @ 8184190 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _081841B0 - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x2 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x4 - strh r0, [r2, 0x34] -_081841B0: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7C - - thumb_func_start pokemonanimfunc_7D -pokemonanimfunc_7D: @ 81841BC - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _081841DC - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x2 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x6 - strh r0, [r2, 0x34] -_081841DC: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7D - - thumb_func_start pokemonanimfunc_7E -pokemonanimfunc_7E: @ 81841E8 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _08184208 - movs r1, 0x1 - strh r1, [r2, 0x32] - movs r0, 0x3 - strh r0, [r2, 0x3A] - strh r3, [r2, 0x3C] - movs r0, 0x10 - strh r0, [r2, 0x38] - strh r1, [r2, 0x36] - movs r0, 0x8 - strh r0, [r2, 0x34] -_08184208: - adds r0, r2, 0 - bl sub_81840C4 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7E - - thumb_func_start pokemonanimfunc_7F -pokemonanimfunc_7F: @ 8184214 - push {lr} - adds r2, r0, 0 - movs r0, 0x32 - ldrsh r1, [r2, r0] - cmp r1, 0 - bne _08184232 - movs r0, 0x1 - strh r0, [r2, 0x32] - strh r0, [r2, 0x3A] - strh r1, [r2, 0x3C] - movs r1, 0x4 - strh r1, [r2, 0x38] - movs r0, 0x6 - strh r0, [r2, 0x36] - strh r1, [r2, 0x34] -_08184232: - adds r0, r2, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_7F - - thumb_func_start pokemonanimfunc_80 -pokemonanimfunc_80: @ 818423C - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _0818425A - movs r0, 0x1 - strh r0, [r1, 0x32] - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0x4 - strh r0, [r1, 0x38] - movs r0, 0x6 - strh r0, [r1, 0x36] - strh r0, [r1, 0x34] -_0818425A: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_80 - - thumb_func_start pokemonanimfunc_81 -pokemonanimfunc_81: @ 8184264 - push {lr} - adds r1, r0, 0 - movs r0, 0x32 - ldrsh r2, [r1, r0] - cmp r2, 0 - bne _08184286 - movs r0, 0x1 - strh r0, [r1, 0x32] - movs r0, 0x2 - strh r0, [r1, 0x3A] - strh r2, [r1, 0x3C] - movs r0, 0x4 - strh r0, [r1, 0x38] - movs r0, 0x6 - strh r0, [r1, 0x36] - movs r0, 0x8 - strh r0, [r1, 0x34] -_08184286: - adds r0, r1, 0 - bl sub_8183FA8 - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_81 - - thumb_func_start sub_8184290 -sub_8184290: @ 8184290 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - lsls r0, 7 - movs r2, 0x3C - ldrsh r1, [r4, r2] - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Sin - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - lsls r0, r1, 8 - negs r0, r0 - strh r0, [r4, 0x3A] - movs r0, 0x36 - ldrsh r2, [r4, r0] - adds r0, r4, 0 - movs r3, 0 - bl sub_817F3F0 - movs r2, 0x80 - lsls r2, 1 - ldrh r3, [r4, 0x3A] - adds r0, r4, 0 - adds r1, r2, 0 - bl HandleSetAffineData - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8184290 - - thumb_func_start pokemonanimfunc_82 -pokemonanimfunc_82: @ 81842DC - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184300 - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x3C - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184300: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _0818434C - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _08184348 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _08184358 - .pool -_08184348: - strh r2, [r4, 0x32] - b _08184352 -_0818434C: - adds r0, r4, 0 - bl sub_8184290 -_08184352: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08184358: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_82 - - thumb_func_start pokemonanimfunc_83 -pokemonanimfunc_83: @ 8184360 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184384 - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x5A - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x1 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184384: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _081843D0 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _081843CC - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _081843DC - .pool -_081843CC: - strh r2, [r4, 0x32] - b _081843D6 -_081843D0: - adds r0, r4, 0 - bl sub_8184290 -_081843D6: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_081843DC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_83 - - thumb_func_start pokemonanimfunc_84 -pokemonanimfunc_84: @ 81843E4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _08184408 - adds r0, r4, 0 - bl HandleStartAffineAnim - movs r0, 0x1E - strh r0, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x38] - ldr r0, =0x0000ffe0 - strh r0, [r4, 0x36] - movs r0, 0x2 - strh r0, [r4, 0x34] - strh r5, [r4, 0x2E] -_08184408: - movs r2, 0x32 - ldrsh r1, [r4, r2] - movs r3, 0x3C - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08184454 - movs r2, 0x80 - lsls r2, 1 - adds r0, r4, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - movs r2, 0 - strh r2, [r4, 0x24] - strh r2, [r4, 0x26] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r3, 0x34 - ldrsh r1, [r4, r3] - lsls r0, 16 - asrs r0, 16 - cmp r1, r0 - bgt _08184450 - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _08184460 - .pool -_08184450: - strh r2, [r4, 0x32] - b _0818445A -_08184454: - adds r0, r4, 0 - bl sub_8184290 -_0818445A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] -_08184460: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_84 - - thumb_func_start sub_8184468 -sub_8184468: @ 8184468 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x32 - ldrsh r1, [r6, r0] - movs r2, 0x3C - ldrsh r0, [r6, r2] - cmp r1, r0 - ble _0818449C - movs r0, 0 - strh r0, [r6, 0x26] - movs r2, 0x80 - lsls r2, 1 - adds r0, r6, 0 - adds r1, r2, 0 - movs r3, 0 - bl HandleSetAffineData - adds r0, r6, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r6, 0x1C] - b _08184544 - .pool -_0818449C: - movs r1, 0x32 - ldrsh r0, [r6, r1] - movs r2, 0x3A - ldrsh r4, [r6, r2] - adds r1, r4, 0 - bl __modsi3 - lsls r0, 24 - lsrs r0, 16 - adds r1, r4, 0 - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081844BC - adds r0, 0xFF -_081844BC: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - lsrs r4, r0, 16 - ldrh r0, [r6, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081844F8 - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x20 - bl Sin - movs r1, 0x80 - lsls r1, 1 - adds r5, r1, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x20 - bl Sin - adds r0, r5 - strh r0, [r6, 0x38] - adds r0, r4, 0 - movs r1, 0x20 - b _0818451E -_081844F8: - lsls r4, 16 - asrs r4, 16 - adds r0, r4, 0 - movs r1, 0x8 - bl Sin - movs r2, 0x80 - lsls r2, 1 - adds r5, r2, 0 - adds r0, r5 - strh r0, [r6, 0x36] - adds r0, r4, 0 - movs r1, 0x8 - bl Sin - adds r0, r5 - strh r0, [r6, 0x38] - adds r0, r4, 0 - movs r1, 0x8 -_0818451E: - bl Sin - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r0, 24 - cmp r0, 0 - bge _08184530 - adds r0, 0x7 -_08184530: - lsrs r0, 3 - strh r0, [r6, 0x26] - movs r0, 0x36 - ldrsh r1, [r6, r0] - movs r0, 0x38 - ldrsh r2, [r6, r0] - adds r0, r6, 0 - movs r3, 0 - bl HandleSetAffineData -_08184544: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8184468 - - thumb_func_start pokemonanimfunc_85 -pokemonanimfunc_85: @ 8184550 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _08184570 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x28 - strh r0, [r4, 0x3A] - movs r0, 0x50 - strh r0, [r4, 0x3C] -_08184570: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_85 - - thumb_func_start pokemonanimfunc_86 -pokemonanimfunc_86: @ 818457C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0818459A - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x28 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x3C] -_0818459A: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_86 - - thumb_func_start pokemonanimfunc_87 -pokemonanimfunc_87: @ 81845A8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081845C6 - adds r0, r4, 0 - bl HandleStartAffineAnim - ldrh r0, [r4, 0x26] - adds r0, 0x2 - strh r0, [r4, 0x26] - movs r0, 0x50 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x3C] -_081845C6: - adds r0, r4, 0 - bl sub_8184468 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_87 - - thumb_func_start sub_81845D4 -sub_81845D4: @ 81845D4 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - ldrh r1, [r4, 0x32] - subs r0, r1 - strh r0, [r4, 0x24] - movs r0, 0x24 - ldrsh r1, [r4, r0] - movs r2, 0x3A - ldrsh r0, [r4, r2] - cmn r1, r0 - bgt _081845FE - ldrh r0, [r4, 0x3A] - negs r0, r0 - strh r0, [r4, 0x24] - movs r0, 0x2 - strh r0, [r4, 0x3C] - ldr r0, =sub_8184610 - str r0, [r4, 0x1C] -_081845FE: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81845D4 - - thumb_func_start sub_8184610 -sub_8184610: @ 8184610 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x3C] - lsls r1, 16 - cmp r1, 0 - blt _0818462E - ldr r0, =sub_8184640 - str r0, [r4, 0x1C] -_0818462E: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184610 - - thumb_func_start sub_8184640 -sub_8184640: @ 8184640 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x3C] - ldrh r2, [r4, 0x24] - adds r1, r0, r2 - strh r1, [r4, 0x24] - adds r0, 0x1 - strh r0, [r4, 0x3C] - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r4, 0x3A] - movs r3, 0x3A - ldrsh r0, [r4, r3] - cmp r1, r0 - ble _08184668 - strh r2, [r4, 0x24] - ldr r0, =sub_8184678 - str r0, [r4, 0x1C] -_08184668: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184640 - - thumb_func_start sub_8184678 -sub_8184678: @ 8184678 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r2, [r4, 0x34] - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r3, 0x38 - ldrsh r0, [r4, r3] - cmp r1, r0 - blt _08184698 - ldr r0, =sub_81846B8 - str r0, [r4, 0x1C] - b _081846AC - .pool -_08184698: - ldrh r0, [r4, 0x36] - ldrh r1, [r4, 0x24] - adds r0, r1 - strh r0, [r4, 0x24] - movs r3, 0x36 - ldrsh r0, [r4, r3] - negs r0, r0 - strh r0, [r4, 0x36] - adds r0, r2, 0x1 - strh r0, [r4, 0x34] -_081846AC: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8184678 - - thumb_func_start sub_81846B8 -sub_81846B8: @ 81846B8 - push {r4,lr} - adds r4, r0, 0 - bl sub_817F70C - ldrh r0, [r4, 0x24] - subs r0, 0x2 - strh r0, [r4, 0x24] - lsls r0, 16 - cmp r0, 0 - bgt _081846DA - movs r0, 0 - strh r0, [r4, 0x24] - adds r0, r4, 0 - bl sub_817F77C - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] -_081846DA: - adds r0, r4, 0 - bl sub_817F70C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81846B8 - - thumb_func_start pokemonanimfunc_88 -pokemonanimfunc_88: @ 81846EC - push {r4,lr} - adds r4, r0, 0 - bl HandleStartAffineAnim - movs r2, 0 - movs r1, 0x4 - strh r1, [r4, 0x3C] - movs r0, 0xC - strh r0, [r4, 0x3A] - movs r0, 0x10 - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_88 - - thumb_func_start pokemonanimfunc_89 -pokemonanimfunc_89: @ 8184718 - push {r4,lr} - adds r4, r0, 0 - bl HandleStartAffineAnim - movs r2, 0 - movs r1, 0x2 - strh r1, [r4, 0x3C] - movs r0, 0x8 - strh r0, [r4, 0x3A] - movs r0, 0xC - strh r0, [r4, 0x38] - strh r1, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_89 - - thumb_func_start pokemonanimfunc_8A -pokemonanimfunc_8A: @ 8184744 - push {r4,lr} - adds r4, r0, 0 - bl HandleStartAffineAnim - movs r1, 0 - strh r1, [r4, 0x3C] - movs r0, 0x6 - strh r0, [r4, 0x3A] - strh r0, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r1, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x32] - ldr r0, =sub_81845D4 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end pokemonanimfunc_8A - - thumb_func_start sub_8184770 -sub_8184770: @ 8184770 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x30] - strh r0, [r1, 0x24] - ldrh r2, [r1, 0x2E] - movs r3, 0x2E - ldrsh r0, [r1, r3] - cmp r0, 0x1 - ble _0818478E - movs r2, 0x30 - ldrsh r0, [r1, r2] - negs r0, r0 - strh r0, [r1, 0x30] - movs r0, 0 - b _08184790 -_0818478E: - adds r0, r2, 0x1 -_08184790: - strh r0, [r1, 0x2E] - pop {r0} - bx r0 - thumb_func_end sub_8184770 - - thumb_func_start sub_8184798 -sub_8184798: @ 8184798 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =gUnknown_0860AE7C - movs r2, 0x34 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - adds r0, r4, 0 - bl sub_8184770 - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r1, r0, r5 - ldrb r0, [r1, 0x1] - cmp r0, 0xFF - bne _081847D0 - movs r0, 0 - strh r0, [r4, 0x24] - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _0818482E - .pool -_081847D0: - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bne _08184800 - ldrb r0, [r1] - cmp r0, 0 - beq _081847F0 - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0x10 - bl BlendPalette - b _081847FC - .pool -_081847F0: - ldrh r0, [r4, 0x3C] - ldr r3, =0x000003ff - movs r1, 0x10 - movs r2, 0 - bl BlendPalette -_081847FC: - movs r0, 0 - strh r0, [r4, 0x36] -_08184800: - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldrb r1, [r0, 0x1] - movs r2, 0x38 - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _08184828 - movs r1, 0 - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r1, [r4, 0x38] - ldrh r0, [r4, 0x3A] - adds r0, 0x1 - strh r0, [r4, 0x3A] - b _0818482E - .pool -_08184828: - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_0818482E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8184798 - - thumb_func_start pokemonanimfunc_8B -pokemonanimfunc_8B: @ 8184834 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _08184860 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - strh r3, [r2, 0x34] -_08184860: - adds r0, r2, 0 - bl sub_8184798 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8B - - thumb_func_start pokemonanimfunc_8C -pokemonanimfunc_8C: @ 818486C - push {r4,r5,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r4, r0, 16 - cmp r4, 0x1 - bne _08184898 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r5, 0x80 - lsls r5, 1 - adds r1, r5, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - strh r4, [r2, 0x34] -_08184898: - adds r0, r2, 0 - bl sub_8184798 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8C - - thumb_func_start pokemonanimfunc_8D -pokemonanimfunc_8D: @ 81848A4 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - adds r0, 0x1 - movs r3, 0 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bne _081848D2 - ldrb r0, [r2, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r4, 0x80 - lsls r4, 1 - adds r1, r4, 0 - adds r0, r1 - strh r0, [r2, 0x3C] - strh r3, [r2, 0x3A] - strh r3, [r2, 0x38] - strh r3, [r2, 0x36] - movs r0, 0x2 - strh r0, [r2, 0x34] -_081848D2: - adds r0, r2, 0 - bl sub_8184798 - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8D - - thumb_func_start sub_81848E0 -sub_81848E0: @ 81848E0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x7F - ble _08184904 - ldrh r0, [r4, 0x3C] - movs r1, 0x10 - movs r2, 0 - movs r3, 0x1F - bl BlendPalette - ldr r0, =SpriteCB_SetDummyOnAnimEnd - str r0, [r4, 0x1C] - b _0818492A - .pool -_08184904: - movs r5, 0x32 - ldrsh r0, [r4, r5] - movs r1, 0xC - bl Sin - adds r2, r0, 0 - strh r2, [r4, 0x3A] - ldrh r0, [r4, 0x3C] - lsls r2, 24 - lsrs r2, 24 - ldr r3, =gUnknown_0860AE88 - movs r5, 0x30 - ldrsh r1, [r4, r5] - lsls r1, 1 - adds r1, r3 - ldrh r3, [r1] - movs r1, 0x10 - bl BlendPalette -_0818492A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81848E0 - - thumb_func_start sub_8184934 -sub_8184934: @ 8184934 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x34 - ldrsh r1, [r4, r0] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r1, r0 - bge _081849CC - adds r0, r4, 0 - bl sub_817F70C - movs r3, 0x38 - ldrsh r1, [r4, r3] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r1, r0 - ble _08184970 - ldrh r0, [r4, 0x34] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r3, 0x36 - ldrsh r1, [r4, r3] - cmp r0, r1 - bge _0818496C - strh r2, [r4, 0x38] -_0818496C: - strh r2, [r4, 0x24] - b _081849C6 -_08184970: - movs r0, 0x34 - ldrsh r1, [r4, r0] - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r0, 1 - lsls r0, 1 - subs r1, r0 - lsls r1, 16 - asrs r1, 15 - movs r0, 0x1 - subs r0, r1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r2, 0x38 - ldrsh r1, [r4, r2] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 7 - movs r3, 0x2E - ldrsh r1, [r4, r3] - bl __divsi3 - adds r1, r0, 0 - cmp r1, 0 - bge _081849A4 - adds r0, 0xFF -_081849A4: - asrs r0, 8 - lsls r0, 8 - subs r0, r1, r0 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x6 - bl Sin - lsls r1, r5, 24 - asrs r1, 24 - adds r2, r1, 0 - muls r2, r0 - adds r0, r2, 0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x38] - adds r0, 0x1 - strh r0, [r4, 0x38] -_081849C6: - adds r0, r4, 0 - bl sub_817F70C -_081849CC: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8184934 - - thumb_func_start pokemonanimfunc_8E -pokemonanimfunc_8E: @ 81849D4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _081849FE - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_081849FE: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184A0E - adds r0, r4, 0 - bl sub_81848E0 -_08184A0E: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184A30 - adds r0, r4, 0 - bl sub_8184934 -_08184A30: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8E - - thumb_func_start pokemonanimfunc_8F -pokemonanimfunc_8F: @ 8184A3C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184A66 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_08184A66: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184A76 - adds r0, r4, 0 - bl sub_81848E0 -_08184A76: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184A98 - adds r0, r4, 0 - bl sub_8184934 -_08184A98: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_8F - - thumb_func_start pokemonanimfunc_90 -pokemonanimfunc_90: @ 8184AA4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184ACE - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r2, [r4, 0x30] -_08184ACE: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184ADE - adds r0, r4, 0 - bl sub_81848E0 -_08184ADE: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184B00 - adds r0, r4, 0 - bl sub_8184934 -_08184B00: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_90 - - thumb_func_start pokemonanimfunc_91 -pokemonanimfunc_91: @ 8184B0C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184B38 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x1 - strh r0, [r4, 0x30] -_08184B38: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184B48 - adds r0, r4, 0 - bl sub_81848E0 -_08184B48: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184B6A - adds r0, r4, 0 - bl sub_8184934 -_08184B6A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_91 - - thumb_func_start pokemonanimfunc_92 -pokemonanimfunc_92: @ 8184B78 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184BA2 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184BA2: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184BB2 - adds r0, r4, 0 - bl sub_81848E0 -_08184BB2: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184BD4 - adds r0, r4, 0 - bl sub_8184934 -_08184BD4: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_92 - - thumb_func_start pokemonanimfunc_93 -pokemonanimfunc_93: @ 8184BE0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184C0A - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184C0A: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184C1A - adds r0, r4, 0 - bl sub_81848E0 -_08184C1A: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184C3C - adds r0, r4, 0 - bl sub_8184934 -_08184C3C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_93 - - thumb_func_start pokemonanimfunc_94 -pokemonanimfunc_94: @ 8184C48 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184C72 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0xA - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x2 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - strh r0, [r4, 0x30] -_08184C72: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184C82 - adds r0, r4, 0 - bl sub_81848E0 -_08184C82: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184CA4 - adds r0, r4, 0 - bl sub_8184934 -_08184CA4: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_94 - - thumb_func_start pokemonanimfunc_95 -pokemonanimfunc_95: @ 8184CB0 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184CDC - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x14 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x30] -_08184CDC: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184CEC - adds r0, r4, 0 - bl sub_81848E0 -_08184CEC: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184D0E - adds r0, r4, 0 - bl sub_8184934 -_08184D0E: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_95 - - thumb_func_start pokemonanimfunc_96 -pokemonanimfunc_96: @ 8184D1C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x32 - ldrsh r2, [r4, r0] - cmp r2, 0 - bne _08184D48 - ldrb r0, [r4, 0x5] - lsrs r0, 4 - lsls r0, 4 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3, 0 - adds r0, r1 - strh r0, [r4, 0x3C] - movs r0, 0x50 - strh r0, [r4, 0x2E] - strh r2, [r4, 0x38] - movs r0, 0x1 - strh r0, [r4, 0x36] - strh r2, [r4, 0x34] - movs r0, 0x2 - strh r0, [r4, 0x30] -_08184D48: - ldrh r0, [r4, 0x32] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08184D58 - adds r0, r4, 0 - bl sub_81848E0 -_08184D58: - movs r0, 0x32 - ldrsh r2, [r4, r0] - movs r3, 0x2E - ldrsh r1, [r4, r3] - movs r3, 0x36 - ldrsh r0, [r4, r3] - muls r1, r0 - movs r0, 0x80 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r0, 1 - cmp r2, r0 - blt _08184D7A - adds r0, r4, 0 - bl sub_8184934 -_08184D7A: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - pop {r4} - pop {r0} - bx r0 - thumb_func_end pokemonanimfunc_96 - - thumb_func_start SpriteCB_SetDummyOnAnimEnd -SpriteCB_SetDummyOnAnimEnd: @ 8184D88 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _08184D9C - ldr r0, =SpriteCallbackDummy - str r0, [r2, 0x1C] -_08184D9C: - pop {r0} - bx r0 - .pool - thumb_func_end SpriteCB_SetDummyOnAnimEnd - - .align 2, 0 @ Don't pad with nop. diff --git a/data/pokemon_animation.s b/data/pokemon_animation.s deleted file mode 100644 index cbab5295f..000000000 --- a/data/pokemon_animation.s +++ /dev/null @@ -1,33 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .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 - .byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 - .byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 - .byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 - -gUnknown_0860AE1C:: @ 860AE1C - .byte 0x00, 0x05, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00 - .byte 0x00, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00 - .byte 0x00, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00 - .byte 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 - -gUnknown_0860AE54:: @ 860AE54 - .byte 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 - .byte 0x00, 0x14, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00 - .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 - - .align 2 -gUnknown_0860AE7C:: @ 860AE7C - .4byte gUnknown_0860ADCC - .4byte gUnknown_0860AE1C - .4byte gUnknown_0860AE54 - - .align 1 -gUnknown_0860AE88:: @ 860AE88 - .2byte 0x001f, 0x03e0, 0x7c00, 0x0000 diff --git a/include/pokemon_animation.h b/include/pokemon_animation.h index b6d8c868e..c1ab8d817 100644 --- a/include/pokemon_animation.h +++ b/include/pokemon_animation.h @@ -1,7 +1,10 @@ #ifndef GUARD_POKEMON_ANIMATION_H #define GUARD_POKEMON_ANIMATION_H +u8 GetSpeciesBackAnimSet(u16 species); void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId); -void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimId); +void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId); +void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet); +void SetSpriteCB_MonAnimDummy(struct Sprite *sprite); #endif // GUARD_POKEMON_ANIMATION_H diff --git a/ld_script.txt b/ld_script.txt index f21991734..35b0ce582 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -241,7 +241,6 @@ SECTIONS { src/fldeff_teleport.o(.text); asm/battle_link_817C95C.o(.text); src/pokemon_animation.o(.text); - asm/pokemon_animation.o(.text); src/recorded_battle.o(.text); src/battle_controller_recorded_opponent.o(.text); src/battle_controller_recorded_player.o(.text); @@ -516,7 +515,6 @@ SECTIONS { src/bard_music.o(.rodata); data/battle_link_817C95C.o(.rodata); src/pokemon_animation.o(.rodata); - data/pokemon_animation.o(.rodata); src/battle_controller_recorded_opponent.o(.rodata); src/battle_controller_recorded_player.o(.rodata); src/battle_dome_cards.o(.rodata); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 3e70e22fa..38183e807 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -25,6 +25,7 @@ #include "random.h" #include "event_data.h" #include "overworld.h" +#include "new_menu_helpers.h" struct HallofFameMon { @@ -53,7 +54,6 @@ static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL; extern bool8 gHasHallOfFameRecords; extern u32 gUnknown_0203BCD4; -extern u8 gDecompressionBuffer[]; extern struct MusicPlayerInfo gMPlayInfo_BGM; extern MainCallback gGameContinueCallback; extern u32 gDamagedSaveSectors; @@ -82,7 +82,6 @@ extern const u8 gContestConfetti_Gfx[]; extern const u8 gContestConfetti_Pal[]; extern void sub_81973C4(u8, u8); -extern u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor); extern void sub_8175620(void); extern u8 TrySavingData(u8); extern u8 sub_818D3E4(u16 species, u32 trainerId, u32 personality, u8 flags, s16 x, s16 y, u8, u16); diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 95ec4b6a2..7ffb2f36a 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -74,8 +74,6 @@ extern u8 GetFrontierOpponentClass(u16 trainerId); extern u8 pokemon_order_func(u8 bankPartyId); extern void GetFrontierTrainerName(u8* dest, u16 trainerId); extern void sub_81C488C(u8); -extern void sub_817F578(struct Sprite*, u8 frontAnimId); -extern u8 GetSpeciesBackAnimId(u16 species); static void sub_806E6CC(u8 taskId); @@ -1508,7 +1506,7 @@ static void Task_PokemonSummaryAnimateAfterDelay(u8 taskId) { if (--gTasks[taskId].data[3] == 0) { - sub_817F578(READ_PTR_FROM_TASK(taskId, 0), gTasks[taskId].data[2]); + StartMonSummaryAnimation(READ_PTR_FROM_TASK(taskId, 0), gTasks[taskId].data[2]); sub_81C488C(0xFF); DestroyTask(taskId); } @@ -1523,7 +1521,6 @@ void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u } extern void SpriteCallbackDummy_2(struct Sprite*); -extern void sub_817F60C(struct Sprite*); void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3) { @@ -1580,11 +1577,11 @@ void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneF gTasks[taskId].data[2] = gMonFrontAnimIdsTable[species - 1]; gTasks[taskId].data[3] = gMonAnimationDelayTable[species - 1]; sub_81C488C(taskId); - sub_817F60C(sprite); + SetSpriteCB_MonAnimDummy(sprite); } else { - sub_817F578(sprite, gMonFrontAnimIdsTable[species - 1]); + StartMonSummaryAnimation(sprite, gMonFrontAnimIdsTable[species - 1]); } } @@ -1603,7 +1600,7 @@ void BattleAnimateBackSprite(struct Sprite* sprite, u16 species) } else { - LaunchAnimationTaskForBackSprite(sprite, GetSpeciesBackAnimId(species)); + LaunchAnimationTaskForBackSprite(sprite, GetSpeciesBackAnimSet(species)); sprite->callback = SpriteCallbackDummy_2; } } diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 67915d228..c8fcff93a 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -16,167 +16,171 @@ struct UnkAnimStruct }; extern u16 gBattlePartyID[]; -extern bool32 gUnknown_03001274; -extern struct UnkAnimStruct gUnknown_03001240[]; -extern u8 gUnknown_03001270; // this file's functions -void pokemonanimfunc_00(struct Sprite *sprite); -void pokemonanimfunc_01(struct Sprite *sprite); -void pokemonanimfunc_02(struct Sprite *sprite); -void pokemonanimfunc_03(struct Sprite *sprite); -void pokemonanimfunc_04(struct Sprite *sprite); -void pokemonanimfunc_05(struct Sprite *sprite); -void pokemonanimfunc_06(struct Sprite *sprite); -void pokemonanimfunc_07(struct Sprite *sprite); -void pokemonanimfunc_08(struct Sprite *sprite); -void pokemonanimfunc_09(struct Sprite *sprite); -void pokemonanimfunc_0A(struct Sprite *sprite); -void pokemonanimfunc_0B(struct Sprite *sprite); -void pokemonanimfunc_0C(struct Sprite *sprite); -void pokemonanimfunc_0D(struct Sprite *sprite); -void pokemonanimfunc_0E(struct Sprite *sprite); -void pokemonanimfunc_0F(struct Sprite *sprite); -void pokemonanimfunc_10(struct Sprite *sprite); -void pokemonanimfunc_11(struct Sprite *sprite); -void pokemonanimfunc_12(struct Sprite *sprite); -void pokemonanimfunc_13(struct Sprite *sprite); -void pokemonanimfunc_14(struct Sprite *sprite); -void pokemonanimfunc_15(struct Sprite *sprite); -void pokemonanimfunc_16(struct Sprite *sprite); -void pokemonanimfunc_17(struct Sprite *sprite); -void pokemonanimfunc_18(struct Sprite *sprite); -void pokemonanimfunc_19(struct Sprite *sprite); -void pokemonanimfunc_1A(struct Sprite *sprite); -void pokemonanimfunc_1B(struct Sprite *sprite); -void pokemonanimfunc_1C(struct Sprite *sprite); -void pokemonanimfunc_1D(struct Sprite *sprite); -void pokemonanimfunc_1E(struct Sprite *sprite); -void pokemonanimfunc_1F(struct Sprite *sprite); -void pokemonanimfunc_20(struct Sprite *sprite); -void pokemonanimfunc_21(struct Sprite *sprite); -void pokemonanimfunc_22(struct Sprite *sprite); -void pokemonanimfunc_23(struct Sprite *sprite); -void pokemonanimfunc_24(struct Sprite *sprite); -void pokemonanimfunc_25(struct Sprite *sprite); -void pokemonanimfunc_26(struct Sprite *sprite); -void pokemonanimfunc_27(struct Sprite *sprite); -void pokemonanimfunc_28(struct Sprite *sprite); -void pokemonanimfunc_29(struct Sprite *sprite); -void pokemonanimfunc_2A(struct Sprite *sprite); -void pokemonanimfunc_2B(struct Sprite *sprite); -void pokemonanimfunc_2C(struct Sprite *sprite); -void pokemonanimfunc_2D(struct Sprite *sprite); -void pokemonanimfunc_2E(struct Sprite *sprite); -void pokemonanimfunc_2F(struct Sprite *sprite); -void pokemonanimfunc_30(struct Sprite *sprite); -void pokemonanimfunc_31(struct Sprite *sprite); -void pokemonanimfunc_32(struct Sprite *sprite); -void pokemonanimfunc_33(struct Sprite *sprite); -void pokemonanimfunc_34(struct Sprite *sprite); -void pokemonanimfunc_35(struct Sprite *sprite); -void pokemonanimfunc_36(struct Sprite *sprite); -void pokemonanimfunc_37(struct Sprite *sprite); -void pokemonanimfunc_38(struct Sprite *sprite); -void pokemonanimfunc_39(struct Sprite *sprite); -void pokemonanimfunc_3A(struct Sprite *sprite); -void pokemonanimfunc_3B(struct Sprite *sprite); -void pokemonanimfunc_3C(struct Sprite *sprite); -void pokemonanimfunc_3D(struct Sprite *sprite); -void pokemonanimfunc_3E(struct Sprite *sprite); -void pokemonanimfunc_3F(struct Sprite *sprite); -void pokemonanimfunc_40(struct Sprite *sprite); -void pokemonanimfunc_41(struct Sprite *sprite); -void pokemonanimfunc_42(struct Sprite *sprite); -void pokemonanimfunc_43(struct Sprite *sprite); -void pokemonanimfunc_44(struct Sprite *sprite); -void pokemonanimfunc_45(struct Sprite *sprite); -void pokemonanimfunc_46(struct Sprite *sprite); -void pokemonanimfunc_47(struct Sprite *sprite); -void pokemonanimfunc_48(struct Sprite *sprite); -void pokemonanimfunc_49(struct Sprite *sprite); -void pokemonanimfunc_4A(struct Sprite *sprite); -void pokemonanimfunc_4B(struct Sprite *sprite); -void pokemonanimfunc_4C(struct Sprite *sprite); -void pokemonanimfunc_4D(struct Sprite *sprite); -void pokemonanimfunc_4E(struct Sprite *sprite); -void pokemonanimfunc_4F(struct Sprite *sprite); -void pokemonanimfunc_50(struct Sprite *sprite); -void pokemonanimfunc_51(struct Sprite *sprite); -void pokemonanimfunc_52(struct Sprite *sprite); -void pokemonanimfunc_53(struct Sprite *sprite); -void pokemonanimfunc_54(struct Sprite *sprite); -void pokemonanimfunc_55(struct Sprite *sprite); -void pokemonanimfunc_56(struct Sprite *sprite); -void pokemonanimfunc_57(struct Sprite *sprite); -void pokemonanimfunc_58(struct Sprite *sprite); -void pokemonanimfunc_59(struct Sprite *sprite); -void pokemonanimfunc_5A(struct Sprite *sprite); -void pokemonanimfunc_5B(struct Sprite *sprite); -void pokemonanimfunc_5C(struct Sprite *sprite); -void pokemonanimfunc_5D(struct Sprite *sprite); -void pokemonanimfunc_5E(struct Sprite *sprite); -void pokemonanimfunc_5F(struct Sprite *sprite); -void pokemonanimfunc_60(struct Sprite *sprite); -void pokemonanimfunc_61(struct Sprite *sprite); -void pokemonanimfunc_62(struct Sprite *sprite); -void pokemonanimfunc_63(struct Sprite *sprite); -void pokemonanimfunc_64(struct Sprite *sprite); -void pokemonanimfunc_65(struct Sprite *sprite); -void pokemonanimfunc_66(struct Sprite *sprite); -void pokemonanimfunc_67(struct Sprite *sprite); -void pokemonanimfunc_68(struct Sprite *sprite); -void pokemonanimfunc_69(struct Sprite *sprite); -void pokemonanimfunc_6A(struct Sprite *sprite); -void pokemonanimfunc_6B(struct Sprite *sprite); -void pokemonanimfunc_6C(struct Sprite *sprite); -void pokemonanimfunc_6D(struct Sprite *sprite); -void pokemonanimfunc_6E(struct Sprite *sprite); -void pokemonanimfunc_6F(struct Sprite *sprite); -void pokemonanimfunc_70(struct Sprite *sprite); -void pokemonanimfunc_71(struct Sprite *sprite); -void pokemonanimfunc_72(struct Sprite *sprite); -void pokemonanimfunc_73(struct Sprite *sprite); -void pokemonanimfunc_74(struct Sprite *sprite); -void pokemonanimfunc_75(struct Sprite *sprite); -void pokemonanimfunc_76(struct Sprite *sprite); -void pokemonanimfunc_77(struct Sprite *sprite); -void pokemonanimfunc_78(struct Sprite *sprite); -void pokemonanimfunc_79(struct Sprite *sprite); -void pokemonanimfunc_7A(struct Sprite *sprite); -void pokemonanimfunc_7B(struct Sprite *sprite); -void pokemonanimfunc_7C(struct Sprite *sprite); -void pokemonanimfunc_7D(struct Sprite *sprite); -void pokemonanimfunc_7E(struct Sprite *sprite); -void pokemonanimfunc_7F(struct Sprite *sprite); -void pokemonanimfunc_80(struct Sprite *sprite); -void pokemonanimfunc_81(struct Sprite *sprite); -void pokemonanimfunc_82(struct Sprite *sprite); -void pokemonanimfunc_83(struct Sprite *sprite); -void pokemonanimfunc_84(struct Sprite *sprite); -void pokemonanimfunc_85(struct Sprite *sprite); -void pokemonanimfunc_86(struct Sprite *sprite); -void pokemonanimfunc_87(struct Sprite *sprite); -void pokemonanimfunc_88(struct Sprite *sprite); -void pokemonanimfunc_89(struct Sprite *sprite); -void pokemonanimfunc_8A(struct Sprite *sprite); -void pokemonanimfunc_8B(struct Sprite *sprite); -void pokemonanimfunc_8C(struct Sprite *sprite); -void pokemonanimfunc_8D(struct Sprite *sprite); -void pokemonanimfunc_8E(struct Sprite *sprite); -void pokemonanimfunc_8F(struct Sprite *sprite); -void pokemonanimfunc_90(struct Sprite *sprite); -void pokemonanimfunc_91(struct Sprite *sprite); -void pokemonanimfunc_92(struct Sprite *sprite); -void pokemonanimfunc_93(struct Sprite *sprite); -void pokemonanimfunc_94(struct Sprite *sprite); -void pokemonanimfunc_95(struct Sprite *sprite); -void pokemonanimfunc_96(struct Sprite *sprite); +static void pokemonanimfunc_00(struct Sprite *sprite); +static void pokemonanimfunc_01(struct Sprite *sprite); +static void pokemonanimfunc_02(struct Sprite *sprite); +static void pokemonanimfunc_03(struct Sprite *sprite); +static void pokemonanimfunc_04(struct Sprite *sprite); +static void pokemonanimfunc_05(struct Sprite *sprite); +static void pokemonanimfunc_06(struct Sprite *sprite); +static void pokemonanimfunc_07(struct Sprite *sprite); +static void pokemonanimfunc_08(struct Sprite *sprite); +static void pokemonanimfunc_09(struct Sprite *sprite); +static void pokemonanimfunc_0A(struct Sprite *sprite); +static void pokemonanimfunc_0B(struct Sprite *sprite); +static void pokemonanimfunc_0C(struct Sprite *sprite); +static void pokemonanimfunc_0D(struct Sprite *sprite); +static void pokemonanimfunc_0E(struct Sprite *sprite); +static void pokemonanimfunc_0F(struct Sprite *sprite); +static void pokemonanimfunc_10(struct Sprite *sprite); +static void pokemonanimfunc_11(struct Sprite *sprite); +static void pokemonanimfunc_12(struct Sprite *sprite); +static void pokemonanimfunc_13(struct Sprite *sprite); +static void pokemonanimfunc_14(struct Sprite *sprite); +static void pokemonanimfunc_15(struct Sprite *sprite); +static void pokemonanimfunc_16(struct Sprite *sprite); +static void pokemonanimfunc_17(struct Sprite *sprite); +static void pokemonanimfunc_18(struct Sprite *sprite); +static void pokemonanimfunc_19(struct Sprite *sprite); +static void pokemonanimfunc_1A(struct Sprite *sprite); +static void pokemonanimfunc_1B(struct Sprite *sprite); +static void pokemonanimfunc_1C(struct Sprite *sprite); +static void pokemonanimfunc_1D(struct Sprite *sprite); +static void pokemonanimfunc_1E(struct Sprite *sprite); +static void pokemonanimfunc_1F(struct Sprite *sprite); +static void pokemonanimfunc_20(struct Sprite *sprite); +static void pokemonanimfunc_21(struct Sprite *sprite); +static void pokemonanimfunc_22(struct Sprite *sprite); +static void pokemonanimfunc_23(struct Sprite *sprite); +static void pokemonanimfunc_24(struct Sprite *sprite); +static void pokemonanimfunc_25(struct Sprite *sprite); +static void pokemonanimfunc_26(struct Sprite *sprite); +static void pokemonanimfunc_27(struct Sprite *sprite); +static void pokemonanimfunc_28(struct Sprite *sprite); +static void pokemonanimfunc_29(struct Sprite *sprite); +static void pokemonanimfunc_2A(struct Sprite *sprite); +static void pokemonanimfunc_2B(struct Sprite *sprite); +static void pokemonanimfunc_2C(struct Sprite *sprite); +static void pokemonanimfunc_2D(struct Sprite *sprite); +static void pokemonanimfunc_2E(struct Sprite *sprite); +static void pokemonanimfunc_2F(struct Sprite *sprite); +static void pokemonanimfunc_30(struct Sprite *sprite); +static void pokemonanimfunc_31(struct Sprite *sprite); +static void pokemonanimfunc_32(struct Sprite *sprite); +static void pokemonanimfunc_33(struct Sprite *sprite); +static void pokemonanimfunc_34(struct Sprite *sprite); +static void pokemonanimfunc_35(struct Sprite *sprite); +static void pokemonanimfunc_36(struct Sprite *sprite); +static void pokemonanimfunc_37(struct Sprite *sprite); +static void pokemonanimfunc_38(struct Sprite *sprite); +static void pokemonanimfunc_39(struct Sprite *sprite); +static void pokemonanimfunc_3A(struct Sprite *sprite); +static void pokemonanimfunc_3B(struct Sprite *sprite); +static void pokemonanimfunc_3C(struct Sprite *sprite); +static void pokemonanimfunc_3D(struct Sprite *sprite); +static void pokemonanimfunc_3E(struct Sprite *sprite); +static void pokemonanimfunc_3F(struct Sprite *sprite); +static void pokemonanimfunc_40(struct Sprite *sprite); +static void pokemonanimfunc_41(struct Sprite *sprite); +static void pokemonanimfunc_42(struct Sprite *sprite); +static void pokemonanimfunc_43(struct Sprite *sprite); +static void pokemonanimfunc_44(struct Sprite *sprite); +static void pokemonanimfunc_45(struct Sprite *sprite); +static void pokemonanimfunc_46(struct Sprite *sprite); +static void pokemonanimfunc_47(struct Sprite *sprite); +static void pokemonanimfunc_48(struct Sprite *sprite); +static void pokemonanimfunc_49(struct Sprite *sprite); +static void pokemonanimfunc_4A(struct Sprite *sprite); +static void pokemonanimfunc_4B(struct Sprite *sprite); +static void pokemonanimfunc_4C(struct Sprite *sprite); +static void pokemonanimfunc_4D(struct Sprite *sprite); +static void pokemonanimfunc_4E(struct Sprite *sprite); +static void pokemonanimfunc_4F(struct Sprite *sprite); +static void pokemonanimfunc_50(struct Sprite *sprite); +static void pokemonanimfunc_51(struct Sprite *sprite); +static void pokemonanimfunc_52(struct Sprite *sprite); +static void pokemonanimfunc_53(struct Sprite *sprite); +static void pokemonanimfunc_54(struct Sprite *sprite); +static void pokemonanimfunc_55(struct Sprite *sprite); +static void pokemonanimfunc_56(struct Sprite *sprite); +static void pokemonanimfunc_57(struct Sprite *sprite); +static void pokemonanimfunc_58(struct Sprite *sprite); +static void pokemonanimfunc_59(struct Sprite *sprite); +static void pokemonanimfunc_5A(struct Sprite *sprite); +static void pokemonanimfunc_5B(struct Sprite *sprite); +static void pokemonanimfunc_5C(struct Sprite *sprite); +static void pokemonanimfunc_5D(struct Sprite *sprite); +static void pokemonanimfunc_5E(struct Sprite *sprite); +static void pokemonanimfunc_5F(struct Sprite *sprite); +static void pokemonanimfunc_60(struct Sprite *sprite); +static void pokemonanimfunc_61(struct Sprite *sprite); +static void pokemonanimfunc_62(struct Sprite *sprite); +static void pokemonanimfunc_63(struct Sprite *sprite); +static void pokemonanimfunc_64(struct Sprite *sprite); +static void pokemonanimfunc_65(struct Sprite *sprite); +static void pokemonanimfunc_66(struct Sprite *sprite); +static void pokemonanimfunc_67(struct Sprite *sprite); +static void pokemonanimfunc_68(struct Sprite *sprite); +static void pokemonanimfunc_69(struct Sprite *sprite); +static void pokemonanimfunc_6A(struct Sprite *sprite); +static void pokemonanimfunc_6B(struct Sprite *sprite); +static void pokemonanimfunc_6C(struct Sprite *sprite); +static void pokemonanimfunc_6D(struct Sprite *sprite); +static void pokemonanimfunc_6E(struct Sprite *sprite); +static void pokemonanimfunc_6F(struct Sprite *sprite); +static void pokemonanimfunc_70(struct Sprite *sprite); +static void pokemonanimfunc_71(struct Sprite *sprite); +static void pokemonanimfunc_72(struct Sprite *sprite); +static void pokemonanimfunc_73(struct Sprite *sprite); +static void pokemonanimfunc_74(struct Sprite *sprite); +static void pokemonanimfunc_75(struct Sprite *sprite); +static void pokemonanimfunc_76(struct Sprite *sprite); +static void pokemonanimfunc_77(struct Sprite *sprite); +static void pokemonanimfunc_78(struct Sprite *sprite); +static void pokemonanimfunc_79(struct Sprite *sprite); +static void pokemonanimfunc_7A(struct Sprite *sprite); +static void pokemonanimfunc_7B(struct Sprite *sprite); +static void pokemonanimfunc_7C(struct Sprite *sprite); +static void pokemonanimfunc_7D(struct Sprite *sprite); +static void pokemonanimfunc_7E(struct Sprite *sprite); +static void pokemonanimfunc_7F(struct Sprite *sprite); +static void pokemonanimfunc_80(struct Sprite *sprite); +static void pokemonanimfunc_81(struct Sprite *sprite); +static void pokemonanimfunc_82(struct Sprite *sprite); +static void pokemonanimfunc_83(struct Sprite *sprite); +static void pokemonanimfunc_84(struct Sprite *sprite); +static void pokemonanimfunc_85(struct Sprite *sprite); +static void pokemonanimfunc_86(struct Sprite *sprite); +static void pokemonanimfunc_87(struct Sprite *sprite); +static void pokemonanimfunc_88(struct Sprite *sprite); +static void pokemonanimfunc_89(struct Sprite *sprite); +static void pokemonanimfunc_8A(struct Sprite *sprite); +static void pokemonanimfunc_8B(struct Sprite *sprite); +static void pokemonanimfunc_8C(struct Sprite *sprite); +static void pokemonanimfunc_8D(struct Sprite *sprite); +static void pokemonanimfunc_8E(struct Sprite *sprite); +static void pokemonanimfunc_8F(struct Sprite *sprite); +static void pokemonanimfunc_90(struct Sprite *sprite); +static void pokemonanimfunc_91(struct Sprite *sprite); +static void pokemonanimfunc_92(struct Sprite *sprite); +static void pokemonanimfunc_93(struct Sprite *sprite); +static void pokemonanimfunc_94(struct Sprite *sprite); +static void pokemonanimfunc_95(struct Sprite *sprite); +static void pokemonanimfunc_96(struct Sprite *sprite); -void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite); +static void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite); + +#define STRUCT_COUNT 4 + +// IWRAM bss +static IWRAM_DATA struct UnkAnimStruct sUnknown_03001240[STRUCT_COUNT]; +static IWRAM_DATA u8 sUnknown_03001270; +static IWRAM_DATA bool32 sUnknown_03001274; // const rom data -static const u8 sSpeciesToBackAnimId[] = +static const u8 sSpeciesToBackAnimSet[] = { 0x00, // SPECIES_NONE 0x13, // SPECIES_BULBASAUR @@ -592,7 +596,7 @@ static const u8 sSpeciesToBackAnimId[] = 0x11, // SPECIES_CHIMECHO }; -const u8 gUnknown_0860AA64[][2] = +static const u8 sUnknown_0860AA64[][2] = { {0, 5}, {1, 1}, @@ -610,7 +614,7 @@ const u8 gUnknown_0860AA64[][2] = {0, 0xFF} }; -const u8 gUnknown_0860AA80[][2] = +static const u8 sUnknown_0860AA80[][2] = { {6, 30}, {0xFE, 15}, @@ -773,7 +777,7 @@ static void (* const sMonAnimFunctions[])(struct Sprite *sprite) = pokemonanimfunc_96 }; -// counting from Id 1, because 0 in sSpeciesToBackAnimId is used for mons with no back animation +// counting from Id 1, because 0 in sSpeciesToBackAnimSet is used for mons with no back animation static const u8 sBackAnimationIds[] = { 0x60, 0x5f, 0x02, // 1 @@ -832,30 +836,30 @@ static const u8 sBackAnimNatureModTable[] = 0x01, // NATURE_QUIRKY }; -static const union AffineAnimCmd gSpriteAffineAnim_860AD48[] = +static const union AffineAnimCmd sSpriteAffineAnim_860AD48[] = { - AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(256, 256, 0, 0), AFFINEANIMCMDTYPE_END }; -static const union AffineAnimCmd gSpriteAffineAnim_860AD58[] = +static const union AffineAnimCmd sSpriteAffineAnim_860AD58[] = { - AFFINEANIMCMD_FRAME(-0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(-256, 256, 0, 0), AFFINEANIMCMDTYPE_END }; -static const union AffineAnimCmd *const gSpriteAffineAnimTable_860AD68[] = +static const union AffineAnimCmd *const sSpriteAffineAnimTable_860AD68[] = { - gSpriteAffineAnim_860AD48, - gSpriteAffineAnim_860AD58 + sSpriteAffineAnim_860AD48, + sSpriteAffineAnim_860AD58 }; // code -void MonAnimDummySpriteCallback(struct Sprite *sprite) +static void MonAnimDummySpriteCallback(struct Sprite *sprite) { } -void sub_817F3F0(struct Sprite *sprite, s16 index, s16 amplitudeX, s16 amplitudeY) +static void sub_817F3F0(struct Sprite *sprite, u16 index, s16 amplitudeX, s16 amplitudeY) { s16 xAdder, yAdder; @@ -872,38 +876,45 @@ void sub_817F3F0(struct Sprite *sprite, s16 index, s16 amplitudeX, s16 amplitude sprite->pos2.y = yAdder + amplitudeY; } -u8 GetSpeciesBackAnimId(u16 species) +u8 GetSpeciesBackAnimSet(u16 species) { - if (sSpeciesToBackAnimId[species] != 0) - return sSpeciesToBackAnimId[species] - 1; + if (sSpeciesToBackAnimSet[species] != 0) + return sSpeciesToBackAnimSet[species] - 1; else return 0; } -void sub_817F498(u8 taskId) +#define tState data[0] +#define tPtrLO data[1] +#define tPtrHI data[2] +#define tAnimId data[3] +#define tSaved0 data[4] +#define tSaved2 data[5] + +static void Task_HandleMonAnimation(u8 taskId) { u32 i; - struct Sprite *sprite = (struct Sprite*)(u32)((gTasks[taskId].data[1] << 0x10) | (gTasks[taskId].data[2])); + struct Sprite *sprite = (struct Sprite*)(u32)((gTasks[taskId].tPtrLO << 0x10) | (gTasks[taskId].tPtrHI)); - if (gTasks[taskId].data[0] == 0) + if (gTasks[taskId].tState == 0) { - gTasks[taskId].data[4] = sprite->data[0]; - gTasks[taskId].data[5] = sprite->data[2]; + gTasks[taskId].tSaved0 = sprite->data[0]; + gTasks[taskId].tSaved2 = sprite->data[2]; sprite->data[1] = 1; sprite->data[0] = 0; for (i = 2; i < 8; i++) sprite->data[i] = 0; - sprite->callback = sMonAnimFunctions[gTasks[taskId].data[3]]; - gUnknown_03001274 = FALSE; + sprite->callback = sMonAnimFunctions[gTasks[taskId].tAnimId]; + sUnknown_03001274 = FALSE; - gTasks[taskId].data[0]++; + gTasks[taskId].tState++; } if (sprite->callback == SpriteCallbackDummy) { - sprite->data[0] = gTasks[taskId].data[4]; - sprite->data[2] = gTasks[taskId].data[5]; + sprite->data[0] = gTasks[taskId].tSaved0; + sprite->data[2] = gTasks[taskId].tSaved2; sprite->data[1] = 0; DestroyTask(taskId); @@ -912,39 +923,46 @@ void sub_817F498(u8 taskId) void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId) { - u8 taskId = CreateTask(sub_817F498, 128); - gTasks[taskId].data[1] = (u32)(sprite) >> 0x10; - gTasks[taskId].data[2] = (u32)(sprite); - gTasks[taskId].data[3] = frontAnimId; + u8 taskId = CreateTask(Task_HandleMonAnimation, 128); + gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrHI = (u32)(sprite); + gTasks[taskId].tAnimId = frontAnimId; } -void sub_817F578(struct Sprite *sprite, u8 frontAnimId) +void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId) { - gUnknown_03001274 = TRUE; + sUnknown_03001274 = TRUE; sprite->callback = sMonAnimFunctions[frontAnimId]; } -void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimId) +void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) { u8 nature, taskId, animId, bank; - taskId = CreateTask(sub_817F498, 128); - gTasks[taskId].data[1] = (u32)(sprite) >> 0x10; - gTasks[taskId].data[2] = (u32)(sprite); + taskId = CreateTask(Task_HandleMonAnimation, 128); + gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrHI = (u32)(sprite); bank = sprite->data[0]; nature = GetNature(&gPlayerParty[gBattlePartyID[bank]]); - animId = 3 * backAnimId + sBackAnimNatureModTable[nature]; - gTasks[taskId].data[3] = sBackAnimationIds[animId]; + animId = 3 * backAnimSet + sBackAnimNatureModTable[nature]; + gTasks[taskId].tAnimId = sBackAnimationIds[animId]; } -void sub_817F60C(struct Sprite *sprite) +#undef tState +#undef tPtrLO +#undef tPtrHI +#undef tAnimId +#undef tSaved0 +#undef tSaved2 + +void SetSpriteCB_MonAnimDummy(struct Sprite *sprite) { sprite->callback = MonAnimDummySpriteCallback; } -void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) +static void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) { u8 matrixNum; struct ObjAffineSrcData affineSrcData; @@ -963,12 +981,12 @@ void SetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) gOamMatrices[matrixNum].d = dest.d; } -void HandleStartAffineAnim(struct Sprite *sprite) +static void HandleStartAffineAnim(struct Sprite *sprite) { sprite->oam.affineMode = 3; - sprite->affineAnims = gSpriteAffineAnimTable_860AD68; + sprite->affineAnims = sSpriteAffineAnimTable_860AD68; - if (gUnknown_03001274 == TRUE) + if (sUnknown_03001274 == TRUE) InitSpriteAffineAnim(sprite); if (!sprite->data[1]) @@ -980,7 +998,7 @@ void HandleStartAffineAnim(struct Sprite *sprite) sprite->affineAnimPaused = 1; } -void HandleSetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) +static void HandleSetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rotation) { if (!sprite->data[1]) { @@ -991,42 +1009,42 @@ void HandleSetAffineData(struct Sprite *sprite, s16 xScale, s16 yScale, u16 rota SetAffineData(sprite, xScale, yScale, rotation); } -void sub_817F70C(struct Sprite *sprite) +static void sub_817F70C(struct Sprite *sprite) { if (!sprite->data[1]) sprite->pos2.x *= -1; } -bool32 sub_817F724(u8 id) +static bool32 sub_817F724(u8 id) { - if (id >= 4) + if (id >= STRUCT_COUNT) { return FALSE; } else { - gUnknown_03001240[id].field_6 = 0; - gUnknown_03001240[id].field_0 = 0; - gUnknown_03001240[id].field_4 = 1; - gUnknown_03001240[id].field_2 = 0; - gUnknown_03001240[id].field_8 = 0; + sUnknown_03001240[id].field_6 = 0; + sUnknown_03001240[id].field_0 = 0; + sUnknown_03001240[id].field_4 = 1; + sUnknown_03001240[id].field_2 = 0; + sUnknown_03001240[id].field_8 = 0; return TRUE; } } -u8 sub_817F758(void) +static u8 sub_817F758(void) { - gUnknown_03001270 = (gUnknown_03001270 + 1) % 4; - sub_817F724(gUnknown_03001270); - return gUnknown_03001270; + sUnknown_03001270 = (sUnknown_03001270 + 1) % STRUCT_COUNT; + sub_817F724(sUnknown_03001270); + return sUnknown_03001270; } -void sub_817F77C(struct Sprite *sprite) +static void sub_817F77C(struct Sprite *sprite) { sprite->oam.affineMode = 1; CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode); - if (gUnknown_03001274 == TRUE) + if (sUnknown_03001274 == TRUE) { if (!sprite->data[1]) sprite->hFlip = 1; @@ -1039,14 +1057,14 @@ void sub_817F77C(struct Sprite *sprite) } } -void pokemonanimfunc_01(struct Sprite *sprite) +static void pokemonanimfunc_01(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); if (sprite->data[2] > 40) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -1062,7 +1080,7 @@ void pokemonanimfunc_01(struct Sprite *sprite) sprite->data[2]++; } -void pokemonanimfunc_02(struct Sprite *sprite) +static void pokemonanimfunc_02(struct Sprite *sprite) { if (sprite->data[2] > 40) { @@ -1083,7 +1101,7 @@ void pokemonanimfunc_02(struct Sprite *sprite) sprite->data[2]++; } -void sub_817F8FC(struct Sprite *sprite) +static void sub_817F8FC(struct Sprite *sprite) { sub_817F70C(sprite); @@ -1101,14 +1119,14 @@ void sub_817F8FC(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_03(struct Sprite *sprite) +static void pokemonanimfunc_03(struct Sprite *sprite) { sprite->data[0] = 40; sub_817F8FC(sprite); sprite->callback = sub_817F8FC; } -void sub_817F978(struct Sprite *sprite) +static void sub_817F978(struct Sprite *sprite) { sub_817F70C(sprite); @@ -1126,7 +1144,7 @@ void sub_817F978(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_04(struct Sprite *sprite) +static void pokemonanimfunc_04(struct Sprite *sprite) { sprite->data[0] = 40; sub_817F978(sprite); @@ -1134,7 +1152,7 @@ void pokemonanimfunc_04(struct Sprite *sprite) } #ifdef NONMATCHING -void sub_817F9F4(struct Sprite *sprite) +static void sub_817F9F4(struct Sprite *sprite) { s32 counter = sprite->data[2]; @@ -1166,7 +1184,7 @@ void sub_817F9F4(struct Sprite *sprite) #else __attribute__((naked)) -void sub_817F9F4(struct Sprite *sprite) +static void sub_817F9F4(struct Sprite *sprite) { asm(".syntax unified\n\ push {r4,lr}\n\ @@ -1235,14 +1253,14 @@ _0817FA60:\n\ #endif // NONMATCHING -void pokemonanimfunc_1E(struct Sprite *sprite) +static void pokemonanimfunc_1E(struct Sprite *sprite) { sprite->data[0] = 4; sub_817F9F4(sprite); sprite->callback = sub_817F9F4; } -void pokemonanimfunc_06(struct Sprite *sprite) +static void pokemonanimfunc_06(struct Sprite *sprite) { s32 counter = sprite->data[2]; @@ -1282,14 +1300,14 @@ void pokemonanimfunc_06(struct Sprite *sprite) sprite->data[2] += 12; } -void pokemonanimfunc_09(struct Sprite *sprite) +static void pokemonanimfunc_09(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); if (sprite->data[2] > 40) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -1314,7 +1332,7 @@ void pokemonanimfunc_09(struct Sprite *sprite) sprite->data[2]++; } -static const s8 gUnknown_0860AD70[][3] = +static const s8 sUnknown_0860AD70[][3] = { {-1, -1, 6}, {2, 0, 6}, @@ -1328,16 +1346,16 @@ static const s8 gUnknown_0860AD70[][3] = {0, 0, 0}, }; -void sub_817FC20(struct Sprite *sprite) +static void sub_817FC20(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) sprite->data[3] = 0; - if (gUnknown_0860AD70[sprite->data[3]][2] == sprite->data[2]) + if (sUnknown_0860AD70[sprite->data[3]][2] == sprite->data[2]) { - if (gUnknown_0860AD70[sprite->data[3]][2] == 0) + if (sUnknown_0860AD70[sprite->data[3]][2] == 0) { sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -1348,26 +1366,26 @@ void sub_817FC20(struct Sprite *sprite) } } - if (gUnknown_0860AD70[sprite->data[3]][2] == 0) + if (sUnknown_0860AD70[sprite->data[3]][2] == 0) { sprite->callback = SpriteCB_SetDummyOnAnimEnd; } else { - sprite->pos2.x += gUnknown_0860AD70[sprite->data[3]][0]; - sprite->pos2.y += gUnknown_0860AD70[sprite->data[3]][1]; + sprite->pos2.x += sUnknown_0860AD70[sprite->data[3]][0]; + sprite->pos2.y += sUnknown_0860AD70[sprite->data[3]][1]; sprite->data[2]++; sub_817F70C(sprite); } } -void pokemonanimfunc_0A(struct Sprite *sprite) +static void pokemonanimfunc_0A(struct Sprite *sprite) { sub_817FC20(sprite); sprite->callback = sub_817FC20; } -void sub_817FCDC(struct Sprite *sprite) +static void sub_817FCDC(struct Sprite *sprite) { s32 counter = sprite->data[2]; @@ -1384,7 +1402,7 @@ void sub_817FCDC(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -void pokemonanimfunc_0F(struct Sprite *sprite) +static void pokemonanimfunc_0F(struct Sprite *sprite) { sprite->data[0] = 60; sprite->data[7] = 3; @@ -1392,7 +1410,7 @@ void pokemonanimfunc_0F(struct Sprite *sprite) sprite->callback = sub_817FCDC; } -void sub_817FD44(struct Sprite *sprite) +static void sub_817FD44(struct Sprite *sprite) { s32 counter = sprite->data[2]; @@ -1409,14 +1427,14 @@ void sub_817FD44(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -void pokemonanimfunc_10(struct Sprite *sprite) +static void pokemonanimfunc_10(struct Sprite *sprite) { sprite->data[0] = 60; sub_817FD44(sprite); sprite->callback = sub_817FD44; } -void pokemonanimfunc_11(struct Sprite *sprite) +static void pokemonanimfunc_11(struct Sprite *sprite) { if (sprite->data[2] > 512) { @@ -1444,30 +1462,30 @@ void pokemonanimfunc_11(struct Sprite *sprite) sprite->data[2] += 9; } -void sub_817FE30(struct Sprite *sprite) +static void sub_817FE30(struct Sprite *sprite) { s16 id = sprite->data[0]; - if (gUnknown_03001240[id].field_0 != 0) + if (sUnknown_03001240[id].field_0 != 0) { - gUnknown_03001240[id].field_0--; + sUnknown_03001240[id].field_0--; } else { - if (sprite->data[2] == 0 && gUnknown_03001240[id].field_8 == 0) + if (sprite->data[2] == 0 && sUnknown_03001240[id].field_8 == 0) { HandleStartAffineAnim(sprite); - gUnknown_03001240[id].field_8++; + sUnknown_03001240[id].field_8++; } - if (sprite->data[2] > gUnknown_03001240[id].field_6) + if (sprite->data[2] > sUnknown_03001240[id].field_6) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); - if (gUnknown_03001240[id].field_4 > 1) + if (sUnknown_03001240[id].field_4 > 1) { - gUnknown_03001240[id].field_4--; - gUnknown_03001240[id].field_0 = 10; + sUnknown_03001240[id].field_4--; + sUnknown_03001240[id].field_0 = 10; sprite->data[2] = 0; } else @@ -1479,62 +1497,62 @@ void sub_817FE30(struct Sprite *sprite) else { sprite->data[6] = Sin(sprite->data[2] % 256, 4096); - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[6]); + HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } sprite->data[2] += 16; } } -void pokemonanimfunc_12(struct Sprite *sprite) +static void pokemonanimfunc_12(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 512; - gUnknown_03001240[id].field_0 = 0; + sUnknown_03001240[id].field_6 = 512; + sUnknown_03001240[id].field_0 = 0; sub_817FE30(sprite); sprite->callback = sub_817FE30; } -void sub_817FF3C(struct Sprite *sprite) +static void sub_817FF3C(struct Sprite *sprite) { u8 id = sprite->data[0]; if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); - if (sprite->data[2] > gUnknown_03001240[id].field_0) + if (sprite->data[2] > sUnknown_03001240[id].field_0) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } else { - sprite->data[6] = (65536 / gUnknown_03001240[id].field_8) * sprite->data[2]; - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[6]); + sprite->data[6] = (65536 / sUnknown_03001240[id].field_8) * sprite->data[2]; + HandleSetAffineData(sprite, 256, 256, sprite->data[6]); } sprite->data[2]++; } -void pokemonanimfunc_1F(struct Sprite *sprite) +static void pokemonanimfunc_1F(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_0 = 60; - gUnknown_03001240[id].field_8 = 20; + sUnknown_03001240[id].field_0 = 60; + sUnknown_03001240[id].field_8 = 20; sub_817FF3C(sprite); sprite->callback = sub_817FF3C; } -void sub_817FFF0(struct Sprite *sprite) +static void sub_817FFF0(struct Sprite *sprite) { u8 id = sprite->data[0]; sub_817F70C(sprite); - if (sprite->data[2] > gUnknown_03001240[id].field_6) + if (sprite->data[2] > sUnknown_03001240[id].field_6) { sprite->pos2.x = 0; sprite->pos2.y = 0; @@ -1544,26 +1562,26 @@ void sub_817FFF0(struct Sprite *sprite) { s16 index = (sprite->data[2] + 192) % 256; - sprite->pos2.x = -(Cos(index, gUnknown_03001240[id].field_8 * 2)); - sprite->pos2.y = Sin(index, gUnknown_03001240[id].field_8) + gUnknown_03001240[id].field_8; + sprite->pos2.x = -(Cos(index, sUnknown_03001240[id].field_8 * 2)); + sprite->pos2.y = Sin(index, sUnknown_03001240[id].field_8) + sUnknown_03001240[id].field_8; } - sprite->data[2] += gUnknown_03001240[id].field_2; + sprite->data[2] += sUnknown_03001240[id].field_2; sub_817F70C(sprite); } -void pokemonanimfunc_14(struct Sprite *sprite) +static void pokemonanimfunc_14(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 512; - gUnknown_03001240[id].field_8 = 6; - gUnknown_03001240[id].field_2 = 24; + sUnknown_03001240[id].field_6 = 512; + sUnknown_03001240[id].field_8 = 6; + sUnknown_03001240[id].field_2 = 24; sub_817FFF0(sprite); sprite->callback = sub_817FFF0; } -void pokemonanimfunc_15(struct Sprite *sprite) +static void pokemonanimfunc_15(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -1582,7 +1600,7 @@ void pokemonanimfunc_15(struct Sprite *sprite) sprite->data[2]++; } -void pokemonanimfunc_16(struct Sprite *sprite) +static void pokemonanimfunc_16(struct Sprite *sprite) { s16 index1 = 0, index2 = 0; @@ -1591,7 +1609,7 @@ void pokemonanimfunc_16(struct Sprite *sprite) if (sprite->data[2] > 40) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -1617,7 +1635,7 @@ void pokemonanimfunc_16(struct Sprite *sprite) sprite->data[2]++; } -void pokemonanimfunc_17(struct Sprite *sprite) +static void pokemonanimfunc_17(struct Sprite *sprite) { s16 posY = 0, index1 = 0, index2 = 0; @@ -1626,7 +1644,7 @@ void pokemonanimfunc_17(struct Sprite *sprite) if (sprite->data[2] > 40) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; sprite->pos2.y = posY; @@ -1658,12 +1676,12 @@ void pokemonanimfunc_17(struct Sprite *sprite) sprite->data[2]++; } -void sub_818031C(struct Sprite *sprite) +static void sub_818031C(struct Sprite *sprite) { u8 index = sprite->data[2]; u8 var7 = sprite->data[6]; - u8 var5 = gUnknown_0860AA80[sprite->data[5]][0]; - u8 var6 = gUnknown_0860AA80[sprite->data[5]][1]; + u8 var5 = sUnknown_0860AA80[sprite->data[5]][0]; + u8 var6 = sUnknown_0860AA80[sprite->data[5]][1]; u8 amplitude = 0; if (var5 != 0xFE) @@ -1693,14 +1711,14 @@ void sub_818031C(struct Sprite *sprite) } } -void pokemonanimfunc_19(struct Sprite *sprite) +static void pokemonanimfunc_19(struct Sprite *sprite) { sprite->data[0] = 48; sub_818031C(sprite); sprite->callback = sub_818031C; } -void pokemonanimfunc_1A(struct Sprite *sprite) +static void pokemonanimfunc_1A(struct Sprite *sprite) { u8 counter = 0; @@ -1712,7 +1730,7 @@ void pokemonanimfunc_1A(struct Sprite *sprite) if (sprite->data[2] > 35) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; sprite->pos2.x = 0; @@ -1722,25 +1740,25 @@ void pokemonanimfunc_1A(struct Sprite *sprite) s16 index = ((counter - 10) * 128) / 20; if (counter < 10) - HandleSetAffineData(sprite, 0x100, 0x100, counter / 2 * 512); + HandleSetAffineData(sprite, 256, 256, counter / 2 * 512); else if (counter >= 10 && counter <= 29) sprite->pos2.x = -(Sin(index, 5)); else - HandleSetAffineData(sprite, 0x100, 0x100, (35 - counter) / 2 * 1024); + HandleSetAffineData(sprite, 256, 256, (35 - counter) / 2 * 1024); } sprite->data[2]++; sub_817F70C(sprite); } -void pokemonanimfunc_1B(struct Sprite *sprite) +static void pokemonanimfunc_1B(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); if (sprite->data[2] > 100) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1749,13 +1767,13 @@ void pokemonanimfunc_1B(struct Sprite *sprite) { s16 index = (sprite->data[2] * 256) / 100; sprite->pos2.y = Sin(index, 10); - HandleSetAffineData(sprite, 0x100, 0x100, Sin(index, 3276)); + HandleSetAffineData(sprite, 256, 256, Sin(index, 3276)); } sprite->data[2]++; } -void sub_81804F8(struct Sprite *sprite) +static void sub_81804F8(struct Sprite *sprite) { s32 var = 0; s16 index = 0; @@ -1765,7 +1783,7 @@ void sub_81804F8(struct Sprite *sprite) if (sprite->data[2] > 100) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1776,20 +1794,20 @@ void sub_81804F8(struct Sprite *sprite) var = (sprite->data[2] * 512) / 100; var &= 0xFF; sprite->pos2.y = Sin(index, sprite->data[0]); - HandleSetAffineData(sprite, 0x100, 0x100, Sin(var, 3276)); + HandleSetAffineData(sprite, 256, 256, Sin(var, 3276)); } sprite->data[2]++; } -void pokemonanimfunc_1C(struct Sprite *sprite) +static void pokemonanimfunc_1C(struct Sprite *sprite) { sprite->data[0] = 10; sub_81804F8(sprite); sprite->callback = sub_81804F8; } -void sub_81805B0(struct Sprite *sprite) +static void sub_81805B0(struct Sprite *sprite) { s32 var = 0; s16 index = 0; @@ -1799,7 +1817,7 @@ void sub_81805B0(struct Sprite *sprite) if (sprite->data[2] > 100) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1810,20 +1828,20 @@ void sub_81805B0(struct Sprite *sprite) var = (sprite->data[2] * 512) / 100; var &= 0xFF; sprite->pos2.y = -(Sin(index / 2, sprite->data[0] * 2)); - HandleSetAffineData(sprite, 0x100, 0x100, Sin(var, 3276)); + HandleSetAffineData(sprite, 256, 256, Sin(var, 3276)); } sprite->data[2]++; } -void pokemonanimfunc_18(struct Sprite *sprite) +static void pokemonanimfunc_18(struct Sprite *sprite) { sprite->data[0] = 5; sub_81805B0(sprite); sprite->callback = sub_81805B0; } -void pokemonanimfunc_1D(struct Sprite *sprite) +static void pokemonanimfunc_1D(struct Sprite *sprite) { s32 var; s16 index = 0; @@ -1836,7 +1854,7 @@ void pokemonanimfunc_1D(struct Sprite *sprite) if (sprite->data[2] > 100) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1849,14 +1867,14 @@ void pokemonanimfunc_1D(struct Sprite *sprite) var = (sprite->data[2] * 512) / toDiv; var &= 0xFF; sprite->pos2.x = Sin(index, 8); - HandleSetAffineData(sprite, 0x100, 0x100, Sin(var, 3276)); + HandleSetAffineData(sprite, 256, 256, Sin(var, 3276)); } sprite->data[2]++; sub_817F70C(sprite); } -void sub_8180714(struct Sprite *sprite) +static void sub_8180714(struct Sprite *sprite) { s16 posY = 0; @@ -1870,7 +1888,7 @@ void sub_8180714(struct Sprite *sprite) if (sprite->data[2] > sprite->data[0] * 3) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1885,7 +1903,7 @@ void sub_8180714(struct Sprite *sprite) posY = (256 - yScale) / 8; sprite->pos2.y = -(Sin(sprite->data[3], 10)) - posY; - HandleSetAffineData(sprite, 0x100 - Sin(sprite->data[4], 32), yScale, 0); + HandleSetAffineData(sprite, 256 - Sin(sprite->data[4], 32), yScale, 0); sprite->data[2]++; sprite->data[4] = (sprite->data[4] + 128 / sprite->data[0]) & 0xFF; } @@ -1893,20 +1911,20 @@ void sub_8180714(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_00(struct Sprite *sprite) +static void pokemonanimfunc_00(struct Sprite *sprite) { sprite->data[0] = 16; sub_8180714(sprite); sprite->callback = sub_8180714; } -void sub_8180828(struct Sprite *sprite) +static void sub_8180828(struct Sprite *sprite) { s16 posY = 0; if (sprite->data[2] > (128 / sprite->data[6]) * sprite->data[7]) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -1925,7 +1943,7 @@ void sub_8180828(struct Sprite *sprite) } } -void pokemonanimfunc_13(struct Sprite *sprite) +static void pokemonanimfunc_13(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -1937,7 +1955,7 @@ void pokemonanimfunc_13(struct Sprite *sprite) sub_8180828(sprite); } -static const s8 gUnknown_0860AD8E[][8][3] = +static const s8 sUnknown_0860AD8E[][8][3] = { { {0, 8, 8}, @@ -1961,7 +1979,7 @@ static const s8 gUnknown_0860AD8E[][8][3] = }, }; -void sub_8180900(struct Sprite *sprite) +static void sub_8180900(struct Sprite *sprite) { s16 var; u8 structId; @@ -1972,10 +1990,10 @@ void sub_8180900(struct Sprite *sprite) sub_817F70C(sprite); structId = sprite->data[0]; - var = gUnknown_03001240[structId].field_6; - r9 = gUnknown_0860AD8E[gUnknown_03001240[structId].field_8][sprite->data[4]][0]; - r10 = gUnknown_0860AD8E[gUnknown_03001240[structId].field_8][sprite->data[4]][1] - r9; - arrId = gUnknown_03001240[structId].field_8; + var = sUnknown_03001240[structId].field_6; + r9 = sUnknown_0860AD8E[sUnknown_03001240[structId].field_8][sprite->data[4]][0]; + r10 = sUnknown_0860AD8E[sUnknown_03001240[structId].field_8][sprite->data[4]][1] - r9; + arrId = sUnknown_03001240[structId].field_8; r7 = sprite->data[3]; if (sprite->data[2] == 0) @@ -1984,9 +2002,9 @@ void sub_8180900(struct Sprite *sprite) sprite->data[2]++; } - if (gUnknown_0860AD8E[arrId][sprite->data[4]][2] == 0) + if (sUnknown_0860AD8E[arrId][sprite->data[4]][2] == 0) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; sprite->pos2.y = 0; sub_817F77C(sprite); @@ -1996,13 +2014,13 @@ void sub_8180900(struct Sprite *sprite) { u16 rotation; - sprite->pos2.y = -(Sin(r7 * 128 / gUnknown_0860AD8E[arrId][sprite->data[4]][2], 10)); - sprite->pos2.x = (r10 * r7 / gUnknown_0860AD8E[arrId][sprite->data[4]][2]) + r9; + sprite->pos2.y = -(Sin(r7 * 128 / sUnknown_0860AD8E[arrId][sprite->data[4]][2], 10)); + sprite->pos2.x = (r10 * r7 / sUnknown_0860AD8E[arrId][sprite->data[4]][2]) + r9; rotation = -(var * sprite->pos2.x) / 8; - HandleSetAffineData(sprite, 0x100, 0x100, rotation); + HandleSetAffineData(sprite, 256, 256, rotation); - if (r7 == gUnknown_0860AD8E[arrId][sprite->data[4]][2]) + if (r7 == sUnknown_0860AD8E[arrId][sprite->data[4]][2]) { sprite->data[4]++; sprite->data[3] = 0; @@ -2016,16 +2034,16 @@ void sub_8180900(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_05(struct Sprite *sprite) +static void pokemonanimfunc_05(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 4096; - gUnknown_03001240[id].field_8 = sprite->data[6]; + sUnknown_03001240[id].field_6 = 4096; + sUnknown_03001240[id].field_8 = sprite->data[6]; sub_8180900(sprite); sprite->callback = sub_8180900; } -void pokemonanimfunc_20(struct Sprite *sprite) +static void pokemonanimfunc_20(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -2044,7 +2062,7 @@ void pokemonanimfunc_20(struct Sprite *sprite) sprite->data[2] += 2; } -void pokemonanimfunc_21(struct Sprite *sprite) +static void pokemonanimfunc_21(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -2063,7 +2081,7 @@ void pokemonanimfunc_21(struct Sprite *sprite) sprite->data[2] += 2; } -void pokemonanimfunc_22(struct Sprite *sprite) +static void pokemonanimfunc_22(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -2082,7 +2100,7 @@ void pokemonanimfunc_22(struct Sprite *sprite) sprite->data[2] += 2; } -void pokemonanimfunc_23(struct Sprite *sprite) +static void pokemonanimfunc_23(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -2101,7 +2119,7 @@ void pokemonanimfunc_23(struct Sprite *sprite) sprite->data[2] += 2; } -void pokemonanimfunc_24(struct Sprite *sprite) +static void pokemonanimfunc_24(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; @@ -2120,19 +2138,19 @@ void pokemonanimfunc_24(struct Sprite *sprite) sprite->data[2] += 2; } -void sub_8180CB4(struct Sprite *sprite); -void sub_8180CE8(struct Sprite *sprite); -void sub_8180D44(struct Sprite *sprite); -void sub_8180DC0(struct Sprite *sprite); -void sub_8180E28(struct Sprite *sprite); +static void sub_8180CB4(struct Sprite *sprite); +static void sub_8180CE8(struct Sprite *sprite); +static void sub_8180D44(struct Sprite *sprite); +static void sub_8180DC0(struct Sprite *sprite); +static void sub_8180E28(struct Sprite *sprite); -void pokemonanimfunc_25(struct Sprite *sprite) +static void pokemonanimfunc_25(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->callback = sub_8180CB4; } -void sub_8180CB4(struct Sprite *sprite) +static void sub_8180CB4(struct Sprite *sprite) { sub_817F70C(sprite); if (++sprite->pos2.x > 7) @@ -2144,7 +2162,7 @@ void sub_8180CB4(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180CE8(struct Sprite *sprite) +static void sub_8180CE8(struct Sprite *sprite) { sub_817F70C(sprite); @@ -2172,7 +2190,7 @@ void sub_8180CE8(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180D44(struct Sprite *sprite) +static void sub_8180D44(struct Sprite *sprite) { u8 rotation; @@ -2184,7 +2202,7 @@ void sub_8180D44(struct Sprite *sprite) if (++sprite->data[5] > sprite->data[6]) sprite->data[5] = sprite->data[6]; - HandleSetAffineData(sprite, 0x100, 0x100, rotation * 256); + HandleSetAffineData(sprite, 256, 256, rotation * 256); if (sprite->pos2.x < -8) { @@ -2198,7 +2216,7 @@ void sub_8180D44(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180DC0(struct Sprite *sprite) +static void sub_8180DC0(struct Sprite *sprite) { sub_817F70C(sprite); @@ -2208,7 +2226,7 @@ void sub_8180DC0(struct Sprite *sprite) if (sprite->data[2] < 0) sprite->data[2] = 0; - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[2] << 8); + HandleSetAffineData(sprite, 256, 256, sprite->data[2] << 8); if (sprite->data[2] == 0) sprite->callback = sub_8180E28; } @@ -2222,7 +2240,7 @@ void sub_8180DC0(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180E28(struct Sprite *sprite) +static void sub_8180E28(struct Sprite *sprite) { sub_817F70C(sprite); @@ -2237,18 +2255,18 @@ void sub_8180E28(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180E78(struct Sprite *sprite); -void sub_8180ED0(struct Sprite *sprite); -void sub_8180F2C(struct Sprite *sprite); +static void sub_8180E78(struct Sprite *sprite); +static void sub_8180ED0(struct Sprite *sprite); +static void sub_8180F2C(struct Sprite *sprite); -void pokemonanimfunc_26(struct Sprite *sprite) +static void pokemonanimfunc_26(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[3] = 0; sprite->callback = sub_8180E78; } -void sub_8180E78(struct Sprite *sprite) +static void sub_8180E78(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x++; @@ -2267,7 +2285,7 @@ void sub_8180E78(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180ED0(struct Sprite *sprite) +static void sub_8180ED0(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x = Cos(sprite->data[4], 16) - 8; @@ -2286,7 +2304,7 @@ void sub_8180ED0(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8180F2C(struct Sprite *sprite) +static void sub_8180F2C(struct Sprite *sprite) { sub_817F70C(sprite); @@ -2302,7 +2320,7 @@ void sub_8180F2C(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[2], 5)) + 4; sprite->data[2] -= 4; rotation = sprite->data[2] - 32; - HandleSetAffineData(sprite, 0x100, 0x100, rotation * 512); + HandleSetAffineData(sprite, 256, 256, rotation * 512); if (sprite->data[2] <= 32) { @@ -2316,7 +2334,7 @@ void sub_8180F2C(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_27(struct Sprite *sprite) +static void pokemonanimfunc_27(struct Sprite *sprite) { if (sprite->data[3] > 0) { @@ -2335,17 +2353,17 @@ void pokemonanimfunc_27(struct Sprite *sprite) } } -void sub_8181024(struct Sprite *sprite); -void sub_8181068(struct Sprite *sprite); -void sub_81810C4(struct Sprite *sprite); +static void sub_8181024(struct Sprite *sprite); +static void sub_8181068(struct Sprite *sprite); +static void sub_81810C4(struct Sprite *sprite); -void pokemonanimfunc_28(struct Sprite *sprite) +static void pokemonanimfunc_28(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->callback = sub_8181024; } -void sub_8181024(struct Sprite *sprite) +static void sub_8181024(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x--; @@ -2362,7 +2380,7 @@ void sub_8181024(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181068(struct Sprite *sprite) +static void sub_8181068(struct Sprite *sprite) { u32 rotation; @@ -2371,7 +2389,7 @@ void sub_8181068(struct Sprite *sprite) sprite->pos2.x = Cos(sprite->data[2], 22); sprite->pos2.y = -(Sin(sprite->data[2], 22)); rotation = sprite->data[2] - 32; - HandleSetAffineData(sprite, 0x100, 0x100, rotation * 512); + HandleSetAffineData(sprite, 256, 256, rotation * 512); if (sprite->data[2] <= 32) sprite->callback = sub_81810C4; @@ -2379,7 +2397,7 @@ void sub_8181068(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_81810C4(struct Sprite *sprite) +static void sub_81810C4(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x--; @@ -2394,17 +2412,17 @@ void sub_81810C4(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181110(struct Sprite *sprite); -void sub_8181144(struct Sprite *sprite); -void sub_81811A4(struct Sprite *sprite); +static void sub_8181110(struct Sprite *sprite); +static void sub_8181144(struct Sprite *sprite); +static void sub_81811A4(struct Sprite *sprite); -void pokemonanimfunc_29(struct Sprite *sprite) +static void pokemonanimfunc_29(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->callback = sub_8181110; } -void sub_8181110(struct Sprite *sprite) +static void sub_8181110(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x++; @@ -2419,7 +2437,7 @@ void sub_8181110(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181144(struct Sprite *sprite) +static void sub_8181144(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[2] += 16; @@ -2437,11 +2455,11 @@ void sub_8181144(struct Sprite *sprite) sprite->pos2.y += 2; } - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[2] << 8); + HandleSetAffineData(sprite, 256, 256, sprite->data[2] << 8); sub_817F70C(sprite); } -void sub_81811A4(struct Sprite *sprite) +static void sub_81811A4(struct Sprite *sprite) { sub_817F70C(sprite); sprite->pos2.x++; @@ -2458,21 +2476,21 @@ void sub_81811A4(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181214(struct Sprite *sprite); +static void sub_8181214(struct Sprite *sprite); -void pokemonanimfunc_2A(struct Sprite *sprite) +static void pokemonanimfunc_2A(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_2 = 2; + sUnknown_03001240[id].field_2 = 2; sub_8181214(sprite); sprite->callback = sub_8181214; } -void sub_8181214(struct Sprite *sprite) +static void sub_8181214(struct Sprite *sprite) { - if (gUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sUnknown_03001240[sprite->data[0]].field_0 != 0) { - gUnknown_03001240[sprite->data[0]].field_0--; + sUnknown_03001240[sprite->data[0]].field_0--; } else { @@ -2481,7 +2499,7 @@ void sub_8181214(struct Sprite *sprite) { sprite->data[2]++; HandleStartAffineAnim(sprite); - sprite->data[7] = gUnknown_03001240[sprite->data[0]].field_2; + sprite->data[7] = sUnknown_03001240[sprite->data[0]].field_2; sprite->data[3] = -1; sprite->data[4] = -1; sprite->data[5] = 0; @@ -2508,12 +2526,12 @@ void sub_8181214(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_4--; sprite->data[5] = 0; sprite->data[6] = 0; - gUnknown_03001240[sprite->data[0]].field_0 = 10; + sUnknown_03001240[sprite->data[0]].field_0 = 10; } else { @@ -2522,14 +2540,14 @@ void sub_8181214(struct Sprite *sprite) } } - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[6] << 8); + HandleSetAffineData(sprite, 256, 256, sprite->data[6] << 8); sub_817F70C(sprite); } } -void sub_8181370(struct Sprite *sprite); +static void sub_8181370(struct Sprite *sprite); -void pokemonanimfunc_2B(struct Sprite *sprite) +static void pokemonanimfunc_2B(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[6] = 0; @@ -2537,7 +2555,7 @@ void pokemonanimfunc_2B(struct Sprite *sprite) sprite->callback = sub_8181370; } -void sub_8181370(struct Sprite *sprite) +static void sub_8181370(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[6] += 4; @@ -2545,12 +2563,12 @@ void sub_8181370(struct Sprite *sprite) sprite->pos2.y = -(Sin((sprite->data[6] * 2) & 0xFF, 8)); if (sprite->data[6] > 192 && sprite->data[7] == 1) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->data[7]++; } else if (sprite->data[6] > 64 && sprite->data[7] == 0) { - HandleSetAffineData(sprite, -0x100, 0x100, 0); + HandleSetAffineData(sprite, -256, 256, 0); sprite->data[7]++; } @@ -2558,14 +2576,14 @@ void sub_8181370(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } sub_817F70C(sprite); } -void pokemonanimfunc_2C(struct Sprite *sprite) +static void pokemonanimfunc_2C(struct Sprite *sprite) { if (++sprite->data[2] == 1) { @@ -2575,7 +2593,7 @@ void pokemonanimfunc_2C(struct Sprite *sprite) sprite->data[4] = 0; } - if (gUnknown_0860AA64[sprite->data[6]][1] == 0xFF) + if (sUnknown_0860AA64[sprite->data[6]][1] == 0xFF) { sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -2583,7 +2601,7 @@ void pokemonanimfunc_2C(struct Sprite *sprite) { if (sprite->data[4] == 1) { - if (gUnknown_0860AA64[sprite->data[6]][0] != 0) + if (sUnknown_0860AA64[sprite->data[6]][0] != 0) BlendPalette(sprite->data[7], 0x10, 0x10, 0x3FF); else BlendPalette(sprite->data[7], 0x10, 0, 0x3FF); @@ -2591,7 +2609,7 @@ void pokemonanimfunc_2C(struct Sprite *sprite) sprite->data[4] = 0; } - if (gUnknown_0860AA64[sprite->data[6]][1] == sprite->data[5]) + if (sUnknown_0860AA64[sprite->data[6]][1] == sprite->data[5]) { sprite->data[4] = 1; sprite->data[5] = 0; @@ -2604,19 +2622,19 @@ void pokemonanimfunc_2C(struct Sprite *sprite) } } -void sub_81814D4(struct Sprite *sprite) +static void sub_81814D4(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); sub_817F70C(sprite); - if (sprite->data[2] > gUnknown_03001240[sprite->data[0]].field_8) + if (sprite->data[2] > sUnknown_03001240[sprite->data[0]].field_8) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_4--; sprite->data[2] = 0; } else @@ -2627,36 +2645,36 @@ void sub_81814D4(struct Sprite *sprite) } else { - s16 index = (sprite->data[2] * 256) / gUnknown_03001240[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sUnknown_03001240[sprite->data[0]].field_8; sprite->pos2.x = -(Sin(index, 10)); - HandleSetAffineData(sprite, 0x100, 0x100, Sin(index, 3276)); + HandleSetAffineData(sprite, 256, 256, Sin(index, 3276)); } sprite->data[2]++; sub_817F70C(sprite); } -void pokemonanimfunc_2D(struct Sprite *sprite) +static void pokemonanimfunc_2D(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 50; + sUnknown_03001240[id].field_8 = 50; sub_81814D4(sprite); sprite->callback = sub_81814D4; } -void sub_81815D4(struct Sprite *sprite) +static void sub_81815D4(struct Sprite *sprite) { if (sprite->data[2] == 0) HandleStartAffineAnim(sprite); sub_817F70C(sprite); - if (sprite->data[2] > gUnknown_03001240[sprite->data[0]].field_8) + if (sprite->data[2] > sUnknown_03001240[sprite->data[0]].field_8) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.x = 0; - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_4--; sprite->data[2] = 0; } else @@ -2667,28 +2685,28 @@ void sub_81815D4(struct Sprite *sprite) } else { - s16 index = (sprite->data[2] * 256) / gUnknown_03001240[sprite->data[0]].field_8; + s16 index = (sprite->data[2] * 256) / sUnknown_03001240[sprite->data[0]].field_8; sprite->pos2.x = -(Sin(index, 10)); - HandleSetAffineData(sprite, 0x100, 0x100, -(Sin(index, 3276))); + HandleSetAffineData(sprite, 256, 256, -(Sin(index, 3276))); } sprite->data[2]++; sub_817F70C(sprite); } -void pokemonanimfunc_2E(struct Sprite *sprite) +static void pokemonanimfunc_2E(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 50; + sUnknown_03001240[id].field_8 = 50; sub_81815D4(sprite); sprite->callback = sub_81815D4; } -void sub_8181708(struct Sprite *sprite); -void sub_8181770(struct Sprite *sprite); -void sub_8181794(struct Sprite *sprite); +static void sub_8181708(struct Sprite *sprite); +static void sub_8181770(struct Sprite *sprite); +static void sub_8181794(struct Sprite *sprite); -void pokemonanimfunc_2F(struct Sprite *sprite) +static void pokemonanimfunc_2F(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[6] = -(14 * sprite->centerToCornerVecX / 10); @@ -2696,7 +2714,7 @@ void pokemonanimfunc_2F(struct Sprite *sprite) sprite->callback = sub_8181708; } -void sub_8181708(struct Sprite *sprite) +static void sub_8181708(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[7]--; @@ -2704,7 +2722,7 @@ void sub_8181708(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[7], sprite->data[6] += 0)); // dummy += 0 is needed to match - HandleSetAffineData(sprite, 0x100, 0x100, (sprite->data[7] - 128) << 8); + HandleSetAffineData(sprite, 256, 256, (sprite->data[7] - 128) << 8); if (sprite->data[7] <= 120) { sprite->data[7] = 120; @@ -2715,7 +2733,7 @@ void sub_8181708(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181770(struct Sprite *sprite) +static void sub_8181770(struct Sprite *sprite) { if (sprite->data[3] == 20) { @@ -2726,7 +2744,7 @@ void sub_8181770(struct Sprite *sprite) sprite->data[3]++; } -void sub_8181794(struct Sprite *sprite) +static void sub_8181794(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[7] += 2; @@ -2734,12 +2752,12 @@ void sub_8181794(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[7], sprite->data[6] += 0)); // dummy += 0 is needed to match - HandleSetAffineData(sprite, 0x100, 0x100, (sprite->data[7] - 128) << 8); + HandleSetAffineData(sprite, 256, 256, (sprite->data[7] - 128) << 8); if (sprite->data[7] >= 128) { sprite->pos2.x = 0; sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->data[2] = 0; sub_817F77C(sprite); sprite->callback = pokemonanimfunc_10; @@ -2748,11 +2766,11 @@ void sub_8181794(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181810(struct Sprite *sprite) +static void sub_8181810(struct Sprite *sprite) { - if (gUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sUnknown_03001240[sprite->data[0]].field_0 != 0) { - gUnknown_03001240[sprite->data[0]].field_0--; + sUnknown_03001240[sprite->data[0]].field_0--; } else { @@ -2769,7 +2787,7 @@ void sub_8181810(struct Sprite *sprite) sprite->data[7] = Sin(sprite->data[4], 256); sprite->pos2.y = Sin(sprite->data[4], 16); sprite->data[6] = Sin(sprite->data[4], 32); - HandleSetAffineData(sprite, 0x100 - sprite->data[6], 0x100 + sprite->data[7], 0); + HandleSetAffineData(sprite, 256 - sprite->data[6], 256 + sprite->data[7], 0); if (sprite->data[4] == 128) { sprite->data[4] = 0; @@ -2781,38 +2799,38 @@ void sub_8181810(struct Sprite *sprite) sprite->data[7] = Sin(sprite->data[4], 32); sprite->pos2.y = -(Sin(sprite->data[4], 8)); sprite->data[6] = Sin(sprite->data[4], 128); - HandleSetAffineData(sprite, 0x100 + sprite->data[6], 0x100 - sprite->data[7], 0); + HandleSetAffineData(sprite, 256 + sprite->data[6], 256 - sprite->data[7], 0); if (sprite->data[4] == 128) { - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; - gUnknown_03001240[sprite->data[0]].field_0 = 10; + sUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_0 = 10; sprite->data[4] = 0; sprite->data[5] = 0; } else { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } } } - sprite->data[4] += gUnknown_03001240[sprite->data[0]].field_6; + sprite->data[4] += sUnknown_03001240[sprite->data[0]].field_6; } } -void pokemonanimfunc_30(struct Sprite *sprite) +static void pokemonanimfunc_30(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 4; + sUnknown_03001240[id].field_6 = 4; sub_8181810(sprite); sprite->callback = sub_8181810; } -void pokemonanimfunc_31(struct Sprite *sprite) +static void pokemonanimfunc_31(struct Sprite *sprite) { s32 counter = sprite->data[2]; sub_817F70C(sprite); @@ -2847,25 +2865,25 @@ void pokemonanimfunc_31(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181ABC(struct Sprite *sprite); -void sub_8181B4C(struct Sprite *sprite); -void sub_8181C2C(struct Sprite *sprite); +static void sub_8181ABC(struct Sprite *sprite); +static void sub_8181B4C(struct Sprite *sprite); +static void sub_8181C2C(struct Sprite *sprite); -void pokemonanimfunc_32(struct Sprite *sprite) +static void pokemonanimfunc_32(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = -1; + sUnknown_03001240[id].field_8 = -1; HandleStartAffineAnim(sprite); sprite->data[3] = 0; sub_8181ABC(sprite); sprite->callback = sub_8181ABC; } -void sub_8181ABC(struct Sprite *sprite) +static void sub_8181ABC(struct Sprite *sprite) { - if (gUnknown_03001240[sprite->data[0]].field_0 != 0) + if (sUnknown_03001240[sprite->data[0]].field_0 != 0) { - gUnknown_03001240[sprite->data[0]].field_0--; + sUnknown_03001240[sprite->data[0]].field_0--; } else { @@ -2880,7 +2898,7 @@ void sub_8181ABC(struct Sprite *sprite) } else { - s32 var = 8 * gUnknown_03001240[sprite->data[0]].field_8; + s32 var = 8 * sUnknown_03001240[sprite->data[0]].field_8; sprite->pos2.x = var * (counter % 128) / 128; sprite->pos2.y = -(Sin(counter % 128, 8)); sprite->data[2] += 12; @@ -2890,12 +2908,12 @@ void sub_8181ABC(struct Sprite *sprite) } } -void sub_8181B4C(struct Sprite *sprite) +static void sub_8181B4C(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 48) { - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->pos2.y = 0; sprite->data[2] = 0; sprite->callback = sub_8181C2C; @@ -2907,7 +2925,7 @@ void sub_8181B4C(struct Sprite *sprite) if (sprite->data[2] >= 16 && sprite->data[2] <= 31) { sprite->data[3] += 8; - sprite->pos2.x -= gUnknown_03001240[sprite->data[0]].field_8; + sprite->pos2.x -= sUnknown_03001240[sprite->data[0]].field_8; } yDelta = 0; @@ -2924,7 +2942,7 @@ void sub_8181B4C(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181C2C(struct Sprite *sprite) +static void sub_8181C2C(struct Sprite *sprite) { s32 counter; @@ -2932,10 +2950,10 @@ void sub_8181C2C(struct Sprite *sprite) counter = sprite->data[2]; if (counter > 128) { - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; - gUnknown_03001240[sprite->data[0]].field_0 = 10; + sUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_0 = 10; sprite->data[3] = 0; sprite->data[2] = 0; sprite->data[4] = 0; @@ -2952,9 +2970,9 @@ void sub_8181C2C(struct Sprite *sprite) } else { - register s32 var asm("r4") = gUnknown_03001240[sprite->data[0]].field_8; + register s32 var asm("r4") = sUnknown_03001240[sprite->data[0]].field_8; - sprite->pos2.x = (var << 3) * (counter % 128) / 128 - (gUnknown_03001240[sprite->data[0]].field_8 * 8); + sprite->pos2.x = (var << 3) * (counter % 128) / 128 - (sUnknown_03001240[sprite->data[0]].field_8 * 8); sprite->pos2.y = -(Sin(counter % 128, 8)); } @@ -2962,7 +2980,7 @@ void sub_8181C2C(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181CE8(struct Sprite *sprite) +static void sub_8181CE8(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -2975,10 +2993,10 @@ void sub_8181CE8(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); - if (gUnknown_03001240[sprite->data[0]].field_4 > 1) + HandleSetAffineData(sprite, 256, 256, 0); + if (sUnknown_03001240[sprite->data[0]].field_4 > 1) { - gUnknown_03001240[sprite->data[0]].field_4--; + sUnknown_03001240[sprite->data[0]].field_4--; sprite->data[2] = 0; sprite->data[7] = 0; } @@ -2996,21 +3014,21 @@ void sub_8181CE8(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7], 16)); rotation = Sin(sprite->data[7], 32); - HandleSetAffineData(sprite, 0x100, 0x100, rotation << 8); - sprite->data[7] += gUnknown_03001240[sprite->data[0]].field_6; + HandleSetAffineData(sprite, 256, 256, rotation << 8); + sprite->data[7] += sUnknown_03001240[sprite->data[0]].field_6; sub_817F70C(sprite); } } -void pokemonanimfunc_33(struct Sprite *sprite) +static void pokemonanimfunc_33(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 4; + sUnknown_03001240[id].field_6 = 4; sub_8181CE8(sprite); sprite->callback = sub_8181CE8; } -void pokemonanimfunc_34(struct Sprite *sprite) +static void pokemonanimfunc_34(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3023,7 +3041,7 @@ void pokemonanimfunc_34(struct Sprite *sprite) { sprite->pos2.x = 0; sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; sub_817F70C(sprite); @@ -3035,13 +3053,13 @@ void pokemonanimfunc_34(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7], 16)); sprite->pos2.y = -(Sin(sprite->data[7] % 128, 16)); rotation = Sin(sprite->data[7], 32); - HandleSetAffineData(sprite, 0x100, 0x100, rotation << 8); + HandleSetAffineData(sprite, 256, 256, rotation << 8); sprite->data[7] += 8; sub_817F70C(sprite); } } -void pokemonanimfunc_35(struct Sprite *sprite) +static void pokemonanimfunc_35(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[7] = 0; @@ -3065,18 +3083,18 @@ void pokemonanimfunc_35(struct Sprite *sprite) } } -void sub_8181F14(struct Sprite *sprite); -void sub_8181F50(struct Sprite *sprite); -void sub_8181FC0(struct Sprite *sprite); +static void sub_8181F14(struct Sprite *sprite); +static void sub_8181F50(struct Sprite *sprite); +static void sub_8181FC0(struct Sprite *sprite); -void pokemonanimfunc_36(struct Sprite *sprite) +static void pokemonanimfunc_36(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 0; sprite->callback = sub_8181F14; } -void sub_8181F14(struct Sprite *sprite) +static void sub_8181F14(struct Sprite *sprite) { if (sprite->data[7] > 31) { @@ -3089,10 +3107,10 @@ void sub_8181F14(struct Sprite *sprite) sprite->data[7] += 4; } - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[7] << 8); + HandleSetAffineData(sprite, 256, 256, sprite->data[7] << 8); } -void sub_8181F50(struct Sprite *sprite) +static void sub_8181F50(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 512) @@ -3110,7 +3128,7 @@ void sub_8181F50(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_8181FC0(struct Sprite *sprite) +static void sub_8181FC0(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[7] -= 2; @@ -3126,11 +3144,11 @@ void sub_8181FC0(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7] * 2, 16)); } - HandleSetAffineData(sprite, 0x100, 0x100, sprite->data[7] << 8); + HandleSetAffineData(sprite, 256, 256, sprite->data[7] << 8); sub_817F70C(sprite); } -void pokemonanimfunc_37(struct Sprite *sprite) +static void pokemonanimfunc_37(struct Sprite *sprite) { u16 rotation; @@ -3158,16 +3176,16 @@ void pokemonanimfunc_37(struct Sprite *sprite) } rotation = Sin(sprite->data[7] % 128, 16); - HandleSetAffineData(sprite, 0x100, 0x100, rotation << 8); + HandleSetAffineData(sprite, 256, 256, rotation << 8); sub_817F70C(sprite); } -void sub_81820FC(struct Sprite *sprite); -void sub_818216C(struct Sprite *sprite); -void sub_81821CC(struct Sprite *sprite); -void sub_8182248(struct Sprite *sprite); +static void sub_81820FC(struct Sprite *sprite); +static void sub_818216C(struct Sprite *sprite); +static void sub_81821CC(struct Sprite *sprite); +static void sub_8182248(struct Sprite *sprite); -void pokemonanimfunc_38(struct Sprite *sprite) +static void pokemonanimfunc_38(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->data[7] = 0; @@ -3175,7 +3193,7 @@ void pokemonanimfunc_38(struct Sprite *sprite) sprite->callback = sub_81820FC; } -void sub_81820FC(struct Sprite *sprite) +static void sub_81820FC(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[7] > 24) @@ -3193,11 +3211,11 @@ void sub_81820FC(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[7], 8)); } - HandleSetAffineData(sprite, 0x100, 0x100, -(sprite->data[7]) << 8); + HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); sub_817F70C(sprite); } -void sub_818216C(struct Sprite *sprite) +static void sub_818216C(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[7] > 32) @@ -3212,11 +3230,11 @@ void sub_818216C(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[7], 8)); } - HandleSetAffineData(sprite, 0x100, 0x100, -(sprite->data[7]) << 8); + HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); sub_817F70C(sprite); } -void sub_81821CC(struct Sprite *sprite) +static void sub_81821CC(struct Sprite *sprite) { sub_817F70C(sprite); sprite->data[7] += (sprite->data[6] * 4); @@ -3234,11 +3252,11 @@ void sub_81821CC(struct Sprite *sprite) sprite->data[5]++; } - HandleSetAffineData(sprite, 0x100, 0x100, -(sprite->data[7]) << 8); + HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); sub_817F70C(sprite); } -void sub_8182248(struct Sprite *sprite) +static void sub_8182248(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[7] <= 0) @@ -3254,11 +3272,11 @@ void sub_8182248(struct Sprite *sprite) sprite->pos2.y = -(Sin(sprite->data[7], 8)); } - HandleSetAffineData(sprite, 0x100, 0x100, -(sprite->data[7]) << 8); + HandleSetAffineData(sprite, 256, 256, -(sprite->data[7]) << 8); sub_817F70C(sprite); } -void pokemonanimfunc_39(struct Sprite *sprite) +static void pokemonanimfunc_39(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 40) @@ -3290,7 +3308,7 @@ void pokemonanimfunc_39(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_3A(struct Sprite *sprite) +static void pokemonanimfunc_3A(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -3309,7 +3327,7 @@ void pokemonanimfunc_3A(struct Sprite *sprite) { s16 scale = (8 * sprite->data[6]) / 20; scale = Sin(sprite->data[7] - scale, 64); - HandleSetAffineData(sprite, 0x100 - scale, 0x100 - scale, 0); + HandleSetAffineData(sprite, 256 - scale, 256 - scale, 0); } } else @@ -3321,7 +3339,7 @@ void pokemonanimfunc_3A(struct Sprite *sprite) if (sprite->data[7] > 63) { sprite->data[7] = 64; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -3352,13 +3370,13 @@ void pokemonanimfunc_3A(struct Sprite *sprite) } sprite->data[7] += 2; - HandleSetAffineData(sprite, 0x100 - var, 0x100 - var, 0); + HandleSetAffineData(sprite, 256 - var, 256 - var, 0); } sub_817F70C(sprite); } -void pokemonanimfunc_3B(struct Sprite *sprite) +static void pokemonanimfunc_3B(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3370,7 +3388,7 @@ void pokemonanimfunc_3B(struct Sprite *sprite) if (sprite->data[7] > 512) { sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -3381,11 +3399,11 @@ void pokemonanimfunc_3B(struct Sprite *sprite) sprite->pos2.y = Sin(sprite->data[7] % 256, 8); sprite->data[7] += 8; yScale = Sin(sprite->data[7] % 128, 96); - HandleSetAffineData(sprite, 0x100, yScale + 0x100, 0); + HandleSetAffineData(sprite, 256, yScale + 256, 0); } } -void pokemonanimfunc_3C(struct Sprite *sprite) +static void pokemonanimfunc_3C(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3397,7 +3415,7 @@ void pokemonanimfunc_3C(struct Sprite *sprite) if (sprite->data[7] > 256) { sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } @@ -3408,22 +3426,22 @@ void pokemonanimfunc_3C(struct Sprite *sprite) sprite->pos2.y = Sin(sprite->data[7], 16); sprite->data[7] += 4; yScale = Sin((sprite->data[7] % 64) * 2, 128); - HandleSetAffineData(sprite, 0x100, yScale + 0x100, 0); + HandleSetAffineData(sprite, 256, yScale + 256, 0); } } -void sub_81825F8(struct Sprite *sprite); -void sub_8182648(struct Sprite *sprite); -void sub_81826F8(struct Sprite *sprite); +static void sub_81825F8(struct Sprite *sprite); +static void sub_8182648(struct Sprite *sprite); +static void sub_81826F8(struct Sprite *sprite); -void pokemonanimfunc_3D(struct Sprite *sprite) +static void pokemonanimfunc_3D(struct Sprite *sprite) { HandleStartAffineAnim(sprite); sprite->callback = sub_81825F8; sprite->data[7] = 0; } -void sub_81825F8(struct Sprite *sprite) +static void sub_81825F8(struct Sprite *sprite) { s16 yScale; @@ -3440,10 +3458,10 @@ void sub_81825F8(struct Sprite *sprite) yScale = Sin(sprite->data[7], 128); } - HandleSetAffineData(sprite, 0x100, 0x100 + yScale, 0); + HandleSetAffineData(sprite, 256, 256 + yScale, 0); } -void sub_8182648(struct Sprite *sprite) +static void sub_8182648(struct Sprite *sprite) { s16 yScale; @@ -3473,7 +3491,7 @@ void sub_8182648(struct Sprite *sprite) yScale = Cos((index * 2) + sprite->data[7], 128) * sign; } - HandleSetAffineData(sprite, 0x100, 0x100 + yScale, 0); + HandleSetAffineData(sprite, 256, 256 + yScale, 0); if (sprite->data[6] == 3) { sprite->data[7] = 0; @@ -3481,7 +3499,7 @@ void sub_8182648(struct Sprite *sprite) } } -void sub_81826F8(struct Sprite *sprite) +static void sub_81826F8(struct Sprite *sprite) { s16 yScale; @@ -3493,20 +3511,20 @@ void sub_81826F8(struct Sprite *sprite) sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; sprite->pos2.y = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); } - HandleSetAffineData(sprite, 0x100, 0x100 + yScale, 0); + HandleSetAffineData(sprite, 256, 256 + yScale, 0); } -void sub_8182764(struct Sprite *sprite) +static void sub_8182764(struct Sprite *sprite) { if (sprite->data[7] > sprite->data[5]) { sprite->pos2.x = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); } else { @@ -3515,11 +3533,11 @@ void sub_8182764(struct Sprite *sprite) sprite->pos2.x = Sin(sprite->data[7] % 256, sprite->data[4]); sprite->data[7] += sprite->data[6]; xScale = Sin(sprite->data[7] % 128, 96); - HandleSetAffineData(sprite, 0x100 + xScale, 0x100, 0); + HandleSetAffineData(sprite, 256 + xScale, 256, 0); } } -void pokemonanimfunc_3E(struct Sprite *sprite) +static void pokemonanimfunc_3E(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3534,14 +3552,14 @@ void pokemonanimfunc_3E(struct Sprite *sprite) sub_8182764(sprite); } -void sub_8182830(struct Sprite *sprite) +static void sub_8182830(struct Sprite *sprite) { if (sprite->data[7] > sprite->data[5]) { sprite->pos2.x = 0; sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); } else { @@ -3550,11 +3568,11 @@ void sub_8182830(struct Sprite *sprite) sprite->pos2.x = Sin(sprite->data[7] % 256, sprite->data[4]); sprite->data[7] += sprite->data[6]; xScale = Sin((sprite->data[7] % 64) * 2, 128); - HandleSetAffineData(sprite, 0x100 + xScale, 0x100, 0); + HandleSetAffineData(sprite, 256 + xScale, 256, 0); } } -void pokemonanimfunc_3F(struct Sprite *sprite) +static void pokemonanimfunc_3F(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -3569,7 +3587,7 @@ void pokemonanimfunc_3F(struct Sprite *sprite) sub_8182830(sprite); } -void pokemonanimfunc_40(struct Sprite *sprite) +static void pokemonanimfunc_40(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -3583,7 +3601,7 @@ void pokemonanimfunc_40(struct Sprite *sprite) { sprite->pos2.x = 0; sub_817F77C(sprite); - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } else @@ -3593,13 +3611,13 @@ void pokemonanimfunc_40(struct Sprite *sprite) sprite->pos2.x = Sin(sprite->data[7] % 256, 8); sprite->data[7] += 8; scale = Sin(sprite->data[7] % 128, 96); - HandleSetAffineData(sprite, 0x100 + scale, 0x100 + scale, 0); + HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } sub_817F70C(sprite); } -void pokemonanimfunc_41(struct Sprite *sprite) +static void pokemonanimfunc_41(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -3613,7 +3631,7 @@ void pokemonanimfunc_41(struct Sprite *sprite) { sprite->pos2.x = 0; sub_817F77C(sprite); - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } else @@ -3623,13 +3641,13 @@ void pokemonanimfunc_41(struct Sprite *sprite) sprite->pos2.x = -(Sin((sprite->data[7] % 256) / 2, 16)); sprite->data[7] += 8; scale = -(Sin((sprite->data[7] % 256) / 2, 64)); - HandleSetAffineData(sprite, 0x100 + scale, 0x100 + scale, 0); + HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } sub_817F70C(sprite); } -void pokemonanimfunc_42(struct Sprite *sprite) +static void pokemonanimfunc_42(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -3643,7 +3661,7 @@ void pokemonanimfunc_42(struct Sprite *sprite) { sprite->pos2.x = 0; sub_817F77C(sprite); - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); sprite->callback = SpriteCB_SetDummyOnAnimEnd; } else @@ -3653,13 +3671,13 @@ void pokemonanimfunc_42(struct Sprite *sprite) sprite->pos2.x = -(Sin(sprite->data[7] % 256 , 8)); sprite->data[7] += 8; scale = Sin((sprite->data[7] % 256) / 2, 96); - HandleSetAffineData(sprite, 0x100 + scale, 0x100 + scale, 0); + HandleSetAffineData(sprite, 256 + scale, 256 + scale, 0); } sub_817F70C(sprite); } -void pokemonanimfunc_43(struct Sprite *sprite) +static void pokemonanimfunc_43(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 2048) @@ -3693,7 +3711,7 @@ void pokemonanimfunc_43(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_44(struct Sprite *sprite) +static void pokemonanimfunc_44(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -3750,50 +3768,50 @@ void pokemonanimfunc_44(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_45(struct Sprite *sprite) +static void pokemonanimfunc_45(struct Sprite *sprite) { sprite->data[0] = 32; sub_8180714(sprite); sprite->callback = sub_8180714; } -void pokemonanimfunc_46(struct Sprite *sprite) +static void pokemonanimfunc_46(struct Sprite *sprite) { sprite->data[0] = 80; sub_817F8FC(sprite); sprite->callback = sub_817F8FC; } -void pokemonanimfunc_47(struct Sprite *sprite) +static void pokemonanimfunc_47(struct Sprite *sprite) { sprite->data[0] = 80; sub_817F978(sprite); sprite->callback = sub_817F978; } -void pokemonanimfunc_48(struct Sprite *sprite) +static void pokemonanimfunc_48(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 2048; - gUnknown_03001240[id].field_8 = sprite->data[6]; + sUnknown_03001240[id].field_6 = 2048; + sUnknown_03001240[id].field_8 = sprite->data[6]; sub_8180900(sprite); sprite->callback = sub_8180900; } -void pokemonanimfunc_49(struct Sprite *sprite) +static void pokemonanimfunc_49(struct Sprite *sprite) { sprite->data[6] = 1; pokemonanimfunc_05(sprite); } -void pokemonanimfunc_4A(struct Sprite *sprite) +static void pokemonanimfunc_4A(struct Sprite *sprite) { sprite->data[6] = 1; pokemonanimfunc_48(sprite); } -void pokemonanimfunc_4B(struct Sprite *sprite) +static void pokemonanimfunc_4B(struct Sprite *sprite) { if (sprite->data[2] == 0) sprite->data[0] = 0; @@ -3809,7 +3827,7 @@ void pokemonanimfunc_4B(struct Sprite *sprite) } } -void pokemonanimfunc_4C(struct Sprite *sprite) +static void pokemonanimfunc_4C(struct Sprite *sprite) { sprite->data[0] = 30; sprite->data[7] = 3; @@ -3817,156 +3835,156 @@ void pokemonanimfunc_4C(struct Sprite *sprite) sprite->callback = sub_817FCDC; } -void pokemonanimfunc_4D(struct Sprite *sprite) +static void pokemonanimfunc_4D(struct Sprite *sprite) { sprite->data[0] = 30; sub_817FD44(sprite); sprite->callback = sub_817FD44; } -void pokemonanimfunc_4E(struct Sprite *sprite) +static void pokemonanimfunc_4E(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 1024; - gUnknown_03001240[id].field_0 = 0; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_6 = 1024; + sUnknown_03001240[id].field_0 = 0; + sUnknown_03001240[id].field_4 = 2; sub_817FE30(sprite); sprite->callback = sub_817FE30; } -void pokemonanimfunc_4F(struct Sprite *sprite) +static void pokemonanimfunc_4F(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 512; - gUnknown_03001240[id].field_8 = 3; - gUnknown_03001240[id].field_2 = 12; + sUnknown_03001240[id].field_6 = 512; + sUnknown_03001240[id].field_8 = 3; + sUnknown_03001240[id].field_2 = 12; sub_817FFF0(sprite); sprite->callback = sub_817FFF0; } -void pokemonanimfunc_50(struct Sprite *sprite) +static void pokemonanimfunc_50(struct Sprite *sprite) { sprite->data[0] = 24; sub_818031C(sprite); sprite->callback = sub_818031C; } -void pokemonanimfunc_51(struct Sprite *sprite) +static void pokemonanimfunc_51(struct Sprite *sprite) { sprite->data[0] = 5; sub_81804F8(sprite); sprite->callback = sub_81804F8; } -void pokemonanimfunc_52(struct Sprite *sprite) +static void pokemonanimfunc_52(struct Sprite *sprite) { sprite->data[0] = 3; sub_817F9F4(sprite); sprite->callback = sub_817F9F4; } -void pokemonanimfunc_53(struct Sprite *sprite) +static void pokemonanimfunc_53(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_0 = 60; - gUnknown_03001240[id].field_8 = 30; + sUnknown_03001240[id].field_0 = 60; + sUnknown_03001240[id].field_8 = 30; sub_817FF3C(sprite); sprite->callback = sub_817FF3C; } -void pokemonanimfunc_54(struct Sprite *sprite) +static void pokemonanimfunc_54(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_2 = 1; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_2 = 1; + sUnknown_03001240[id].field_4 = 2; sub_8181214(sprite); sprite->callback = sub_8181214; } -void pokemonanimfunc_55(struct Sprite *sprite) +static void pokemonanimfunc_55(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 4; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_6 = 4; + sUnknown_03001240[id].field_4 = 2; sub_8181810(sprite); sprite->callback = sub_8181810; } -void pokemonanimfunc_56(struct Sprite *sprite) +static void pokemonanimfunc_56(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 1; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_8 = 1; + sUnknown_03001240[id].field_4 = 2; HandleStartAffineAnim(sprite); sprite->data[3] = 0; sub_8181ABC(sprite); sprite->callback = sub_8181ABC; } -void pokemonanimfunc_07(struct Sprite *sprite) +static void pokemonanimfunc_07(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 2; + sUnknown_03001240[id].field_6 = 2; sub_8181CE8(sprite); sprite->callback = sub_8181CE8; } -void pokemonanimfunc_08(struct Sprite *sprite) +static void pokemonanimfunc_08(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_6 = 4; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_6 = 4; + sUnknown_03001240[id].field_4 = 2; sub_8181CE8(sprite); sprite->callback = sub_8181CE8; } -void pokemonanimfunc_0B(struct Sprite *sprite) +static void pokemonanimfunc_0B(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 100; + sUnknown_03001240[id].field_8 = 100; sub_81814D4(sprite); sprite->callback = sub_81814D4; } -void pokemonanimfunc_0C(struct Sprite *sprite) +static void pokemonanimfunc_0C(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 50; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_8 = 50; + sUnknown_03001240[id].field_4 = 2; sub_81814D4(sprite); sprite->callback = sub_81814D4; } -void pokemonanimfunc_0D(struct Sprite *sprite) +static void pokemonanimfunc_0D(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 100; + sUnknown_03001240[id].field_8 = 100; sub_81815D4(sprite); sprite->callback = sub_81815D4; } -void pokemonanimfunc_0E(struct Sprite *sprite) +static void pokemonanimfunc_0E(struct Sprite *sprite) { u8 id = sprite->data[0] = sub_817F758(); - gUnknown_03001240[id].field_8 = 50; - gUnknown_03001240[id].field_4 = 2; + sUnknown_03001240[id].field_8 = 50; + sUnknown_03001240[id].field_4 = 2; sub_81815D4(sprite); sprite->callback = sub_81815D4; } -void sub_8183140(struct Sprite *sprite) +static void sub_8183140(struct Sprite *sprite) { s32 counter = sprite->data[2]; if (counter > 2304) @@ -3982,7 +4000,7 @@ void sub_8183140(struct Sprite *sprite) sprite->data[2] += sprite->data[0]; } -void pokemonanimfunc_57(struct Sprite *sprite) +static void pokemonanimfunc_57(struct Sprite *sprite) { sprite->data[0] = 60; sprite->data[7] = 3; @@ -3990,7 +4008,7 @@ void pokemonanimfunc_57(struct Sprite *sprite) sprite->callback = sub_8183140; } -void pokemonanimfunc_58(struct Sprite *sprite) +static void pokemonanimfunc_58(struct Sprite *sprite) { sprite->data[0] = 30; sprite->data[7] = 3; @@ -3998,7 +4016,7 @@ void pokemonanimfunc_58(struct Sprite *sprite) sprite->callback = sub_8183140; } -void pokemonanimfunc_59(struct Sprite *sprite) +static void pokemonanimfunc_59(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 2048) @@ -4032,7 +4050,7 @@ void pokemonanimfunc_59(struct Sprite *sprite) sub_817F70C(sprite); } -void sub_81832C8(struct Sprite *sprite) +static void sub_81832C8(struct Sprite *sprite) { s16 index1 = 0, index2 = 0; @@ -4040,7 +4058,7 @@ void sub_81832C8(struct Sprite *sprite) { sprite->pos2.y = 0; sprite->data[5] = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { sub_817F77C(sprite); @@ -4067,18 +4085,18 @@ void sub_81832C8(struct Sprite *sprite) } if (sprite->data[1] == 0) - xScale = -0x100 - Sin(index2, 16); + xScale = -256 - Sin(index2, 16); else - xScale = 0x100 + Sin(index2, 16); + xScale = 256 + Sin(index2, 16); amplitude = sprite->data[3]; - yScale = 0x100 - Sin(index2, amplitude) - Sin(index1, amplitude / 5); + yScale = 256 - Sin(index2, amplitude) - Sin(index1, amplitude / 5); SetAffineData(sprite, xScale, yScale, 0); sprite->data[5]++; } } -void pokemonanimfunc_5A(struct Sprite *sprite) +static void pokemonanimfunc_5A(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4094,14 +4112,14 @@ void pokemonanimfunc_5A(struct Sprite *sprite) sub_81832C8(sprite); } -void sub_8183418(struct Sprite *sprite) +static void sub_8183418(struct Sprite *sprite) { s16 index1 = 0, index2; if (sprite->data[5] > sprite->data[6]) { sprite->data[5] = 0; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { sub_817F77C(sprite); @@ -4130,16 +4148,16 @@ void sub_8183418(struct Sprite *sprite) amplitude = sprite->data[3]; if (sprite->data[1] == 0) - xScale = -0x100 + Sin(index2, amplitude) + Sin(index1, amplitude / 5 * 2); + xScale = -256 + Sin(index2, amplitude) + Sin(index1, amplitude / 5 * 2); else - xScale = 0x100 - Sin(index2, amplitude) - Sin(index1, amplitude / 5 * 2); + xScale = 256 - Sin(index2, amplitude) - Sin(index1, amplitude / 5 * 2); - SetAffineData(sprite, xScale, 0x100, 0); + SetAffineData(sprite, xScale, 256, 0); sprite->data[5]++; } } -void pokemonanimfunc_5B(struct Sprite *sprite) +static void pokemonanimfunc_5B(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4155,19 +4173,19 @@ void pokemonanimfunc_5B(struct Sprite *sprite) sub_8183418(sprite); } -void sub_8183574(struct Sprite *sprite) +static void sub_8183574(struct Sprite *sprite) { u8 var6, var7; u8 var8 = sprite->data[2]; u8 var9 = sprite->data[6]; - u8 var5 = gUnknown_0860AA80[sprite->data[5]][0]; + u8 var5 = sUnknown_0860AA80[sprite->data[5]][0]; u8 var2 = var5; if (var5 != 0xFF) var5 = sprite->data[7]; else var5 = 0xFF; // needed to match - var6 = gUnknown_0860AA80[sprite->data[5]][1]; + var6 = sUnknown_0860AA80[sprite->data[5]][1]; var7 = 0; if (var2 != 0xFE) var7 = (var6 - var9) * var5 / var6; @@ -4193,7 +4211,7 @@ void sub_8183574(struct Sprite *sprite) } } -void pokemonanimfunc_5C(struct Sprite *sprite) +static void pokemonanimfunc_5C(struct Sprite *sprite) { sprite->data[0] = 40; sprite->data[7] = 6; @@ -4201,7 +4219,7 @@ void pokemonanimfunc_5C(struct Sprite *sprite) sprite->callback = sub_8183574; } -void pokemonanimfunc_5D(struct Sprite *sprite) +static void pokemonanimfunc_5D(struct Sprite *sprite) { sprite->data[0] = 70; sprite->data[7] = 6; @@ -4209,14 +4227,14 @@ void pokemonanimfunc_5D(struct Sprite *sprite) sprite->callback = sub_817FCDC; } -void pokemonanimfunc_5E(struct Sprite *sprite) +static void pokemonanimfunc_5E(struct Sprite *sprite) { sprite->data[0] = 20; sub_817F8FC(sprite); sprite->callback = sub_817F8FC; } -void pokemonanimfunc_5F(struct Sprite *sprite) +static void pokemonanimfunc_5F(struct Sprite *sprite) { if (sprite->data[2] > 40) { @@ -4237,7 +4255,7 @@ void pokemonanimfunc_5F(struct Sprite *sprite) sprite->data[2]++; } -void pokemonanimfunc_60(struct Sprite *sprite) +static void pokemonanimfunc_60(struct Sprite *sprite) { if (sprite->data[2] > 40) { @@ -4258,7 +4276,7 @@ void pokemonanimfunc_60(struct Sprite *sprite) sprite->data[2]++; } -void pokemonanimfunc_61(struct Sprite *sprite) +static void pokemonanimfunc_61(struct Sprite *sprite) { sprite->data[0] = 70; sprite->data[7] = 6; @@ -4266,7 +4284,7 @@ void pokemonanimfunc_61(struct Sprite *sprite) sprite->callback = sub_8183140; } -void pokemonanimfunc_62(struct Sprite *sprite) +static void pokemonanimfunc_62(struct Sprite *sprite) { sprite->data[0] = 24; sprite->data[7] = 6; @@ -4274,7 +4292,7 @@ void pokemonanimfunc_62(struct Sprite *sprite) sprite->callback = sub_8183574; } -void pokemonanimfunc_63(struct Sprite *sprite) +static void pokemonanimfunc_63(struct Sprite *sprite) { sprite->data[0] = 56; sprite->data[7] = 9; @@ -4282,25 +4300,25 @@ void pokemonanimfunc_63(struct Sprite *sprite) sprite->callback = sub_8183574; } -void pokemonanimfunc_64(struct Sprite *sprite) +static 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; + sUnknown_03001240[id].field_6 = 1024; + sUnknown_03001240[id].field_8 = 6; + sUnknown_03001240[id].field_2 = 24; sub_817FFF0(sprite); sprite->callback = sub_817FFF0; } -void sub_81837DC(struct Sprite *sprite) +static 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); + HandleSetAffineData(sprite, 256, 256, 0); if (sprite->data[4] <= 1) { sub_817F77C(sprite); @@ -4329,17 +4347,17 @@ void sub_81837DC(struct Sprite *sprite) amplitude = sprite->data[3]; if (sprite->data[1] == 0) - xScale = Sin(index2, amplitude) + (Sin(index1, amplitude / 5 * 2) - 0x100); + xScale = Sin(index2, amplitude) + (Sin(index1, amplitude / 5 * 2) - 256); else - xScale = 0x100 - Sin(index1, amplitude / 5 * 2) - Sin(index2, amplitude); + xScale = 256 - Sin(index1, amplitude / 5 * 2) - Sin(index2, amplitude); - yScale = 0x100 - Sin(index1, amplitude / 5) - Sin(index2, amplitude); + yScale = 256 - Sin(index1, amplitude / 5) - Sin(index2, amplitude); SetAffineData(sprite, xScale, yScale, 0); sprite->data[5]++; } } -void pokemonanimfunc_65(struct Sprite *sprite) +static void pokemonanimfunc_65(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4355,7 +4373,7 @@ void pokemonanimfunc_65(struct Sprite *sprite) sub_81837DC(sprite); } -void pokemonanimfunc_66(struct Sprite *sprite) +static void pokemonanimfunc_66(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 2048) @@ -4389,7 +4407,7 @@ void pokemonanimfunc_66(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_67(struct Sprite *sprite) +static void pokemonanimfunc_67(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] > 2048) @@ -4423,7 +4441,7 @@ void pokemonanimfunc_67(struct Sprite *sprite) sub_817F70C(sprite); } -static const s8 gUnknown_0860ADBE[][3] = +static const s8 sUnknown_0860ADBE[][3] = { // x y timer {1, 1, 12}, @@ -4432,19 +4450,19 @@ static const s8 gUnknown_0860ADBE[][3] = {0, 0, 0} }; -void sub_8183B4C(struct Sprite *sprite) +static 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]) + if (sUnknown_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 (sUnknown_0860ADBE[sprite->data[3]][2] / sprite->data[5] == 0) { if (--sprite->data[6] == 0) sprite->callback = SpriteCB_SetDummyOnAnimEnd; @@ -4454,14 +4472,14 @@ void sub_8183B4C(struct Sprite *sprite) 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->pos2.x += (sUnknown_0860ADBE[sprite->data[3]][0] * amplitude); + sprite->pos2.y += (sUnknown_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) +static void pokemonanimfunc_68(struct Sprite *sprite) { sprite->data[5] = 1; sprite->data[6] = 1; @@ -4469,7 +4487,7 @@ void pokemonanimfunc_68(struct Sprite *sprite) sprite->callback = sub_8183B4C; } -void pokemonanimfunc_69(struct Sprite *sprite) +static void pokemonanimfunc_69(struct Sprite *sprite) { sprite->data[5] = 2; sprite->data[6] = 1; @@ -4477,7 +4495,7 @@ void pokemonanimfunc_69(struct Sprite *sprite) sprite->callback = sub_8183B4C; } -void pokemonanimfunc_6A(struct Sprite *sprite) +static void pokemonanimfunc_6A(struct Sprite *sprite) { sprite->data[5] = 2; sprite->data[6] = 2; @@ -4485,7 +4503,7 @@ void pokemonanimfunc_6A(struct Sprite *sprite) sprite->callback = sub_8183B4C; } -void sub_8183C6C(struct Sprite *sprite) +static void sub_8183C6C(struct Sprite *sprite) { if (sprite->data[7] > 255) { @@ -4493,7 +4511,7 @@ void sub_8183C6C(struct Sprite *sprite) { sub_817F77C(sprite); sprite->callback = SpriteCB_SetDummyOnAnimEnd; - HandleSetAffineData(sprite, 0x100, 0x100, 0); + HandleSetAffineData(sprite, 256, 256, 0); } else { @@ -4510,11 +4528,11 @@ void sub_8183C6C(struct Sprite *sprite) sprite->data[7] = 256; scale = Sin(sprite->data[7] / 2, 64); - HandleSetAffineData(sprite, 0x100 - scale, 0x100 - scale, 0); + HandleSetAffineData(sprite, 256 - scale, 256 - scale, 0); } } -void pokemonanimfunc_6B(struct Sprite *sprite) +static void pokemonanimfunc_6B(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -4530,7 +4548,7 @@ void pokemonanimfunc_6B(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_6C(struct Sprite *sprite) +static void pokemonanimfunc_6C(struct Sprite *sprite) { sub_817F70C(sprite); if (sprite->data[2] == 0) @@ -4546,7 +4564,7 @@ void pokemonanimfunc_6C(struct Sprite *sprite) sub_817F70C(sprite); } -void pokemonanimfunc_6D(struct Sprite *sprite) +static void pokemonanimfunc_6D(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4561,7 +4579,7 @@ void pokemonanimfunc_6D(struct Sprite *sprite) sub_8182764(sprite); } -void pokemonanimfunc_6E(struct Sprite *sprite) +static void pokemonanimfunc_6E(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4576,7 +4594,7 @@ void pokemonanimfunc_6E(struct Sprite *sprite) sub_8182764(sprite); } -void pokemonanimfunc_6F(struct Sprite *sprite) +static void pokemonanimfunc_6F(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4591,7 +4609,7 @@ void pokemonanimfunc_6F(struct Sprite *sprite) sub_8182830(sprite); } -void pokemonanimfunc_70(struct Sprite *sprite) +static void pokemonanimfunc_70(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4606,7 +4624,7 @@ void pokemonanimfunc_70(struct Sprite *sprite) sub_8182830(sprite); } -void pokemonanimfunc_71(struct Sprite *sprite) +static void pokemonanimfunc_71(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4618,7 +4636,7 @@ void pokemonanimfunc_71(struct Sprite *sprite) sub_8180828(sprite); } -void pokemonanimfunc_72(struct Sprite *sprite) +static void pokemonanimfunc_72(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4630,7 +4648,7 @@ void pokemonanimfunc_72(struct Sprite *sprite) sub_8180828(sprite); } -void pokemonanimfunc_73(struct Sprite *sprite) +static void pokemonanimfunc_73(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4645,7 +4663,7 @@ void pokemonanimfunc_73(struct Sprite *sprite) sub_81832C8(sprite); } -void pokemonanimfunc_74(struct Sprite *sprite) +static void pokemonanimfunc_74(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4660,7 +4678,7 @@ void pokemonanimfunc_74(struct Sprite *sprite) sub_81832C8(sprite); } -void pokemonanimfunc_75(struct Sprite *sprite) +static void pokemonanimfunc_75(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4676,7 +4694,7 @@ void pokemonanimfunc_75(struct Sprite *sprite) sub_8183418(sprite); } -void pokemonanimfunc_76(struct Sprite *sprite) +static void pokemonanimfunc_76(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4692,7 +4710,7 @@ void pokemonanimfunc_76(struct Sprite *sprite) sub_8183418(sprite); } -void pokemonanimfunc_77(struct Sprite *sprite) +static void pokemonanimfunc_77(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4708,7 +4726,7 @@ void pokemonanimfunc_77(struct Sprite *sprite) sub_81837DC(sprite); } -void pokemonanimfunc_78(struct Sprite *sprite) +static void pokemonanimfunc_78(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4724,7 +4742,7 @@ void pokemonanimfunc_78(struct Sprite *sprite) sub_81837DC(sprite); } -void sub_8183FA8(struct Sprite *sprite) +static void sub_8183FA8(struct Sprite *sprite) { if (sprite->data[7] > 255) { @@ -4752,7 +4770,7 @@ void sub_8183FA8(struct Sprite *sprite) } } -void pokemonanimfunc_79(struct Sprite *sprite) +static void pokemonanimfunc_79(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4767,7 +4785,7 @@ void pokemonanimfunc_79(struct Sprite *sprite) sub_8183FA8(sprite); } -void pokemonanimfunc_7A(struct Sprite *sprite) +static void pokemonanimfunc_7A(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4782,7 +4800,7 @@ void pokemonanimfunc_7A(struct Sprite *sprite) sub_8183FA8(sprite); } -void pokemonanimfunc_7B(struct Sprite *sprite) +static void pokemonanimfunc_7B(struct Sprite *sprite) { if (sprite->data[2] == 0) { @@ -4796,3 +4814,844 @@ void pokemonanimfunc_7B(struct Sprite *sprite) sub_8183FA8(sprite); } + +static void sub_81840C4(struct Sprite *sprite) +{ + if (sprite->data[7] > 256) + { + if (sprite->data[6] <= sprite->data[4]) + { + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + else + { + sprite->data[4]++; + sprite->data[7] = 0; + } + + sprite->pos2.x = 0; + sprite->pos2.y = 0; + } + else + { + s16 posX; + + if (sprite->data[7] > 159) + { + if (sprite->data[7] > 256) + sprite->data[7] = 256; + + sprite->pos2.y = -(Sin(sprite->data[7] % 256, 8)); + } + else if (sprite->data[7] > 95) + { + sprite->pos2.y = Sin(96, 6) - Sin((sprite->data[7] - 96) * 2, 4); + } + else + { + sprite->pos2.y = Sin(sprite->data[7], 6); + } + + posX = -(Sin(sprite->data[7] / 2, sprite->data[5])); + if (sprite->data[4] % 2 == 0) + posX *= -1; + + sprite->pos2.x = posX; + sprite->data[7] += sprite->data[3]; + } +} + +static void pokemonanimfunc_7C(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 2; + sprite->data[7] = 0; + sprite->data[5] = 16; + sprite->data[4] = 1; + sprite->data[3] = 4; + } + + sub_81840C4(sprite); +} + +static void pokemonanimfunc_7D(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 2; + sprite->data[7] = 0; + sprite->data[5] = 16; + sprite->data[4] = 1; + sprite->data[3] = 6; + } + + sub_81840C4(sprite); +} + +static void pokemonanimfunc_7E(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 3; + sprite->data[7] = 0; + sprite->data[5] = 16; + sprite->data[4] = 1; + sprite->data[3] = 8; + } + + sub_81840C4(sprite); +} + +static void pokemonanimfunc_7F(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 1; + sprite->data[7] = 0; + sprite->data[5] = 4; + sprite->data[4] = 6; + sprite->data[3] = 4; + } + + sub_8183FA8(sprite); +} + +static void pokemonanimfunc_80(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 1; + sprite->data[7] = 0; + sprite->data[5] = 4; + sprite->data[4] = 6; + sprite->data[3] = 6; + } + + sub_8183FA8(sprite); +} + +static void pokemonanimfunc_81(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[2] = 1; + sprite->data[6] = 2; + sprite->data[7] = 0; + sprite->data[5] = 4; + sprite->data[4] = 6; + sprite->data[3] = 8; + } + + sub_8183FA8(sprite); +} + +static void sub_8184290(struct Sprite *sprite) +{ + u16 index = Sin((sprite->data[2] * 128) / sprite->data[7], sprite->data[5]); + sprite->data[6] = -(index << 8); + sub_817F3F0(sprite, index, sprite->data[4], 0); + HandleSetAffineData(sprite, 256, 256, sprite->data[6]); +} + +static void pokemonanimfunc_82(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[7] = 60; + sprite->data[5] = 8; + sprite->data[4] = -32; + sprite->data[3] = 1; + sprite->data[0] = 0; + } + + if (sprite->data[2] > sprite->data[7]) + { + HandleSetAffineData(sprite, 256, 256, 0); + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + if (sprite->data[3] <= sprite->data[0]) + { + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + return; + } + else + { + sprite->data[2] = 0; + } + } + else + { + sub_8184290(sprite); + } + + sprite->data[2]++; +} + +static void pokemonanimfunc_83(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[7] = 90; + sprite->data[5] = 8; + sprite->data[4] = -32; + sprite->data[3] = 1; + sprite->data[0] = 0; + } + + if (sprite->data[2] > sprite->data[7]) + { + HandleSetAffineData(sprite, 256, 256, 0); + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + if (sprite->data[3] <= sprite->data[0]) + { + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + return; + } + else + { + sprite->data[2] = 0; + } + } + else + { + sub_8184290(sprite); + } + + sprite->data[2]++; +} + +static void pokemonanimfunc_84(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->data[7] = 30; + sprite->data[5] = 8; + sprite->data[4] = -32; + sprite->data[3] = 2; + sprite->data[0] = 0; + } + + if (sprite->data[2] > sprite->data[7]) + { + HandleSetAffineData(sprite, 256, 256, 0); + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->data[0]++; + if (sprite->data[3] <= sprite->data[0]) + { + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + return; + } + else + { + sprite->data[2] = 0; + } + } + else + { + sub_8184290(sprite); + } + + sprite->data[2]++; +} + +static void sub_8184468(struct Sprite *sprite) +{ + if (sprite->data[2] > sprite->data[7]) + { + sprite->pos2.y = 0; + HandleSetAffineData(sprite, 256, 256, 0); + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + else + { + u8 posY_unsigned; + s8 posY_signed; + s32 posY; + s16 index = (u16)(sprite->data[2] % sprite->data[6] * 256) / sprite->data[6] % 256; + if (sprite->data[2] % 2 == 0) + { + sprite->data[4] = Sin(index, 32) + 256; + sprite->data[5] = Sin(index, 32) + 256; + posY_unsigned = Sin(index, 32); + posY_signed = posY_unsigned; + } + else + { + sprite->data[4] = Sin(index, 8) + 256; + sprite->data[5] = Sin(index, 8) + 256; + posY_unsigned = Sin(index, 8); + posY_signed = posY_unsigned; + } + + posY = posY_signed; + if (posY < 0) + posY += 7; + sprite->pos2.y = (u32)(posY) >> 3; + HandleSetAffineData(sprite, sprite->data[4], sprite->data[5], 0); + } + + sprite->data[2]++; +} + +static void pokemonanimfunc_85(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->pos2.y += 2; + sprite->data[6] = 40; + sprite->data[7] = 80; + } + + sub_8184468(sprite); +} + +static void pokemonanimfunc_86(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->pos2.y += 2; + sprite->data[6] = 40; + sprite->data[7] = 40; + } + + sub_8184468(sprite); +} + +static void pokemonanimfunc_87(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + HandleStartAffineAnim(sprite); + sprite->pos2.y += 2; + sprite->data[6] = 80; + sprite->data[7] = 80; + } + + sub_8184468(sprite); +} + +static void sub_8184610(struct Sprite *sprite); +static void sub_8184640(struct Sprite *sprite); +static void sub_8184678(struct Sprite *sprite); +static void sub_81846B8(struct Sprite *sprite); + +static void sub_81845D4(struct Sprite *sprite) +{ + sub_817F70C(sprite); + sprite->pos2.x -= sprite->data[2]; + if (sprite->pos2.x <= -sprite->data[6]) + { + sprite->pos2.x = -sprite->data[6]; + sprite->data[7] = 2; + sprite->callback = sub_8184610; + } + + sub_817F70C(sprite); +} + +static void sub_8184610(struct Sprite *sprite) +{ + sub_817F70C(sprite); + sprite->pos2.x += sprite->data[7]; + sprite->data[7]++; + if (sprite->pos2.x >= 0) + sprite->callback = sub_8184640; + + sub_817F70C(sprite); +} + +static void sub_8184640(struct Sprite *sprite) +{ + sub_817F70C(sprite); + sprite->pos2.x += sprite->data[7]; + sprite->data[7]++; + if (sprite->pos2.x > sprite->data[6]) + { + sprite->pos2.x = sprite->data[6]; + sprite->callback = sub_8184678; + } + + sub_817F70C(sprite); +} + +static void sub_8184678(struct Sprite *sprite) +{ + sub_817F70C(sprite); + if (sprite->data[3] >= sprite->data[5]) + { + sprite->callback = sub_81846B8; + } + else + { + sprite->pos2.x += sprite->data[4]; + sprite->data[4] *= -1; + sprite->data[3]++; + } + + sub_817F70C(sprite); +} + +static void sub_81846B8(struct Sprite *sprite) +{ + sub_817F70C(sprite); + sprite->pos2.x -= 2; + if (sprite->pos2.x <= 0) + { + sprite->pos2.x = 0; + sub_817F77C(sprite); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + + sub_817F70C(sprite); +} + +static void pokemonanimfunc_88(struct Sprite *sprite) +{ + HandleStartAffineAnim(sprite); + sprite->data[7] = 4; + sprite->data[6] = 12; + sprite->data[5] = 16; + sprite->data[4] = 4; + sprite->data[3] = 0; + sprite->data[2] = 2; + sprite->callback = sub_81845D4; +} + +static void pokemonanimfunc_89(struct Sprite *sprite) +{ + HandleStartAffineAnim(sprite); + sprite->data[7] = 2; + sprite->data[6] = 8; + sprite->data[5] = 12; + sprite->data[4] = 2; + sprite->data[3] = 0; + sprite->data[2] = 1; + sprite->callback = sub_81845D4; +} + +static void pokemonanimfunc_8A(struct Sprite *sprite) +{ + HandleStartAffineAnim(sprite); + sprite->data[7] = 0; + sprite->data[6] = 6; + sprite->data[5] = 6; + sprite->data[4] = 2; + sprite->data[3] = 0; + sprite->data[2] = 1; + sprite->callback = sub_81845D4; +} + +static void sub_8184770(struct Sprite *sprite) +{ + sprite->pos2.x = sprite->data[1]; + if (sprite->data[0] > 1) + { + sprite->data[1] *= -1; + sprite->data[0] = 0; + } + else + { + sprite->data[0]++; + } +} + +struct YellowBlendStruct +{ + u8 field_0; + u8 field_1; +}; + +static const struct YellowBlendStruct sUnknown_0860ADCC[] = +{ + {0, 1}, + {1, 2}, + {0, 15}, + {1, 1}, + {0, 15}, + {1, 1}, + {0, 15}, + {1, 1}, + {0, 1}, + {1, 1}, + {0, 1}, + {1, 1}, + {0, 1}, + {1, 1}, + {0, 1}, + {1, 1}, + {0, 1}, + {1, 1}, + {0, 1}, + {0, 0xFF} +}; + +static const struct YellowBlendStruct sUnknown_0860AE1C[] = +{ + {0, 5}, + {1, 1}, + {0, 15}, + {1, 4}, + {0, 2}, + {1, 2}, + {0, 2}, + {1, 2}, + {0, 2}, + {1, 2}, + {0, 2}, + {1, 2}, + {0, 2}, + {0, 0xFF} +}; + +static const struct YellowBlendStruct sUnknown_0860AE54[] = +{ + {0, 1}, + {1, 1}, + {0, 20}, + {1, 1}, + {0, 20}, + {1, 1}, + {0, 20}, + {1, 1}, + {0, 1}, + {0, 0xFF} +}; + +static const struct YellowBlendStruct *const sUnknown_0860AE7C[] = +{ + sUnknown_0860ADCC, + sUnknown_0860AE1C, + sUnknown_0860AE54 +}; + +static void BackAnimBlendYellow(struct Sprite *sprite) +{ + const struct YellowBlendStruct *array = sUnknown_0860AE7C[sprite->data[3]]; + sub_8184770(sprite); + if (array[sprite->data[6]].field_1 == 0xFF) + { + sprite->pos2.x = 0; + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + else + { + if (sprite->data[4] == 1) + { + if (array[sprite->data[6]].field_0 != 0) + BlendPalette(sprite->data[7], 0x10, 0x10, 0x3FF); + else + BlendPalette(sprite->data[7], 0x10, 0, 0x3FF); + + sprite->data[4] = 0; + } + + if (array[sprite->data[6]].field_1 == sprite->data[5]) + { + sprite->data[4] = 1; + sprite->data[5] = 0; + sprite->data[6]++; + } + else + { + sprite->data[5]++; + } + } +} + +static void pokemonanimfunc_8B(struct Sprite *sprite) +{ + if (++sprite->data[2] == 1) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[6] = 0; + sprite->data[5] = 0; + sprite->data[4] = 0; + sprite->data[3] = 0; + } + + BackAnimBlendYellow(sprite); +} + +static void pokemonanimfunc_8C(struct Sprite *sprite) +{ + if (++sprite->data[2] == 1) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[6] = 0; + sprite->data[5] = 0; + sprite->data[4] = 0; + sprite->data[3] = 1; + } + + BackAnimBlendYellow(sprite); +} + +static void pokemonanimfunc_8D(struct Sprite *sprite) +{ + if (++sprite->data[2] == 1) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[6] = 0; + sprite->data[5] = 0; + sprite->data[4] = 0; + sprite->data[3] = 2; + } + + BackAnimBlendYellow(sprite); +} + +static const u16 sUnknown_0860AE88[] = +{ + 0x1F, 0x3E0, 0x7C00, 0x0 +}; + +static void BackAnimBlend(struct Sprite *sprite) +{ + if (sprite->data[2] > 127) + { + BlendPalette(sprite->data[7], 0x10, 0, 0x1F); + sprite->callback = SpriteCB_SetDummyOnAnimEnd; + } + else + { + sprite->data[6] = Sin(sprite->data[2], 12); + BlendPalette(sprite->data[7], 0x10, sprite->data[6], sUnknown_0860AE88[sprite->data[1]]); + } +} + +static void sub_8184934(struct Sprite *sprite) +{ + if (sprite->data[3] < sprite->data[4]) + { + sub_817F70C(sprite); + if (sprite->data[5] > sprite->data[0]) + { + if (++sprite->data[3] < sprite->data[4]) + sprite->data[5] = 0; + + sprite->pos2.x = 0; + } + else + { + s8 sign = 1 - (sprite->data[3] % 2 * 2); + sprite->pos2.x = sign * Sin((sprite->data[5] * 384 / sprite->data[0]) % 256, 6); + sprite->data[5]++; + } + + sub_817F70C(sprite); + } +} + +static void pokemonanimfunc_8E(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 10; + sprite->data[5] = 0; + sprite->data[4] = 2; + sprite->data[3] = 0; + sprite->data[1] = 0; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_8F(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 20; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 0; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_90(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 80; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 0; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_91(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 10; + sprite->data[5] = 0; + sprite->data[4] = 2; + sprite->data[3] = 0; + sprite->data[1] = 1; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_92(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 20; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 1; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_93(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 80; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 1; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_94(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 10; + sprite->data[5] = 0; + sprite->data[4] = 2; + sprite->data[3] = 0; + sprite->data[1] = 2; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_95(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 20; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 2; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void pokemonanimfunc_96(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->data[7] = (sprite->oam.paletteNum * 16) + 256; + sprite->data[0] = 80; + sprite->data[5] = 0; + sprite->data[4] = 1; + sprite->data[3] = 0; + sprite->data[1] = 2; + } + + if (sprite->data[2] % 2 == 0) + BackAnimBlend(sprite); + + if (sprite->data[2] >= (128 - sprite->data[0] * sprite->data[4]) / 2) + sub_8184934(sprite); + + sprite->data[2]++; +} + +static void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite) +{ + if (sprite->animEnded) + sprite->callback = SpriteCallbackDummy; +} diff --git a/sym_bss.txt b/sym_bss.txt index 409690e38..f930a5b98 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -74,16 +74,8 @@ gUnknown_03001204: @ 3001204 .space 0x4 .include "src/battle_transition.o" - -gUnknown_03001240: @ 3001240 - .space 0x30 - -gUnknown_03001270: @ 3001270 - .space 0x4 - -gUnknown_03001274: @ 3001274 - .space 0x4 - + .include "src/pokemon_animation.o" + gUnknown_03001278: @ 3001278 .space 0x1