diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s index b31af7d1e..d6a9ac8e6 100644 --- a/asm/battle_anim_815A0D4.s +++ b/asm/battle_anim_815A0D4.s @@ -259,7 +259,7 @@ _0815A2B2: strh r0, [r5, 0x2E] strh r7, [r5, 0x32] strh r6, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 @@ -767,7 +767,7 @@ sub_815A6C4: @ 815A6C4 sub sp, 0x4 adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimTarget ldrb r0, [r0] mov r5, sp @@ -802,7 +802,7 @@ _0815A6F8: ldr r0, =0x0000ffce strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_815A73C str r0, [r4, 0x1C] add sp, 0x4 @@ -2216,7 +2216,7 @@ sub_815B27C: @ 815B27C bne _0815B290 adds r0, r5, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos _0815B290: ldrh r0, [r5, 0x2E] adds r0, 0x1 @@ -2291,7 +2291,7 @@ _0815B2D8: lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] _0815B324: pop {r4,r5} @@ -2810,7 +2810,7 @@ sub_815B70C: @ 815B70C _0815B71E: adds r0, r4, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0x90 lsls r0, 4 strh r0, [r4, 0x30] @@ -4309,7 +4309,7 @@ sub_815C400: @ 815C400 bne _0815C41E adds r0, r4, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] @@ -8448,7 +8448,7 @@ _0815E4EE: adds r0, r1 lsls r0, 2 adds r0, r4 - bl sub_80A68D4 + bl InitAnimArcTranslation mov r1, r10 ldrb r0, [r1] bl GetBattlerSide @@ -9605,7 +9605,7 @@ sub_815EE84: @ 815EE84 bne _0815EEA8 adds r0, r4, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker b _0815EEAA .pool diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index ab3f27799..c0881e682 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -1473,7 +1473,7 @@ sub_8171104: @ 8171104 ldr r0, =0x0000ffd8 strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8171134 str r0, [r4, 0x1C] pop {r4} @@ -2631,7 +2631,7 @@ _08171A26: ldrsb r0, [r1, r0] strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation add r4, r10 ldr r0, =sub_8171AAC str r0, [r4] @@ -5571,7 +5571,7 @@ sub_817330C: @ 817330C push {r4,r5,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0x1E strh r0, [r4, 0x2E] movs r0, 0x1 @@ -5600,7 +5600,7 @@ sub_817330C: @ 817330C ldr r0, =0x0000ffe0 strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r2, =gSprites ldr r1, =gBattlerSpriteIds ldr r0, =gBattleAnimAttacker diff --git a/asm/battle_anim_effects_1.s b/asm/battle_anim_effects_1.s index 138cc271e..eb1fc50f3 100644 --- a/asm/battle_anim_effects_1.s +++ b/asm/battle_anim_effects_1.s @@ -92,7 +92,7 @@ sub_80FE8E0: @ 80FE8E0 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] @@ -109,7 +109,7 @@ sub_80FE8E0: @ 80FE8E0 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 @@ -125,7 +125,7 @@ sub_80FE930: @ 80FE930 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimArgs ldrb r1, [r5, 0x6] adds r0, r4, 0 @@ -145,7 +145,7 @@ sub_80FE930: @ 80FE930 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 @@ -161,7 +161,7 @@ sub_80FE988: @ 80FE988 push {r4-r6,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r6, =gBattleAnimArgs ldrh r0, [r6, 0x4] strh r0, [r4, 0x2E] @@ -337,7 +337,7 @@ sub_80FEAD8: @ 80FEAD8 ldrh r0, [r6, 0x4] strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_80FEB28 str r0, [r4, 0x1C] pop {r4-r6} @@ -493,7 +493,7 @@ sub_80FEC48: @ 80FEC48 push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -528,7 +528,7 @@ _080FEC68: ldrh r0, [r4, 0xA] strh r0, [r6, 0x38] adds r0, r6, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_80FECB8 str r0, [r6, 0x1C] pop {r4-r6} @@ -762,7 +762,7 @@ sub_80FEE78: @ 80FEE78 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimArgs ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] @@ -859,7 +859,7 @@ sub_80FEF44: @ 80FEF44 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimArgs ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] @@ -1079,7 +1079,7 @@ sub_80FF0F4: @ 80FF0F4 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -1138,7 +1138,7 @@ _080FF174: ldrh r0, [r0, 0xA] strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -1256,8 +1256,8 @@ _080FF260: bx r0 thumb_func_end sub_80FF1C0 - thumb_func_start sub_80FF268 -sub_80FF268: @ 80FF268 + thumb_func_start AnimMoveTwisterParticle +AnimMoveTwisterParticle: @ 80FF268 push {r4,lr} adds r4, r0, 0 bl IsDoubleBattle @@ -1294,7 +1294,7 @@ _080FF28A: pop {r0} bx r0 .pool - thumb_func_end sub_80FF268 + thumb_func_end AnimMoveTwisterParticle thumb_func_start sub_80FF2BC sub_80FF2BC: @ 80FF2BC @@ -2348,7 +2348,7 @@ sub_80FFB18: @ 80FFB18 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r4, =gBattleAnimTarget ldrb r0, [r4] movs r1, 0 @@ -3100,7 +3100,7 @@ _08100060: adds r0, r1 lsls r0, 2 adds r0, r4 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8100128 str r0, [r5] pop {r4-r6} @@ -3263,7 +3263,7 @@ _08100204: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -3335,7 +3335,7 @@ _08100272: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -3394,7 +3394,7 @@ _081002E8: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -3448,7 +3448,7 @@ _08100380: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -3505,7 +3505,7 @@ _081003D2: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -3557,7 +3557,7 @@ _08100464: adds r0, r4, 0 bl StartSpriteAnim adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrh r0, [r6, 0x8] adds r0, 0x1 b _081004FA @@ -5766,7 +5766,7 @@ _08101604: asrs r0, 24 adds r4, r0 strh r4, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =sub_8101684 adds r0, r5, 0 @@ -5900,7 +5900,7 @@ _08101718: lsrs r0, 24 adds r0, r6 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =sub_8101820 adds r0, r5, 0 @@ -7478,7 +7478,7 @@ _08102390: lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 diff --git a/asm/battle_anim_effects_2.s b/asm/battle_anim_effects_2.s index 8ace81dbb..088e84ca3 100644 --- a/asm/battle_anim_effects_2.s +++ b/asm/battle_anim_effects_2.s @@ -240,7 +240,7 @@ sub_8103620: @ 8103620 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] @@ -269,7 +269,7 @@ sub_8103658: @ 8103658 ldrh r1, [r0, 0x22] adds r1, 0xF strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC + ldr r1, =StartAnimLinearTranslation str r1, [r0, 0x1C] ldr r1, =sub_8103680 bl StoreSpriteCallbackInData6 @@ -526,7 +526,7 @@ sub_810387C: @ 810387C push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =sub_80A67BC str r0, [r4, 0x1C] ldr r1, =sub_81038A0 @@ -548,7 +548,7 @@ sub_81038A0: @ 81038A0 ldrh r1, [r0, 0x22] subs r1, 0x20 strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC + ldr r1, =StartAnimLinearTranslation str r1, [r0, 0x1C] ldr r1, =DestroyAnimSprite bl StoreSpriteCallbackInData6 @@ -594,7 +594,7 @@ _081038EC: _0810390E: adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r4, =gBattleAnimTarget ldrb r0, [r4] movs r1, 0x2 @@ -657,7 +657,7 @@ _08103980: mov r0, r8 strh r0, [r5, 0x32] strh r7, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 @@ -1424,7 +1424,7 @@ sub_8103FE8: @ 8103FE8 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gUnknown_085934A0 ldrh r0, [r0, 0x2] bl IndexOfSpritePaletteTag @@ -1507,7 +1507,7 @@ sub_8104088: @ 8104088 sub sp, 0x4 adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r4, =gBattleAnimTarget ldrb r0, [r4] movs r1, 0x2 @@ -1655,7 +1655,7 @@ sub_81041C4: @ 81041C4 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0x14 strh r0, [r4, 0x2E] ldr r5, =gBattleAnimTarget @@ -1671,7 +1671,7 @@ sub_81041C4: @ 81041C4 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] adds r2, r4, 0 adds r2, 0x2C @@ -1809,7 +1809,7 @@ sub_8104304: @ 8104304 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -1896,7 +1896,7 @@ _08104390: lsrs r0, 24 adds r0, r6 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =sub_81043F8 adds r0, r5, 0 @@ -4038,7 +4038,7 @@ sub_8105538: @ 8105538 push {r4,lr} adds r4, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -5141,7 +5141,7 @@ sub_8105DE8: @ 8105DE8 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r6, =gBattleAnimAttacker ldrb r0, [r6] bl GetBattlerSide @@ -5172,7 +5172,7 @@ _08105E08: ldrh r1, [r4, 0x6] adds r0, r1 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 @@ -5200,7 +5200,7 @@ sub_8105E60: @ 8105E60 bne _08105E7A adds r0, r4, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos _08105E7A: movs r1, 0x30 ldrsh r0, [r4, r1] @@ -5525,7 +5525,7 @@ sub_8106140: @ 8106140 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0x5F strh r0, [r4, 0x2E] ldrh r0, [r4, 0x20] @@ -6543,7 +6543,7 @@ sub_81069B8: @ 81069B8 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =sub_810699C str r0, [r4, 0x1C] pop {r4} @@ -7496,7 +7496,7 @@ _08107118: ldrh r0, [r5, 0x22] subs r0, 0x48 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 diff --git a/asm/bug.s b/asm/bug.s index 36ac05ace..0b26a3001 100644 --- a/asm/bug.s +++ b/asm/bug.s @@ -85,7 +85,7 @@ _081103C4: ldrh r4, [r4, 0x6] adds r0, r4 strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r6, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r6, 0 @@ -160,7 +160,7 @@ _08110478: lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r6, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r6, 0 @@ -189,7 +189,7 @@ sub_81104E4: @ 81104E4 _08110500: adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r5, 0x2E] @@ -528,7 +528,7 @@ _081107A0: _081107B2: adds r0, r7, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimTarget ldrb r0, [r5] movs r1, 0x2 @@ -579,7 +579,7 @@ _081107B2: strh r0, [r7, 0x2E] strh r4, [r7, 0x32] strh r5, [r7, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r7, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r7, 0 @@ -596,7 +596,7 @@ sub_8110850: @ 8110850 push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -631,7 +631,7 @@ _08110870: ldrh r0, [r4, 0xA] strh r0, [r6, 0x38] adds r0, r6, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_81108CC str r0, [r6, 0x1C] adds r2, r6, 0 diff --git a/asm/dark.s b/asm/dark.s index 07f24d27e..e4373723d 100644 --- a/asm/dark.s +++ b/asm/dark.s @@ -264,7 +264,7 @@ sub_81138D4: @ 81138D4 movs r0, 0x7E strh r0, [r4, 0x2E] adds r0, r4, 0 - bl sub_80A6E14 + bl InitSpriteDataForLinearTranslation ldrh r0, [r4, 0x30] negs r0, r0 strh r0, [r4, 0x34] @@ -563,7 +563,7 @@ _08113B60: ldr r0, =0x0000fff4 strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8113B90 str r0, [r4, 0x1C] pop {r4-r7} diff --git a/asm/dragon.s b/asm/dragon.s index dc3ca1d0b..e4a39a52a 100644 --- a/asm/dragon.s +++ b/asm/dragon.s @@ -144,7 +144,7 @@ _0811318E: ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x8] strh r0, [r5, 0x2E] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 diff --git a/asm/electric.s b/asm/electric.s index 3d8864186..a6fd31319 100644 --- a/asm/electric.s +++ b/asm/electric.s @@ -345,7 +345,7 @@ sub_810A46C: @ 810A46C push {r4-r6,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimArgs ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] diff --git a/asm/fight.s b/asm/fight.s index 508b942bc..191e2e28a 100644 --- a/asm/fight.s +++ b/asm/fight.s @@ -104,7 +104,7 @@ sub_810CEE0: @ 810CEE0 bne _0810CF04 adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos b _0810CF0C .pool _0810CF04: @@ -378,7 +378,7 @@ _0810D142: ldrh r0, [r4, 0x22] subs r0, 0x14 strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] ldr r1, =sub_810D164 adds r0, r4, 0 @@ -417,7 +417,7 @@ sub_810D164: @ 810D164 strh r1, [r5, 0x22] strh r6, [r5, 0x26] strh r6, [r5, 0x24] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 @@ -618,7 +618,7 @@ sub_810D308: @ 810D308 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =sub_810D360 adds r0, r5, 0 @@ -1460,7 +1460,7 @@ sub_810DA10: @ 810DA10 bne _0810DA2C adds r0, r4, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos b _0810DA34 .pool _0810DA2C: diff --git a/asm/fire.s b/asm/fire.s index e7ca3072b..6efd9f45e 100644 --- a/asm/fire.s +++ b/asm/fire.s @@ -347,7 +347,7 @@ sub_810916C: @ 810916C strh r1, [r0, 0x32] movs r1, 0x50 strh r1, [r0, 0x36] - ldr r1, =sub_80A6EEC + ldr r1, =StartAnimLinearTranslation str r1, [r0, 0x1C] ldr r1, =DestroyAnimSprite bl StoreSpriteCallbackInData6 @@ -421,7 +421,7 @@ sub_810921C: @ 810921C push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x4] movs r1, 0 @@ -613,7 +613,7 @@ sub_81093A4: @ 81093A4 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x30] @@ -1564,7 +1564,7 @@ _08109B12: _08109B18: adds r0, r5, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r4, =gBattleAnimArgs ldrb r1, [r4, 0x4] adds r0, r5, 0 diff --git a/asm/flying.s b/asm/flying.s index 87ba79c91..262fe3749 100644 --- a/asm/flying.s +++ b/asm/flying.s @@ -199,7 +199,7 @@ sub_810DFA8: @ 810DFA8 push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -359,7 +359,7 @@ _0810E0FE: ldrh r3, [r5, 0x36] adds r0, r3 strh r0, [r5, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r5, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r5, 0 @@ -378,7 +378,7 @@ sub_810E13C: @ 810E13C push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] @@ -1613,7 +1613,7 @@ sub_810EAA0: @ 810EAA0 bne _0810EABC adds r0, r5, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos b _0810EAC4 .pool _0810EABC: @@ -1807,7 +1807,7 @@ sub_810EC34: @ 810EC34 _0810EC46: adds r0, r4, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0 bl GetAnimBattlerSpriteId ldr r2, =gSprites @@ -1927,7 +1927,7 @@ sub_810ED28: @ 810ED28 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] diff --git a/asm/ghost.s b/asm/ghost.s index 8b16d94c5..53f394e04 100644 --- a/asm/ghost.s +++ b/asm/ghost.s @@ -10,7 +10,7 @@ sub_811160C: @ 811160C push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] @@ -2441,7 +2441,7 @@ sub_81129F0: @ 81129F0 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide diff --git a/asm/ground.s b/asm/ground.s index c5f3d80b6..d53f2aabf 100644 --- a/asm/ground.s +++ b/asm/ground.s @@ -40,7 +40,7 @@ sub_8114994: @ 8114994 ldr r0, =0x0000ffd8 strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_81149FC str r0, [r4, 0x1C] pop {r4,r5} @@ -86,7 +86,7 @@ sub_81149FC: @ 81149FC movs r0, 0x28 strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8114A60 str r0, [r5, 0x1C] _08114A50: @@ -149,7 +149,7 @@ _08114A9C: ldrh r4, [r4, 0x6] adds r0, r4 strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r6, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r6, 0 @@ -167,7 +167,7 @@ sub_8114AF0: @ 8114AF0 push {r7} adds r6, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r4, =gBattleAnimTarget ldrb r0, [r4] movs r1, 0x2 @@ -211,7 +211,7 @@ _08114B48: strh r0, [r6, 0x32] adds r0, r7, r4 strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r6, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r6, 0 @@ -1034,7 +1034,7 @@ _081151DA: ldrh r0, [r7, 0x8] strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8115228 str r0, [r5, 0x1C] pop {r4-r7} diff --git a/asm/ice.s b/asm/ice.s index bc55ba804..37142e535 100644 --- a/asm/ice.s +++ b/asm/ice.s @@ -370,7 +370,7 @@ sub_810B8EC: @ 810B8EC push {r4,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimTarget ldrb r0, [r0] movs r1, 0x2 @@ -413,7 +413,7 @@ _0810B936: ldr r1, =DestroyAnimSprite adds r0, r4, 0 bl StoreSpriteCallbackInData6 - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] pop {r4} pop {r0} @@ -513,7 +513,7 @@ sub_810BA24: @ 810BA24 sub sp, 0x10 adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r6, =gBattleAnimArgs ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] @@ -814,7 +814,7 @@ sub_810BC94: @ 810BC94 sub sp, 0x10 adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r1, =gBattleAnimArgs ldrh r0, [r1, 0x8] strh r0, [r5, 0x2E] @@ -1103,7 +1103,7 @@ sub_810BED0: @ 810BED0 bne _0810BEF4 adds r0, r5, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos b _0810BF32 .pool _0810BEF4: @@ -2762,7 +2762,7 @@ _0810CCA6: bl StartSpriteAffineAnim adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r6, =gBattleAnimArgs ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] @@ -2796,7 +2796,7 @@ _0810CCCE: ldrh r0, [r6, 0xA] strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_810CD1C str r0, [r5, 0x1C] pop {r4-r6} diff --git a/asm/normal.s b/asm/normal.s index b52477221..2c1df2298 100644 --- a/asm/normal.s +++ b/asm/normal.s @@ -1584,7 +1584,7 @@ sub_8116388: @ 8116388 bne _081163AC adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos b _081163B4 .pool _081163AC: @@ -1616,7 +1616,7 @@ sub_81163D0: @ 81163D0 bne _081163F4 adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos b _081163FC .pool _081163F4: @@ -1690,7 +1690,7 @@ _08116474: bne _08116494 adds r0, r4, 0 movs r1, 0 - bl sub_80A69CC + bl InitAnimSpritePos b _0811649C .pool _08116494: @@ -1789,7 +1789,7 @@ sub_8116560: @ 8116560 bne _0811657C adds r0, r4, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos b _08116584 .pool _0811657C: @@ -1824,7 +1824,7 @@ sub_81165A8: @ 81165A8 bne _081165CC adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos b _081165D4 .pool _081165CC: diff --git a/asm/poison.s b/asm/poison.s index 22f6c3971..d2266bfe5 100644 --- a/asm/poison.s +++ b/asm/poison.s @@ -20,7 +20,7 @@ sub_810DBAC: @ 810DBAC _0810DBC2: adds r0, r5, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldrh r0, [r4, 0x4] strh r0, [r5, 0x2E] ldr r4, =gBattleAnimTarget @@ -39,7 +39,7 @@ _0810DBC2: ldr r0, =0x0000ffe2 strh r0, [r5, 0x38] adds r0, r5, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_810DC10 str r0, [r5, 0x1C] pop {r4,r5} @@ -80,7 +80,7 @@ sub_810DC2C: @ 810DC2C _0810DC44: adds r0, r4, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimTarget ldrb r0, [r0] mov r6, sp @@ -113,7 +113,7 @@ _0810DC72: ldr r0, =0x0000ffe2 strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_810DCB4 str r0, [r4, 0x1C] add sp, 0x4 @@ -157,7 +157,7 @@ sub_810DCD0: @ 810DCD0 adds r0, r1 strh r0, [r4, 0x36] adds r0, r4, 0 - bl sub_80A6E14 + bl InitSpriteDataForLinearTranslation movs r1, 0x30 ldrsh r0, [r4, r1] movs r2, 0x4 @@ -242,7 +242,7 @@ _0810DD7C: strh r2, [r4, 0x32] adds r1, r3 strh r1, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 diff --git a/asm/psychic.s b/asm/psychic.s index 8cd95d95a..ef1915241 100644 --- a/asm/psychic.s +++ b/asm/psychic.s @@ -514,7 +514,7 @@ _0810F5EE: bne _0810F608 adds r0, r4, 0 adds r1, r6, 0 - bl sub_80A69CC + bl InitAnimSpritePos b _0810F610 .pool _0810F608: @@ -1449,7 +1449,7 @@ _0810FD60: ldrh r0, [r5, 0x1C] strh r0, [r4, 0x38] adds r0, r4, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldrb r0, [r5, 0xC] movs r1, 0x3 ands r1, r0 diff --git a/asm/rock.s b/asm/rock.s deleted file mode 100644 index ed8147600..000000000 --- a/asm/rock.s +++ /dev/null @@ -1,1469 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_81109F0 -sub_81109F0: @ 81109F0 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r6, =gBattleAnimArgs - movs r1, 0x6 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _08110A10 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - adds r2, r5, 0 - adds r2, 0x20 - adds r3, r5, 0 - adds r3, 0x22 - movs r1, 0 - bl SetAverageBattlerPositions -_08110A10: - ldrh r0, [r6] - ldrh r1, [r5, 0x20] - adds r0, r1 - movs r4, 0 - strh r0, [r5, 0x20] - ldrh r0, [r5, 0x22] - adds r0, 0xE - strh r0, [r5, 0x22] - ldrb r1, [r6, 0x2] - adds r0, r5, 0 - bl StartSpriteAnim - adds r0, r5, 0 - bl AnimateSprite - strh r4, [r5, 0x2E] - strh r4, [r5, 0x30] - movs r0, 0x4 - strh r0, [r5, 0x32] - movs r0, 0x10 - strh r0, [r5, 0x34] - ldr r0, =0x0000ffba - strh r0, [r5, 0x36] - ldrh r0, [r6, 0x4] - strh r0, [r5, 0x38] - ldr r1, =sub_8110A70 - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - ldr r1, =sub_80A6450 - str r1, [r5, 0x1C] - adds r0, r5, 0 - bl _call_via_r1 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81109F0 - - thumb_func_start sub_8110A70 -sub_8110A70: @ 8110A70 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x38] - ldrh r2, [r4, 0x20] - adds r0, r1, r2 - strh r0, [r4, 0x20] - movs r0, 0xC0 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x30] - movs r0, 0x4 - strh r0, [r4, 0x32] - movs r0, 0x20 - strh r0, [r4, 0x34] - ldr r0, =0x0000ffe8 - strh r0, [r4, 0x36] - ldr r1, =move_anim_8074EE0 - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - ldr r1, =sub_80A6450 - str r1, [r4, 0x1C] - adds r0, r4, 0 - bl _call_via_r1 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110A70 - - thumb_func_start sub_8110AB4 -sub_8110AB4: @ 8110AB4 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gBattleAnimArgs - ldrb r1, [r4, 0xA] - bl StartSpriteAnim - adds r0, r5, 0 - bl AnimateSprite - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08110AE4 - ldrh r0, [r5, 0x20] - ldrh r1, [r4] - subs r0, r1 - b _08110AEA - .pool -_08110AE4: - ldrh r0, [r4] - ldrh r1, [r5, 0x20] - adds r0, r1 -_08110AEA: - strh r0, [r5, 0x20] - ldr r3, =gBattleAnimArgs - ldrh r2, [r3, 0x2] - ldrh r0, [r5, 0x22] - adds r2, r0 - movs r4, 0 - strh r2, [r5, 0x22] - ldrh r0, [r3, 0x8] - strh r0, [r5, 0x2E] - ldrh r0, [r5, 0x20] - strh r0, [r5, 0x30] - ldrh r1, [r3, 0x4] - adds r0, r1 - strh r0, [r5, 0x32] - strh r2, [r5, 0x34] - ldrh r0, [r3, 0x6] - adds r2, r0 - strh r2, [r5, 0x36] - adds r0, r5, 0 - bl sub_80A6E14 - strh r4, [r5, 0x34] - strh r4, [r5, 0x36] - ldr r0, =sub_80A656C - str r0, [r5, 0x1C] - ldr r1, =move_anim_8074EE0 - adds r0, r5, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110AB4 - - thumb_func_start sub_8110B38 -sub_8110B38: @ 8110B38 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _08110B54 - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - b _08110B5C - .pool -_08110B54: - adds r0, r4, 0 - movs r1, 0 - bl sub_80A6980 -_08110B5C: - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x30] - ldrh r0, [r1, 0x8] - strh r0, [r4, 0x32] - ldrh r0, [r1, 0xA] - strh r0, [r4, 0x34] - ldr r0, =sub_8110B80 - str r0, [r4, 0x1C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110B38 - - thumb_func_start sub_8110B80 -sub_8110B80: @ 8110B80 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x36] - adds r0, r1 - strh r0, [r4, 0x36] - lsls r0, 16 - asrs r0, 24 - negs r0, r0 - strh r0, [r4, 0x26] - movs r2, 0x38 - ldrsh r0, [r4, r2] - movs r2, 0x34 - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x32] - ldrh r1, [r4, 0x38] - adds r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x2E] - subs r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _08110BC6 - adds r0, r4, 0 - bl DestroyAnimSprite -_08110BC6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8110B80 - - thumb_func_start AnimTask_LoadSandstormBackground -AnimTask_LoadSandstormBackground: @ 8110BCC - push {r4-r6,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0x80 - lsls r1, 5 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl SetAnimBgAttribute - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _08110C10 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0x1 - bl SetAnimBgAttribute -_08110C10: - ldr r0, =gBattle_BG1_X - strh r5, [r0] - ldr r4, =gBattle_BG1_Y - strh r5, [r4] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldrh r1, [r4] - movs r0, 0x16 - bl SetGpuReg - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - ldr r1, =gUnknown_08D8D58C - mov r2, sp - ldrh r2, [r2, 0xA] - bl sub_80A6CC0 - ldr r1, =gUnknown_08D8D410 - mov r0, sp - movs r2, 0 - bl sub_80A6D60 - ldr r0, =gBattleAnimSpritePalette_261 - mov r1, sp - ldrb r1, [r1, 0x8] - lsls r1, 4 - movs r2, 0x20 - bl LoadCompressedPalette - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _08110C6E - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08110C6E - movs r5, 0x1 -_08110C6E: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - strh r5, [r1, 0x8] - ldr r0, =sub_8110CB0 - str r0, [r1] - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_LoadSandstormBackground - - thumb_func_start sub_8110CB0 -sub_8110CB0: @ 8110CB0 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - adds r2, r1, 0 - cmp r0, 0 - bne _08110CE4 - ldr r1, =gBattle_BG1_X - ldr r3, =0x0000fffa - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - b _08110CEA - .pool -_08110CE4: - ldr r1, =gBattle_BG1_X - ldrh r0, [r1] - adds r0, 0x6 -_08110CEA: - strh r0, [r1] - ldr r1, =gBattle_BG1_Y - ldr r3, =0x0000ffff - adds r0, r3, 0 - ldrh r3, [r1] - adds r0, r3 - strh r0, [r1] - lsls r1, r5, 2 - adds r0, r1, r5 - lsls r0, 3 - adds r0, r2 - movs r3, 0x20 - ldrsh r0, [r0, r3] - adds r4, r1, 0 - cmp r0, 0x4 - bls _08110D0C - b _08110E3A -_08110D0C: - lsls r0, 2 - ldr r1, =_08110D28 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08110D28: - .4byte _08110D3C - .4byte _08110D7E - .4byte _08110D98 - .4byte _08110DDA - .4byte _08110DFC -_08110D3C: - adds r0, r4, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - movs r5, 0 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08110E3A - strh r5, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - adds r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bne _08110E3A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r5, [r4, 0x1E] - b _08110E3A -_08110D7E: - adds r0, r4, r5 - lsls r0, 3 - adds r1, r0, r2 - ldrh r0, [r1, 0x1E] - adds r0, 0x1 - strh r0, [r1, 0x1E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x65 - bne _08110E3A - movs r0, 0x7 - strh r0, [r1, 0x1E] - b _08110DF0 -_08110D98: - adds r0, r4, r5 - lsls r0, 3 - adds r4, r0, r2 - ldrh r0, [r4, 0x1C] - adds r0, 0x1 - strh r0, [r4, 0x1C] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bne _08110E3A - movs r0, 0 - strh r0, [r4, 0x1C] - ldrh r1, [r4, 0x1E] - subs r1, 0x1 - strh r1, [r4, 0x1E] - movs r0, 0x10 - subs r0, r1 - lsls r0, 8 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg - movs r2, 0x1E - ldrsh r1, [r4, r2] - cmp r1, 0 - bne _08110E3A - ldrh r0, [r4, 0x20] - adds r0, 0x1 - strh r0, [r4, 0x20] - strh r1, [r4, 0x1E] - b _08110E3A -_08110DDA: - mov r0, sp - bl sub_80A6B30 - mov r0, sp - ldrb r0, [r0, 0x9] - bl sub_80A6C68 - ldr r0, =gTasks - adds r1, r4, r5 - lsls r1, 3 - adds r1, r0 -_08110DF0: - ldrh r0, [r1, 0x20] - adds r0, 0x1 - strh r0, [r1, 0x20] - b _08110E3A - .pool -_08110DFC: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _08110E10 - movs r0, 0x1 - movs r1, 0x3 - movs r2, 0 - bl SetAnimBgAttribute -_08110E10: - ldr r0, =gBattle_BG1_X - movs r1, 0 - strh r1, [r0] - ldr r0, =gBattle_BG1_Y - strh r1, [r0] - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1 - movs r1, 0x4 - movs r2, 0x1 - bl SetAnimBgAttribute - adds r0, r5, 0 - bl DestroyAnimVisualTask -_08110E3A: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110CB0 - - thumb_func_start sub_8110E4C -sub_8110E4C: @ 8110E4C - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08110EC8 - ldr r4, =gBattleAnimArgs - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _08110E98 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _08110E98 - movs r0, 0x98 - lsls r0, 1 - strh r0, [r5, 0x20] - ldrh r0, [r4, 0x2] - negs r0, r0 - strh r0, [r4, 0x2] - movs r0, 0x1 - strh r0, [r5, 0x38] - ldrb r1, [r5, 0x3] - subs r0, 0x40 - ands r0, r1 - movs r1, 0x10 - orrs r0, r1 - strb r0, [r5, 0x3] - b _08110E9C - .pool -_08110E98: - ldr r0, =0x0000ffc0 - strh r0, [r5, 0x20] -_08110E9C: - ldr r4, =gBattleAnimArgs - ldrh r0, [r4] - strh r0, [r5, 0x22] - ldr r1, =gUnknown_08596BC0 - adds r0, r5, 0 - bl SetSubspriteTables - ldrh r0, [r4, 0x2] - strh r0, [r5, 0x30] - ldrh r0, [r4, 0x4] - strh r0, [r5, 0x32] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _08110F24 - .pool -_08110EC8: - ldrh r1, [r5, 0x30] - ldrh r3, [r5, 0x34] - adds r1, r3 - ldrh r2, [r5, 0x32] - ldrh r0, [r5, 0x36] - adds r2, r0 - lsls r0, r1, 16 - asrs r0, 24 - ldrh r3, [r5, 0x24] - adds r0, r3 - strh r0, [r5, 0x24] - lsls r0, r2, 16 - asrs r0, 24 - ldrh r3, [r5, 0x26] - adds r0, r3 - strh r0, [r5, 0x26] - movs r0, 0xFF - ands r1, r0 - strh r1, [r5, 0x34] - ands r2, r0 - strh r2, [r5, 0x36] - movs r1, 0x38 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _08110F0E - movs r2, 0x20 - ldrsh r0, [r5, r2] - movs r3, 0x24 - ldrsh r1, [r5, r3] - adds r0, r1 - movs r1, 0x88 - lsls r1, 1 - cmp r0, r1 - ble _08110F24 - b _08110F20 -_08110F0E: - movs r1, 0x20 - ldrsh r0, [r5, r1] - movs r2, 0x24 - ldrsh r1, [r5, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _08110F24 -_08110F20: - ldr r0, =DestroyAnimSprite - str r0, [r5, 0x1C] -_08110F24: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110E4C - - thumb_func_start sub_8110F30 -sub_8110F30: @ 8110F30 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimArgs - ldrb r1, [r5, 0x8] - bl StartSpriteAnim - adds r0, r4, 0 - movs r1, 0 - bl sub_80A69CC - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x20] - strh r0, [r4, 0x32] - ldrh r0, [r5, 0x4] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x36] - ldr r0, =sub_80A6EEC - str r0, [r4, 0x1C] - ldr r1, =DestroyAnimSprite - adds r0, r4, 0 - bl StoreSpriteCallbackInData6 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110F30 - - thumb_func_start sub_8110F74 -sub_8110F74: @ 8110F74 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 8 - movs r1, 0xC0 - lsls r1, 13 - adds r0, r1 - lsrs r7, r0, 16 - ldr r4, =gBattleAnimTarget - ldrb r0, [r4] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 8 - movs r2, 0xC0 - lsls r2, 13 - adds r0, r2 - lsrs r0, 16 - mov r8, r0 - ldrb r1, [r5] - movs r0, 0x2 - eors r0, r1 - ldrb r4, [r4] - cmp r0, r4 - bne _08110FE4 - mov r8, r7 -_08110FE4: - bl sub_811135C - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bne _08111000 - movs r0, 0x20 - b _08111006 - .pool -_08111000: - lsls r1, r5, 3 - movs r0, 0x30 - subs r0, r1 -_08111006: - strh r0, [r6, 0x18] - movs r4, 0 - strh r4, [r6, 0x8] - strh r4, [r6, 0x1E] - strh r4, [r6, 0x1A] - movs r0, 0x1 - strh r0, [r6, 0x20] - movs r1, 0x18 - ldrsh r0, [r6, r1] - cmp r0, 0 - bge _0811101E - adds r0, 0x7 -_0811101E: - asrs r0, 3 - subs r0, 0x1 - strh r0, [r6, 0x1C] - mov r2, r9 - lsls r0, r2, 3 - strh r0, [r6, 0xC] - lsls r0, r7, 3 - strh r0, [r6, 0xE] - mov r1, r10 - subs r0, r1, r2 - lsls r0, 3 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x10] - mov r1, r8 - subs r0, r1, r7 - lsls r0, 3 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x12] - strh r4, [r6, 0x14] - strh r4, [r6, 0x16] - movs r0, 0x40 - negs r0, r0 - bl BattleAnimAdjustPanning - adds r4, r0, 0 - lsls r4, 24 - asrs r4, 8 - lsrs r4, 16 - movs r0, 0x3F - bl BattleAnimAdjustPanning - lsls r0, 24 - strh r4, [r6, 0x22] - asrs r0, 24 - lsls r4, 16 - asrs r4, 16 - subs r0, r4 - movs r2, 0x18 - ldrsh r1, [r6, r2] - bl __divsi3 - strh r0, [r6, 0x24] - strh r5, [r6, 0xA] - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - strh r0, [r6, 0x26] - ldr r0, =sub_81110A4 - str r0, [r6] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8110F74 - - thumb_func_start sub_81110A4 -sub_81110A4: @ 81110A4 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bls _081110BE - b _0811120C -_081110BE: - lsls r0, 2 - ldr r1, =_081110D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081110D0: - .4byte _081110E4 - .4byte _08111148 - .4byte _08111150 - .4byte _081111AC - .4byte _081111FE -_081110E4: - ldrh r2, [r4, 0x14] - ldrh r0, [r4, 0x10] - subs r2, r0 - strh r2, [r4, 0x14] - ldrh r0, [r4, 0x16] - ldrh r1, [r4, 0x12] - subs r0, r1 - strh r0, [r4, 0x16] - ldr r3, =gSprites - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - lsls r2, 16 - asrs r2, 19 - strh r2, [r0, 0x24] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x26] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xA - bne _08111134 - movs r0, 0x14 - strh r0, [r4, 0x1E] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_08111134: - ldrh r1, [r4, 0x22] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xA2 - bl PlaySE12WithPanning - b _0811120C - .pool -_08111148: - ldrh r0, [r4, 0x1E] - subs r0, 0x1 - strh r0, [r4, 0x1E] - b _081111F0 -_08111150: - ldrh r0, [r4, 0x1A] - subs r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - beq _08111170 - ldrh r0, [r4, 0x10] - ldrh r2, [r4, 0x14] - adds r0, r2 - strh r0, [r4, 0x14] - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0x16] - adds r0, r1 - strh r0, [r4, 0x16] - b _0811117A -_08111170: - strh r0, [r4, 0x14] - strh r0, [r4, 0x16] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0811117A: - ldr r2, =gSprites - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r4, 0x14] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x24] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrh r0, [r4, 0x16] - lsls r0, 16 - asrs r0, 19 - strh r0, [r1, 0x26] - b _0811120C - .pool -_081111AC: - ldrh r0, [r4, 0x10] - ldrh r2, [r4, 0xC] - adds r0, r2 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x12] - ldrh r1, [r4, 0xE] - adds r0, r1 - strh r0, [r4, 0xE] - ldrh r0, [r4, 0x1A] - adds r0, 0x1 - strh r0, [r4, 0x1A] - lsls r0, 16 - asrs r0, 16 - movs r2, 0x1C - ldrsh r1, [r4, r2] - cmp r0, r1 - blt _081111EA - movs r0, 0 - strh r0, [r4, 0x1A] - adds r0, r4, 0 - bl sub_8111214 - ldrh r1, [r4, 0x24] - ldrh r0, [r4, 0x22] - adds r1, r0 - strh r1, [r4, 0x22] - lsls r1, 24 - asrs r1, 24 - movs r0, 0xAF - bl PlaySE12WithPanning -_081111EA: - ldrh r0, [r4, 0x18] - subs r0, 0x1 - strh r0, [r4, 0x18] -_081111F0: - lsls r0, 16 - cmp r0, 0 - bne _0811120C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0811120C -_081111FE: - movs r1, 0x1E - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0811120C - adds r0, r2, 0 - bl DestroyAnimVisualTask -_0811120C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81110A4 - - thumb_func_start sub_8111214 -sub_8111214: @ 8111214 - push {r4-r7,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4 - bhi _08111304 - lsls r0, 2 - ldr r1, =_08111234 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08111234: - .4byte _08111248 - .4byte _08111254 - .4byte _08111254 - .4byte _08111260 - .4byte _0811126C -_08111248: - ldr r3, =gUnknown_08596C28 - movs r5, 0 - b _08111270 - .pool -_08111254: - ldr r3, =gUnknown_08596C40 - movs r5, 0x50 - b _08111270 - .pool -_08111260: - ldr r3, =gUnknown_08596C40 - movs r5, 0x40 - b _08111270 - .pool -_0811126C: - ldr r3, =gUnknown_08596C40 - movs r5, 0x30 -_08111270: - ldrh r1, [r4, 0xC] - lsls r1, 16 - asrs r1, 19 - lsls r1, 16 - lsrs r1, 16 - ldrh r2, [r4, 0xE] - lsls r2, 16 - asrs r2, 19 - lsls r2, 16 - movs r6, 0x20 - ldrsh r0, [r4, r6] - lsls r0, 2 - adds r1, r0 - lsls r1, 16 - lsrs r6, r1, 16 - asrs r1, 16 - lsrs r7, r2, 16 - asrs r2, 16 - adds r0, r3, 0 - movs r3, 0x23 - bl CreateSprite - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x40 - beq _081112FC - ldr r1, =gSprites - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - movs r1, 0x12 - strh r1, [r0, 0x2E] - movs r2, 0x20 - ldrsh r1, [r4, r2] - lsls r2, r1, 2 - adds r2, r1 - lsls r2, 2 - adds r2, r6, r2 - movs r6, 0xA - ldrsh r3, [r4, r6] - lsls r1, r3, 1 - adds r1, r3 - adds r2, r1 - strh r2, [r0, 0x32] - strh r7, [r0, 0x36] - movs r1, 0xA - ldrsh r2, [r4, r1] - lsls r2, 1 - movs r3, 0x10 - negs r3, r3 - adds r1, r3, 0 - subs r1, r2 - strh r1, [r0, 0x38] - ldrh r3, [r0, 0x4] - lsls r2, r3, 22 - lsrs r2, 22 - adds r2, r5 - ldr r5, =0x000003ff - adds r1, r5, 0 - ands r2, r1 - ldr r1, =0xfffffc00 - ands r1, r3 - orrs r1, r2 - strh r1, [r0, 0x4] - bl sub_80A68D4 - ldrh r0, [r4, 0x1E] - adds r0, 0x1 - strh r0, [r4, 0x1E] -_081112FC: - movs r6, 0x20 - ldrsh r0, [r4, r6] - negs r0, r0 - strh r0, [r4, 0x20] -_08111304: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111214 - - thumb_func_start sub_811131C -sub_811131C: @ 811131C - push {r4,lr} - adds r4, r0, 0 - bl TranslateAnimArc - lsls r0, 24 - cmp r0, 0 - beq _0811134E - ldr r0, =sub_81110A4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _08111348 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x1E] - subs r0, 0x1 - strh r0, [r1, 0x1E] -_08111348: - adds r0, r4, 0 - bl DestroySprite -_0811134E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811131C - - thumb_func_start sub_811135C -sub_811135C: @ 811135C - push {lr} - ldr r0, =gAnimDisableStructPtr - ldr r0, [r0] - ldrb r1, [r0, 0x11] - lsrs r0, r1, 4 - lsls r1, 28 - lsrs r1, 28 - subs r0, r1 - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFF - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x4 - bls _0811137E - movs r1, 0x1 -_0811137E: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_811135C - - thumb_func_start sub_8111388 -sub_8111388: @ 8111388 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimArgs - ldrb r1, [r5, 0x8] - bl StartSpriteAnim - ldrh r0, [r5] - strh r0, [r4, 0x24] - ldrh r0, [r5, 0x2] - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x34] - ldrh r1, [r5, 0x4] - subs r0, r1 - strh r0, [r4, 0x34] - movs r0, 0x3 - strh r0, [r4, 0x2E] - ldrh r0, [r5, 0x6] - strh r0, [r4, 0x30] - ldr r0, =sub_81113C8 - str r0, [r4, 0x1C] - adds r4, 0x3E - ldrb r0, [r4] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111388 - - thumb_func_start sub_81113C8 -sub_81113C8: @ 81113C8 - push {lr} - adds r2, r0, 0 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x5 - negs r1, r1 - ands r1, r0 - strb r1, [r3] - ldrh r1, [r2, 0x34] - movs r3, 0x34 - ldrsh r0, [r2, r3] - cmp r0, 0 - beq _08111400 - ldrh r3, [r2, 0x32] - adds r0, r1, r3 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x2E] - adds r1, r0 - strh r1, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x2E] - lsls r1, 16 - cmp r1, 0 - ble _08111412 - movs r0, 0 - strh r0, [r2, 0x34] - b _08111412 -_08111400: - ldrh r0, [r2, 0x30] - subs r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - cmp r0, 0 - bne _08111412 - adds r0, r2, 0 - bl DestroyAnimSprite -_08111412: - pop {r0} - bx r0 - thumb_func_end sub_81113C8 - - thumb_func_start sub_8111418 -sub_8111418: @ 8111418 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _08111434 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim -_08111434: - adds r0, r4, 0 - bl TranslateAnimSpriteToTargetMonLocation - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111418 - - thumb_func_start sub_8111444 -sub_8111444: @ 8111444 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gBattleAnimTarget - ldrb r0, [r5] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gBattleAnimArgs - ldrh r3, [r2] - ldrh r5, [r4, 0x20] - adds r1, r3, r5 - strh r1, [r4, 0x20] - ldrh r1, [r2, 0x2] - adds r0, r1 - strh r0, [r4, 0x22] - strh r3, [r4, 0x30] - strh r1, [r4, 0x32] - ldrh r0, [r2, 0x4] - strh r0, [r4, 0x38] - ldrb r1, [r2, 0x6] - adds r0, r4, 0 - bl StartSpriteAnim - ldr r0, =sub_811149C - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111444 - - thumb_func_start sub_811149C -sub_811149C: @ 811149C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x2E] - adds r0, 0x8 - strh r0, [r4, 0x2E] - ldrh r0, [r4, 0x30] - ldrh r1, [r4, 0x34] - adds r0, r1 - strh r0, [r4, 0x34] - ldrh r0, [r4, 0x32] - ldrh r2, [r4, 0x36] - adds r0, r2 - strh r0, [r4, 0x36] - movs r1, 0x34 - ldrsh r0, [r4, r1] - movs r1, 0x28 - bl __divsi3 - ldrh r1, [r4, 0x24] - adds r1, r0 - strh r1, [r4, 0x24] - movs r2, 0x2E - ldrsh r0, [r4, r2] - movs r2, 0x38 - ldrsh r1, [r4, r2] - bl Sin - ldrh r1, [r4, 0x26] - subs r1, r0 - strh r1, [r4, 0x26] - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x8C - ble _081114E6 - adds r0, r4, 0 - bl DestroyAnimSprite -_081114E6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_811149C - - thumb_func_start AnimTask_GetSeismicTossDamageLevel -AnimTask_GetSeismicTossDamageLevel: @ 81114EC - push {lr} - lsls r0, 24 - lsrs r3, r0, 24 - ldr r2, =gAnimMoveDmg - ldr r0, [r2] - cmp r0, 0x20 - bgt _08111500 - ldr r1, =gBattleAnimArgs - movs r0, 0 - strh r0, [r1, 0xE] -_08111500: - ldr r2, [r2] - adds r0, r2, 0 - subs r0, 0x21 - cmp r0, 0x20 - bhi _08111510 - ldr r1, =gBattleAnimArgs - movs r0, 0x1 - strh r0, [r1, 0xE] -_08111510: - cmp r2, 0x41 - ble _0811151A - ldr r1, =gBattleAnimArgs - movs r0, 0x2 - strh r0, [r1, 0xE] -_0811151A: - adds r0, r3, 0 - bl DestroyAnimVisualTask - pop {r0} - bx r0 - .pool - thumb_func_end AnimTask_GetSeismicTossDamageLevel - - thumb_func_start sub_811152C -sub_811152C: @ 811152C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r5, r0, r1 - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0 - bne _0811154E - movs r0, 0 - bl sub_80A6DAC - movs r0, 0xC8 - strh r0, [r5, 0xA] -_0811154E: - ldr r4, =gBattle_BG3_Y - movs r1, 0xA - ldrsh r0, [r5, r1] - movs r1, 0xA - bl __divsi3 - ldrh r1, [r4] - adds r1, r0 - strh r1, [r4] - ldrh r0, [r5, 0xA] - subs r0, 0x3 - strh r0, [r5, 0xA] - movs r1, 0x8 - ldrsh r0, [r5, r1] - cmp r0, 0x78 - bne _0811157A - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0811157A: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_811152C - - thumb_func_start sub_8111590 -sub_8111590: @ 8111590 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081115BC - movs r0, 0 - bl sub_80A6DAC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =gBattle_BG3_Y - ldrh r0, [r0] - strh r0, [r4, 0xC] -_081115BC: - ldrh r0, [r4, 0xA] - adds r0, 0x50 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0xA] - ldr r6, =gBattle_BG3_Y - movs r2, 0xA - ldrsh r1, [r4, r2] - movs r0, 0x4 - bl Cos - ldrh r4, [r4, 0xC] - adds r0, r4 - strh r0, [r6] - ldr r0, =gBattleAnimArgs - movs r2, 0xE - ldrsh r1, [r0, r2] - ldr r0, =0x00000fff - cmp r1, r0 - bne _081115F4 - movs r0, 0 - strh r0, [r6] - movs r0, 0x1 - bl sub_80A6DAC - adds r0, r5, 0 - bl DestroyAnimVisualTask -_081115F4: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8111590 - - .align 2, 0 diff --git a/asm/water.s b/asm/water.s index cce11a615..408bb8c01 100644 --- a/asm/water.s +++ b/asm/water.s @@ -343,7 +343,7 @@ sub_810744C: @ 810744C push {r4-r7,lr} adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -538,7 +538,7 @@ sub_81075EC: @ 81075EC push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos movs r0, 0x1E strh r0, [r5, 0x2E] ldrh r0, [r5, 0x20] @@ -819,7 +819,7 @@ _0810781E: movs r7, 0x3 _08107828: adds r0, r6, 0 - bl sub_80A69CC + bl InitAnimSpritePos ldr r0, =gBattleAnimAttacker ldrb r0, [r0] bl GetBattlerSide @@ -849,7 +849,7 @@ _08107842: ldrh r5, [r5, 0x6] adds r0, r5 strh r0, [r6, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r6, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r6, 0 @@ -876,7 +876,7 @@ sub_8107894: @ 8107894 ldrh r0, [r4, 0x22] adds r1, r0 strh r1, [r4, 0x36] - ldr r0, =sub_80A6EEC + ldr r0, =StartAnimLinearTranslation str r0, [r4, 0x1C] ldr r1, =DestroyAnimSprite adds r0, r4, 0 @@ -904,7 +904,7 @@ sub_81078D0: @ 81078D0 _081078EC: adds r0, r4, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos _081078F4: ldr r0, =gBattleAnimArgs ldrh r0, [r0, 0x4] @@ -3137,7 +3137,7 @@ sub_8108AC0: @ 8108AC0 strh r1, [r0, 0x36] ldrh r1, [r6, 0x1A] strh r1, [r0, 0x38] - bl sub_80A68D4 + bl InitAnimArcTranslation adds r5, 0x1C adds r4, r5 ldr r0, =sub_8108B2C @@ -3191,7 +3191,7 @@ sub_8108B2C: @ 8108B2C mvns r1, r1 strh r1, [r6, 0x38] adds r0, r6, 0 - bl sub_80A68D4 + bl InitAnimArcTranslation ldr r0, =sub_8108B94 str r0, [r6, 0x1C] _08108B86: @@ -3339,7 +3339,7 @@ sub_8108C94: @ 8108C94 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 - bl sub_80A69CC + bl InitAnimSpritePos ldr r5, =gBattleAnimTarget ldrb r0, [r5] movs r1, 0x2 diff --git a/include/battle_anim.h b/include/battle_anim.h index e164cef7a..2a6131117 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -73,9 +73,17 @@ void HandleIntroSlide(u8 terrainId); u32 GetAnimBgAttribute(u8 bgId, u8 attributeId); // battle_anim_80A5C6C.s -void sub_80A6EEC(struct Sprite *sprite); -void sub_80A68D4(struct Sprite *sprite); +void sub_80A6450(struct Sprite *sprite); +void SetAverageBattlerPositions(u8 battlerId, bool8 a2, s16 *x, s16 *y); +void move_anim_8074EE0(struct Sprite *sprite); +void sub_80A656C(struct Sprite *sprite); +void InitAnimSpritePos(struct Sprite *sprite, u8 a2); +void sub_80A6980(struct Sprite *sprite, bool8 a2); +void StartAnimLinearTranslation(struct Sprite *sprite); +void InitAnimArcTranslation(struct Sprite *sprite); bool8 TranslateAnimLinear(struct Sprite *sprite); +void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite); +void sub_80A8EE4(struct Sprite *sprite); void sub_80A8278(void); void sub_80A6B30(struct UnknownAnimStruct2*); void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); @@ -85,7 +93,7 @@ void sub_80A6630(struct Sprite *sprite); void sub_80A6680(struct Sprite *sprite); void sub_80A7344(u8 spriteId); void obj_id_set_rotscale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation); -void sub_80A6E14(struct Sprite *sprite); +void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void sub_80A7270(u8 spriteId, u8 objMode); void sub_80A73A0(u8 spriteId); u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); diff --git a/include/graphics.h b/include/graphics.h index a3af44ad7..ba7f87929 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4732,4 +4732,7 @@ extern const u32 gUnknown_08D927EC[]; extern const u32 gSlotMachineReelTime_Gfx[]; +extern const u32 gUnknown_08D8D410[]; +extern const u32 gUnknown_08D8D58C[]; + #endif //GUARD_GRAPHICS_H diff --git a/ld_script.txt b/ld_script.txt index 0ea9cbb4f..90b0bfbe2 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -167,7 +167,7 @@ SECTIONS { asm/flying.o(.text); asm/psychic.o(.text); asm/bug.o(.text); - asm/rock.o(.text); + src/rock.o(.text); asm/ghost.o(.text); asm/dragon.o(.text); asm/dark.o(.text); diff --git a/src/battle_anim_80A5C6C.c b/src/battle_anim_80A5C6C.c index d8e422bb5..2621ddcd5 100644 --- a/src/battle_anim_80A5C6C.c +++ b/src/battle_anim_80A5C6C.c @@ -745,7 +745,7 @@ void sub_80A6864(struct Sprite *sprite, s16 a2) } } -void sub_80A68D4(struct Sprite *sprite) +void InitAnimArcTranslation(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; @@ -791,7 +791,7 @@ void sub_80A6980(struct Sprite *sprite, bool8 a2) sprite->pos1.y += gBattleAnimArgs[1]; } -void sub_80A69CC(struct Sprite *sprite, u8 a2) +void InitAnimSpritePos(struct Sprite *sprite, u8 a2) { if (!a2) { @@ -1004,12 +1004,12 @@ void sub_80A6DEC(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - sub_80A6E14(sprite); + InitSpriteDataForLinearTranslation(sprite); sprite->callback = sub_80A65A8; sprite->callback(sprite); } -void sub_80A6E14(struct Sprite *sprite) +void InitSpriteDataForLinearTranslation(struct Sprite *sprite) { s16 x = (sprite->data[2] - sprite->data[1]) << 8; s16 y = (sprite->data[4] - sprite->data[3]) << 8; @@ -1047,7 +1047,7 @@ void InitAnimLinearTranslation(struct Sprite *sprite) sprite->data[3] = 0; } -void sub_80A6EEC(struct Sprite *sprite) +void StartAnimLinearTranslation(struct Sprite *sprite) { sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; @@ -1476,7 +1476,7 @@ void sub_80A77C8(struct Sprite *sprite) else var = FALSE; if (!gBattleAnimArgs[2]) - sub_80A69CC(sprite, var); + InitAnimSpritePos(sprite, var); else sub_80A6980(sprite, var); sprite->data[0]++; @@ -1511,27 +1511,27 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite) else attributeId = BATTLER_COORD_Y; - sub_80A69CC(sprite, v1); + InitAnimSpritePos(sprite, v1); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, attributeId) + gBattleAnimArgs[3]; - sprite->callback = sub_80A6EEC; + sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } void sub_80A78AC(struct Sprite *sprite) { - sub_80A69CC(sprite, 1); + InitAnimSpritePos(sprite, 1); if (GetBattlerSide(gBattleAnimAttacker)) gBattleAnimArgs[2] = -gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + gBattleAnimArgs[3]; sprite->data[5] = gBattleAnimArgs[5]; - sub_80A68D4(sprite); + InitAnimArcTranslation(sprite); sprite->callback = sub_80A791C; } @@ -1558,7 +1558,7 @@ void sub_80A7938(struct Sprite *sprite) } if (!gBattleAnimArgs[5]) { - sub_80A69CC(sprite, r4); + InitAnimSpritePos(sprite, r4); battlerId = gBattleAnimAttacker; } else @@ -1572,7 +1572,7 @@ void sub_80A7938(struct Sprite *sprite) sprite->data[0] = gBattleAnimArgs[4]; sprite->data[2] = GetBattlerSpriteCoord(battlerId, BATTLER_COORD_X_2) + gBattleAnimArgs[2]; sprite->data[4] = GetBattlerSpriteCoord(battlerId, attributeId) + gBattleAnimArgs[3]; - sprite->callback = sub_80A6EEC; + sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } @@ -2454,6 +2454,6 @@ void sub_80A8EE4(struct Sprite *sprite) sprite->pos1.x += x; sprite->pos1.y = gBattleAnimArgs[5] - 80; } - sprite->callback = sub_80A6EEC; + sprite->callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); } diff --git a/src/battle_anim_80D51AC.c b/src/battle_anim_80D51AC.c index 1864a1a7a..25e07dc3a 100644 --- a/src/battle_anim_80D51AC.c +++ b/src/battle_anim_80D51AC.c @@ -442,7 +442,7 @@ void SlideMonToOriginalPos(struct Sprite *sprite) sprite->data[2] = gSprites[monSpriteId].pos1.x; sprite->data[3] = gSprites[monSpriteId].pos1.y + gSprites[monSpriteId].pos2.y; sprite->data[4] = gSprites[monSpriteId].pos1.y; - sub_80A6E14(sprite); + InitSpriteDataForLinearTranslation(sprite); sprite->data[3] = 0; sprite->data[4] = 0; sprite->data[5] = gSprites[monSpriteId].pos2.x; @@ -520,7 +520,7 @@ void SlideMonToOffset(struct Sprite *sprite) sprite->data[2] = gSprites[monSpriteId].pos1.x + gBattleAnimArgs[1]; sprite->data[3] = gSprites[monSpriteId].pos1.y; sprite->data[4] = gSprites[monSpriteId].pos1.y + gBattleAnimArgs[2]; - sub_80A6E14(sprite); + InitSpriteDataForLinearTranslation(sprite); sprite->data[3] = 0; sprite->data[4] = 0; sprite->data[5] = monSpriteId; @@ -556,7 +556,7 @@ void sub_80D5B48(struct Sprite *sprite) sprite->data[2] = sprite->data[1] + gBattleAnimArgs[1]; sprite->data[3] = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y; sprite->data[4] = sprite->data[3] + gBattleAnimArgs[2]; - sub_80A6E14(sprite); + InitSpriteDataForLinearTranslation(sprite); sprite->data[3] = gSprites[spriteId].pos2.x << 8; sprite->data[4] = gSprites[spriteId].pos2.y << 8; sprite->data[5] = spriteId; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 7589eb962..0cec046e4 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -1344,7 +1344,7 @@ static void LinkOpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_8064470; } @@ -1706,7 +1706,7 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_80676FC); diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 04554a81b..04a3784da 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -1166,7 +1166,7 @@ static void LinkPartnerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_814AF54; } @@ -1532,7 +1532,7 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 72dfb7e6b..403cc5eed 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1381,7 +1381,7 @@ static void OpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_805F240; } @@ -1855,7 +1855,7 @@ static void OpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_806280C); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index e6dc4567c..49629198c 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2385,7 +2385,7 @@ static void PlayerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1); gBattlerControllerFuncs[gActiveBattler] = sub_80588B4; @@ -2930,7 +2930,7 @@ static void PlayerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 0790cbbff..bd892c922 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -1361,7 +1361,7 @@ static void PlayerPartnerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_81BAE98; } @@ -1785,7 +1785,7 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 83c4965ea..b54e61255 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1275,7 +1275,7 @@ static void RecordedOpponentHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_81865C8; } @@ -1649,7 +1649,7 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_818962C); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index cbb46a940..17b115caa 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1276,7 +1276,7 @@ static void RecordedPlayerHandleTrainerSlideBack(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCallbackDummy); gBattlerControllerFuncs[gActiveBattler] = sub_81899F0; } @@ -1671,7 +1671,7 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index 922c5d80b..1a3a2d53d 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -1435,7 +1435,7 @@ static void WallyHandleIntroTrainerBallThrow(void) gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50; gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40; gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].pos1.y; - gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80A6EEC; + gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation; gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler; StoreSpriteCallbackInData6(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_805CC00); diff --git a/src/effects_1.c b/src/effects_1.c index 36676b70d..a8687bc38 100644 --- a/src/effects_1.c +++ b/src/effects_1.c @@ -13,7 +13,7 @@ extern void sub_80FED28(struct Sprite *); extern void sub_80FEE78(struct Sprite *); extern void sub_80FEF44(struct Sprite *); extern void sub_80FEFFC(struct Sprite *); -extern void sub_80FF268(struct Sprite *); +extern void AnimMoveTwisterParticle(struct Sprite *); extern void sub_80FF0F4(struct Sprite *); extern void sub_80FF374(struct Sprite *); extern void sub_80FF698(struct Sprite *); @@ -437,7 +437,7 @@ const struct SpriteTemplate gUnknown_085923A8 = .anims = gUnknown_08592388, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_80FF268, + .callback = AnimMoveTwisterParticle, }; const union AnimCmd gUnknown_085923C0[] = diff --git a/src/pokeball.c b/src/pokeball.c index 09e7ac639..ad839e6af 100644 --- a/src/pokeball.c +++ b/src/pokeball.c @@ -402,7 +402,7 @@ static void Task_DoPokeballSendOutAnim(u8 taskId) gSprites[ballSpriteId].data[2] = GetBattlerSpriteCoord(gBattlerTarget, BATTLER_COORD_X); gSprites[ballSpriteId].data[4] = GetBattlerSpriteCoord(gBattlerTarget, BATTLER_COORD_Y) - 16; gSprites[ballSpriteId].data[5] = -40; - sub_80A68D4(&gSprites[ballSpriteId]); + InitAnimArcTranslation(&gSprites[ballSpriteId]); gSprites[ballSpriteId].oam.affineParam = taskId; gTasks[taskId].tOpponentBattler = gBattlerTarget; gTasks[taskId].func = TaskDummy; @@ -898,7 +898,7 @@ static void SpriteCB_PlayerMonSendOut_1(struct Sprite *sprite) sprite->data[4] = GetBattlerSpriteCoord(sprite->sBattler, 3) + 24; sprite->data[5] = -30; sprite->oam.affineParam = sprite->sBattler; - sub_80A68D4(sprite); + InitAnimArcTranslation(sprite); sprite->callback = SpriteCB_PlayerMonSendOut_2; } diff --git a/src/rock.c b/src/rock.c index 83af52865..d39293547 100644 --- a/src/rock.c +++ b/src/rock.c @@ -1,22 +1,37 @@ #include "global.h" #include "battle_anim.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "palette.h" +#include "sound.h" +#include "task.h" +#include "trig.h" #include "constants/rgb.h" - -extern void sub_81109F0(struct Sprite *); -extern void sub_8110AB4(struct Sprite *); -extern void sub_8110B38(struct Sprite *); -extern void sub_8110E4C(struct Sprite *); -extern void sub_8110F30(struct Sprite *); -extern void sub_811131C(struct Sprite *); -extern void sub_8111388(struct Sprite *); -extern void sub_8111418(struct Sprite *); -extern void sub_8111444(struct Sprite *); -extern void sub_80FF268(struct Sprite *); -extern void sub_80A8EE4(struct Sprite *); +#include "constants/songs.h" extern const union AnimCmd *const gUnknown_085950E0[]; extern const union AnimCmd *const gUnknown_085954D0[]; +extern void AnimMoveTwisterParticle(struct Sprite *); + +void sub_81109F0(struct Sprite *); +void sub_8110AB4(struct Sprite *); +void AnimDirtParticleAcrossScreen(struct Sprite *); +void AnimRaiseSprite(struct Sprite *); +void sub_81110A4(u8 taskId); +void sub_811131C(struct Sprite *); +void sub_8111388(struct Sprite *); +void sub_8111418(struct Sprite *); +void sub_8111444(struct Sprite *); +void sub_8110B38(struct Sprite *); +static void sub_8110A70(struct Sprite *); +static void sub_8110B80(struct Sprite *sprite); +static void sub_8110CB0(u8 taskId); +static void sub_8111214(struct Task *task); +static u8 sub_811135C(void); +static void sub_81113C8(struct Sprite *sprite); +static void sub_811149C(struct Sprite *sprite); + const union AnimCmd gUnknown_08596AE0[] = { ANIMCMD_FRAME(32, 1), @@ -118,7 +133,7 @@ const struct SpriteTemplate gBattleAnimSpriteTemplate_8596BA0 = .anims = gDummySpriteAnimTable, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8110E4C, + .callback = AnimDirtParticleAcrossScreen, }; const struct Subsprite gUnknown_08596BB8[] = @@ -194,7 +209,7 @@ const struct SpriteTemplate gUnknown_08596C10 = .anims = gUnknown_08596BF8, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, - .callback = sub_8110F30, + .callback = AnimRaiseSprite, }; const struct SpriteTemplate gUnknown_08596C28 = @@ -278,7 +293,7 @@ const struct SpriteTemplate gUnknown_08596CC8 = .anims = gUnknown_08596C08, .images = NULL, .affineAnims = gUnknown_08596C90, - .callback = sub_80FF268, + .callback = AnimMoveTwisterParticle, }; const struct SpriteTemplate gUnknown_08596CE0 = @@ -291,3 +306,573 @@ const struct SpriteTemplate gUnknown_08596CE0 = .affineAnims = gUnknown_08596C90, .callback = sub_80A8EE4, }; + +void sub_81109F0(struct Sprite *sprite) +{ + if (gBattleAnimArgs[3] != 0) + SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->pos1.x, &sprite->pos1.y); + + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += 14; + + StartSpriteAnim(sprite, gBattleAnimArgs[1]); + AnimateSprite(sprite); + + sprite->data[0] = 0; + sprite->data[1] = 0; + sprite->data[2] = 4; + sprite->data[3] = 16; + sprite->data[4] = -70; + sprite->data[5] = gBattleAnimArgs[2]; + + StoreSpriteCallbackInData6(sprite, sub_8110A70); + sprite->callback = sub_80A6450; + sprite->callback(sprite); +} + +static void sub_8110A70(struct Sprite *sprite) +{ + sprite->pos1.x += sprite->data[5]; + + sprite->data[0] = 192; + sprite->data[1] = sprite->data[5]; + sprite->data[2] = 4; + sprite->data[3] = 32; + sprite->data[4] = -24; + + StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); + sprite->callback = sub_80A6450; + sprite->callback(sprite); +} + +void sub_8110AB4(struct Sprite *sprite) +{ + StartSpriteAnim(sprite, gBattleAnimArgs[5]); + AnimateSprite(sprite); + + if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + sprite->pos1.x -= gBattleAnimArgs[0]; + else + sprite->pos1.x += gBattleAnimArgs[0]; + + sprite->pos1.y += gBattleAnimArgs[1]; + + sprite->data[0] = gBattleAnimArgs[4]; + sprite->data[1] = sprite->pos1.x; + sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2]; + sprite->data[3] = sprite->pos1.y; + sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[3]; + + InitSpriteDataForLinearTranslation(sprite); + sprite->data[3] = 0; + sprite->data[4] = 0; + + sprite->callback = sub_80A656C; + StoreSpriteCallbackInData6(sprite, move_anim_8074EE0); +} + +void sub_8110B38(struct Sprite *sprite) +{ + if (gBattleAnimArgs[6] == 0) + InitAnimSpritePos(sprite, 0); + else + sub_80A6980(sprite, FALSE); + + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[1] = gBattleAnimArgs[2]; + sprite->data[2] = gBattleAnimArgs[4]; + sprite->data[3] = gBattleAnimArgs[5]; + + sprite->callback = sub_8110B80; +} + +static void sub_8110B80(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[1]; + sprite->pos2.y = -(sprite->data[4] >> 8); + sprite->pos2.x = Sin(sprite->data[5], sprite->data[3]); + sprite->data[5] = (sprite->data[5] + sprite->data[2]) & 0xFF; + + if (--sprite->data[0] == -1) + { + DestroyAnimSprite(sprite); + } +} + +void AnimTask_LoadSandstormBackground(u8 taskId) +{ + int var0; + struct UnknownAnimStruct2 unknownStruct; + + var0 = 0; + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 0); + + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); + SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); + + sub_80A6B30(&unknownStruct); + sub_80A6CC0(unknownStruct.bgId, gUnknown_08D8D58C, unknownStruct.tilesOffset); + sub_80A6D60(&unknownStruct, gUnknown_08D8D410, 0); + LoadCompressedPalette(&gBattleAnimSpritePalette_261, unknownStruct.unk8 * 16, 32); + + if (gBattleAnimArgs[0] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + var0 = 1; + + gTasks[taskId].data[0] = var0; + gTasks[taskId].func = sub_8110CB0; +} + +static void sub_8110CB0(u8 taskId) +{ + struct UnknownAnimStruct2 unknownStruct; + + if (gTasks[taskId].data[0] == 0) + gBattle_BG1_X += -6; + else + gBattle_BG1_X += 6; + + gBattle_BG1_Y += -1; + + switch (gTasks[taskId].data[12]) + { + case 0: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]++; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 7) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 1: + if (++gTasks[taskId].data[11] == 101) + { + gTasks[taskId].data[11] = 7; + gTasks[taskId].data[12]++; + } + break; + case 2: + if (++gTasks[taskId].data[10] == 4) + { + gTasks[taskId].data[10] = 0; + gTasks[taskId].data[11]--; + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); + if (gTasks[taskId].data[11] == 0) + { + gTasks[taskId].data[12]++; + gTasks[taskId].data[11] = 0; + } + } + break; + case 3: + sub_80A6B30(&unknownStruct); + sub_80A6C68(unknownStruct.bgId); + gTasks[taskId].data[12]++; + break; + case 4: + if (!IsContest()) + SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); + + gBattle_BG1_X = 0; + gBattle_BG1_Y = 0; + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); + DestroyAnimVisualTask(taskId); + break; + } +} + +// Animates the sprites that fly diagonally across the screen +// in Sandstorm and Heat Wave. +// arg 0: initial y pixel offset +// arg 1: projectile speed +// arg 2: y pixel drop +// arg 3: ??? unknown (possibly a color bit) +void AnimDirtParticleAcrossScreen(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + if (gBattleAnimArgs[3] != 0 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + { + sprite->pos1.x = 304; + gBattleAnimArgs[1] = -gBattleAnimArgs[1]; + sprite->data[5] = 1; + sprite->oam.matrixNum = 8; + } + else + { + sprite->pos1.x = -64; + } + + sprite->pos1.y = gBattleAnimArgs[0]; + SetSubspriteTables(sprite, gUnknown_08596BC0); + sprite->data[1] = gBattleAnimArgs[1]; + sprite->data[2] = gBattleAnimArgs[2]; + sprite->data[0]++; + } + else + { + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + sprite->pos2.x += (sprite->data[3] >> 8); + sprite->pos2.y += (sprite->data[4] >> 8); + sprite->data[3] &= 0xFF; + sprite->data[4] &= 0xFF; + + if (sprite->data[5] == 0) + { + if (sprite->pos1.x + sprite->pos2.x > 272) + { + sprite->callback = DestroyAnimSprite; + } + } + else if (sprite->pos1.x + sprite->pos2.x < -32) + { + sprite->callback = DestroyAnimSprite; + } + } +} + +// Animates the rising rocks in Ancient Power. +// arg 0: initial x pixel offset +// arg 1: initial y pixel offset +// arg 2: terminal y offset +// arg 3: duration +// arg 4: sprite size [1,5] +void AnimRaiseSprite(struct Sprite *sprite) +{ + StartSpriteAnim(sprite, gBattleAnimArgs[4]); + InitAnimSpritePos(sprite, 0); + + sprite->data[0] = gBattleAnimArgs[3]; + sprite->data[2] = sprite->pos1.x; + sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[2]; + + sprite->callback = StartAnimLinearTranslation; + StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); +} + +void sub_8110F74(u8 taskId) +{ + u16 var0, var1, var2, var3; + u8 var4; + int var5; + s16 pan1, pan2; + struct Task *task; + + task = &gTasks[taskId]; + + var0 = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + var1 = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 24; + var2 = GetBattlerSpriteCoord(gBattleAnimTarget, 2); + var3 = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 24; + + if (BATTLE_PARTNER(gBattleAnimAttacker) == gBattleAnimTarget) + var3 = var1; + + var4 = sub_811135C(); + if (var4 == 1) + task->data[8] = 32; + else + task->data[8] = 48 - (var4 * 8); + + task->data[0] = 0; + task->data[11] = 0; + task->data[9] = 0; + task->data[12] = 1; + + var5 = task->data[8]; + if (var5 < 0) + var5 += 7; + + task->data[10] = (var5 >> 3) - 1; + + task->data[2] = var0 * 8; + task->data[3] = var1 * 8; + task->data[4] = ((var2 - var0) * 8) / task->data[8]; + task->data[5] = ((var3 - var1) * 8) / task->data[8]; + task->data[6] = 0; + task->data[7] = 0; + + pan1 = BattleAnimAdjustPanning(-64); + pan2 = BattleAnimAdjustPanning(63); + + task->data[13] = pan1; + task->data[14] = (pan2 - pan1) / task->data[8]; + task->data[1] = var4; + task->data[15] = GetAnimBattlerSpriteId(0); + + task->func = sub_81110A4; +} + +void sub_81110A4(u8 taskId) +{ + struct Task *task; + + task = &gTasks[taskId]; + + switch (task->data[0]) + { + case 0: + task->data[6] -= task->data[4]; + task->data[7] -= task->data[5]; + gSprites[task->data[15]].pos2.x = task->data[6] >> 3; + gSprites[task->data[15]].pos2.y = task->data[7] >> 3; + + if (++task->data[9] == 10) + { + task->data[11] = 20; + task->data[0]++; + } + + PlaySE12WithPanning(SE_W029, task->data[13]); + break; + case 1: + if (--task->data[11] == 0) + task->data[0]++; + break; + case 2: + if (--task->data[9] != 0) + { + task->data[6] += task->data[4]; + task->data[7] += task->data[5]; + } + else + { + task->data[6] = 0; + task->data[7] = 0; + task->data[0]++; + } + + gSprites[task->data[15]].pos2.x = task->data[6] >> 3; + gSprites[task->data[15]].pos2.y = task->data[7] >> 3; + break; + case 3: + task->data[2] += task->data[4]; + task->data[3] += task->data[5]; + if (++task->data[9] >= task->data[10]) + { + task->data[9] = 0; + sub_8111214(task); + task->data[13] += task->data[14]; + PlaySE12WithPanning(SE_W091, task->data[13]); + } + + if (--task->data[8] == 0) + { + task->data[0]++; + } + break; + case 4: + if (task->data[11] == 0) + DestroyAnimVisualTask(taskId); + break; + } +} + +static void sub_8111214(struct Task *task) +{ + const struct SpriteTemplate *spriteTemplate; + int var0; + u16 x, y; + u8 spriteId; + + switch (task->data[1]) + { + case 1: + spriteTemplate = &gUnknown_08596C28; + var0 = 0; + break; + case 2: + case 3: + spriteTemplate = &gUnknown_08596C40; + var0 = 80; + break; + case 4: + spriteTemplate = &gUnknown_08596C40; + var0 = 64; + break; + case 5: + spriteTemplate = &gUnknown_08596C40; + var0 = 48; + break; + default: + return; + } + + x = task->data[2] >> 3; + y = task->data[3] >> 3; + x += (task->data[12] * 4); + + spriteId = CreateSprite(spriteTemplate, x, y, 35); + if (spriteId != 64) + { + gSprites[spriteId].data[0] = 18; + gSprites[spriteId].data[2] = ((task->data[12] * 20) + x) + (task->data[1] * 3); + gSprites[spriteId].data[4] = y; + gSprites[spriteId].data[5] = -16 - (task->data[1] * 2); + gSprites[spriteId].oam.tileNum += var0; + + InitAnimArcTranslation(&gSprites[spriteId]); + task->data[11]++; + } + + task->data[12] *= -1; +} + +void sub_811131C(struct Sprite *sprite) +{ + if (TranslateAnimArc(sprite)) + { + u8 taskId = FindTaskIdByFunc(sub_81110A4); + if (taskId != 0xFF) + gTasks[taskId].data[11]--; + + DestroySprite(sprite); + } +} + +static u8 sub_811135C(void) +{ + u8 retVal = gAnimDisableStructPtr->rolloutTimerStartValue - gAnimDisableStructPtr->rolloutTimer; + u8 var0 = retVal - 1; + if (var0 > 4) + retVal = 1; + + return retVal; +} + +void sub_8111388(struct Sprite *sprite) +{ + StartSpriteAnim(sprite, gBattleAnimArgs[4]); + + sprite->pos2.x = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + sprite->data[3] -= gBattleAnimArgs[2]; + sprite->data[0] = 3; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->callback = sub_81113C8; + sprite->invisible = 1; +} + +static void sub_81113C8(struct Sprite *sprite) +{ + sprite->invisible = 0; + if (sprite->data[3] != 0) + { + sprite->pos2.y = sprite->data[2] + sprite->data[3]; + sprite->data[3] += sprite->data[0]; + sprite->data[0]++; + if (sprite->data[3] > 0) + { + sprite->data[3] = 0; + } + } + else + { + if (--sprite->data[1] == 0) + DestroyAnimSprite(sprite); + } +} + +void sub_8111418(struct Sprite *sprite) +{ + if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) + StartSpriteAffineAnim(sprite, 1); + + TranslateAnimSpriteToTargetMonLocation(sprite); +} + +void sub_8111444(struct Sprite *sprite) +{ + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->pos1.x += gBattleAnimArgs[0]; + sprite->pos1.y += gBattleAnimArgs[1]; + + sprite->data[1] = gBattleAnimArgs[0]; + sprite->data[2] = gBattleAnimArgs[1]; + sprite->data[5] = gBattleAnimArgs[2]; + + StartSpriteAnim(sprite, gBattleAnimArgs[3]); + sprite->callback = sub_811149C; +} + +static void sub_811149C(struct Sprite *sprite) +{ + sprite->data[0] += 8; + sprite->data[3] += sprite->data[1]; + sprite->data[4] += sprite->data[2]; + + sprite->pos2.x += sprite->data[3] / 40; + sprite->pos2.y -= Sin(sprite->data[0], sprite->data[5]); + + if (sprite->data[0] > 140) + DestroyAnimSprite(sprite); +} + +void AnimTask_GetSeismicTossDamageLevel(u8 taskId) +{ + if (gAnimMoveDmg < 33) + gBattleAnimArgs[7] = 0; + if ((u32)gAnimMoveDmg - 33 < 33) + gBattleAnimArgs[7] = 1; + if (gAnimMoveDmg > 65) + gBattleAnimArgs[7] = 2; + + DestroyAnimVisualTask(taskId); +} + +void sub_811152C(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + { + sub_80A6DAC(0); + gTasks[taskId].data[1] = 200; + } + + gBattle_BG3_Y += gTasks[taskId].data[1] / 10; + gTasks[taskId].data[1] -= 3; + + if (gTasks[taskId].data[0] == 120) + { + sub_80A6DAC(1); + DestroyAnimVisualTask(taskId); + } + + gTasks[taskId].data[0]++; +} + +void sub_8111590(u8 taskId) +{ + if (gTasks[taskId].data[0] == 0) + { + sub_80A6DAC(0); + gTasks[taskId].data[0]++; + gTasks[taskId].data[2] = gBattle_BG3_Y; + } + + gTasks[taskId].data[1] += 80; + gTasks[taskId].data[1] &= 0xFF; + gBattle_BG3_Y = gTasks[taskId].data[2] + Cos(4, gTasks[taskId].data[1]); + + if (gBattleAnimArgs[7] == 0xFFF) + { + gBattle_BG3_Y = 0; + sub_80A6DAC(1); + DestroyAnimVisualTask(taskId); + } +}