Misc battle anim documentation

This commit is contained in:
GriffinR 2021-01-23 00:40:46 -05:00
parent a392cca928
commit 3fd5e143a9
10 changed files with 48 additions and 47 deletions

View file

@ -90,7 +90,7 @@ void InitAnimArcTranslation(struct Sprite *sprite);
bool8 AnimTranslateLinear(struct Sprite *sprite);
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite);
u8 GetBattlerSpriteCoord2(u8 battlerId, u8 attributeId);
void sub_80A6FD4(struct Sprite *sprite);
void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite);
u16 ArcTan2Neg(s16 a, s16 b);
void TrySetSpriteRotScale(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation);
void RunStoredCallbackWhenAffineAnimEnds(struct Sprite *sprite);
@ -103,7 +103,7 @@ u8 GetBattlerYCoordWithElevation(u8 battlerId);
void WaitAnimForDuration(struct Sprite *sprite);
void AnimTravelDiagonally(struct Sprite *sprite);
void InitAnimLinearTranslation(struct Sprite *sprite);
void sub_80A6F98(struct Sprite *sprite);
void AnimTranslateLinear_WaitEnd(struct Sprite *sprite);
u8 GetBattlerSpriteBGPriority(u8 battlerId);
void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
@ -121,7 +121,7 @@ void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode);
void SetBattlerSpriteYOffsetFromRotation(u8 spriteId);
u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7);
u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4);
u8 sub_80A77AC(u8 a1);
u8 AnimDummyReturnArg(u8 battler);
s16 CloneBattlerSpriteWithBlend(u8);
void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int);
@ -141,7 +141,7 @@ void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite);
void TranslateMonSpriteLinear(struct Sprite *sprite);
void TranslateSpriteLinear(struct Sprite *sprite);
void AnimSpriteOnMonPos(struct Sprite *sprite);
void sub_80A7000(struct Sprite *sprite);
void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite);
void TranslateSpriteInCircleOverDuration(struct Sprite *sprite);
void SetGreyscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal);
void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds);
@ -158,7 +158,7 @@ u8 GetBattlerSide(u8 battler);
u8 GetBattlerPosition(u8 battler);
u8 GetBattlerAtPosition(u8 position);
void sub_80A64EC(struct Sprite *sprite);
void sub_80A718C(struct Sprite *sprite);
void InitAnimFastLinearTranslationWithSpeedAndPos(struct Sprite *sprite);
enum
{

View file

@ -274,7 +274,7 @@ static void AnimTranslateWebThread(struct Sprite *sprite)
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
}
sub_80A6FD4(sprite);
InitAnimLinearTranslationWithSpeed(sprite);
sprite->data[5] = gBattleAnimArgs[3];
sprite->callback = AnimTranslateWebThread_Step;
}

View file

@ -3074,7 +3074,7 @@ static void AnimPresent(struct Sprite* sprite)
sprite->callback = AnimItemSteal_Step1;
}
static void sub_80FFB90(struct Sprite* sprite)
static void AnimKnockOffOpponentsItem(struct Sprite* sprite)
{
int zero;
sprite->data[0] += ((sprite->data[3] * 128) / sprite->data[4]);
@ -3116,7 +3116,7 @@ static void AnimKnockOffItem(struct Sprite* sprite)
sub_80FF9B8(sprite, 40);
sprite->data[3] = 3;
sprite->data[4] = 60;
sprite->callback = sub_80FFB90;
sprite->callback = AnimKnockOffOpponentsItem;
}
}
@ -3731,7 +3731,7 @@ static void AnimNeedleArmSpike_Step(struct Sprite* sprite)
}
}
static void sub_81009DC(struct Sprite* sprite)
static void AnimWhipHit_WaitEnd(struct Sprite* sprite)
{
if (sprite->animEnded)
DestroyAnimSprite(sprite);
@ -3759,7 +3759,7 @@ static void AnimWhipHit(struct Sprite* sprite)
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
StartSpriteAnim(sprite, 1);
sprite->callback = sub_81009DC;
sprite->callback = AnimWhipHit_WaitEnd;
SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1];
}

View file

@ -1784,7 +1784,7 @@ static void AnimCoinThrow(struct Sprite *sprite)
sprite->data[0] = gBattleAnimArgs[4];
sprite->data[2] = r6;
sprite->data[4] = r7;
sprite->callback = sub_80A7000;
sprite->callback = InitAnimLinearTranslationWithSpeedAndPos;
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
}
@ -2569,7 +2569,7 @@ static void AnimBlendThinRing(struct Sprite *sprite)
sprite->callback(sprite);
}
void sub_8105284(struct Sprite *sprite)
static void AnimHyperVoiceRing_WaitEnd(struct Sprite *sprite)
{
if (AnimTranslateLinear(sprite))
{
@ -2659,7 +2659,7 @@ static void AnimHyperVoiceRing(struct Sprite *sprite)
sprite->data[4] = sp1;
sprite->data[0] = gBattleAnimArgs[0];
InitAnimLinearTranslation(sprite);
sprite->callback = sub_8105284;
sprite->callback = AnimHyperVoiceRing_WaitEnd;
sprite->callback(sprite);
}
@ -3523,7 +3523,7 @@ static void AnimAngel(struct Sprite *sprite)
DestroyAnimSprite(sprite);
}
static void sub_8106A64(struct Sprite *sprite)
static void AnimPinkHeart_Step(struct Sprite *sprite)
{
sprite->data[5]++;
sprite->pos2.x = Sin(sprite->data[3], 5);
@ -3552,7 +3552,7 @@ static void AnimPinkHeart(struct Sprite *sprite)
sprite->data[3] = (sprite->data[3] + 3) & 0xFF;
if (sprite->data[3] > 70)
{
sprite->callback = sub_8106A64;
sprite->callback = AnimPinkHeart_Step;
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
sprite->pos2.x = 0;

View file

@ -835,7 +835,7 @@ static void AnimSuperpowerOrb_Step(struct Sprite *sprite)
InitAnimLinearTranslation(sprite);
StoreSpriteCallbackInData6(sprite, DestroySpriteAndMatrix);
sprite->callback = sub_80A6F98;
sprite->callback = AnimTranslateLinear_WaitEnd;
}
}
@ -931,7 +931,7 @@ static void AnimSuperpowerFireball(struct Sprite *sprite)
InitAnimLinearTranslation(sprite);
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
sprite->callback = sub_80A6F98;
sprite->callback = AnimTranslateLinear_WaitEnd;
}
static void AnimArmThrustHit_Step(struct Sprite *sprite)

View file

@ -1115,7 +1115,7 @@ static void AnimWillOWispOrb(struct Sprite *sprite)
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sub_80A6FD4(sprite);
InitAnimLinearTranslationWithSpeed(sprite);
sprite->callback = AnimWillOWispOrb_Step;
}
break;

View file

@ -225,7 +225,7 @@ static void AnimConfuseRayBallBounce(struct Sprite *sprite)
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
sprite->data[3] = sprite->pos1.y;
sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
sub_80A6FD4(sprite);
InitAnimLinearTranslationWithSpeed(sprite);
sprite->callback = AnimConfuseRayBallBounce_Step1;
sprite->data[6] = 16;
SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL));

View file

@ -710,7 +710,7 @@ static void AnimSwirlingSnowball(struct Sprite *sprite)
for (i = 0; i < 8; i++)
sprite->data[i] = tempDataHolder[i];
sprite->callback = sub_80A718C;
sprite->callback = InitAnimFastLinearTranslationWithSpeedAndPos;
StoreSpriteCallbackInData6(sprite, AnimSwirlingSnowball_Step1);
}
@ -1311,7 +1311,7 @@ static void MovePoisonGasCloud(struct Sprite *sprite)
sprite->data[7]++;
sprite->pos2.x = sprite->pos2.y = 0;
sub_80A6FD4(sprite);
InitAnimLinearTranslationWithSpeed(sprite);
}
break;
case 2:

View file

@ -21,15 +21,15 @@
extern const struct OamData gOamData_AffineNormal_ObjNormal_64x64;
static void sub_80A6FB4(struct Sprite *sprite);
static void sub_80A7144(struct Sprite *sprite);
static void AnimFastTranslateLinearWaitEnd(struct Sprite *sprite);
static void AnimThrowProjectile_Step(struct Sprite *sprite);
static void sub_80A8DFC(struct Sprite *sprite);
static void sub_80A8E88(struct Sprite *sprite);
static void AnimWeatherBallUp_Step(struct Sprite *sprite);
static u16 GetBattlerYDeltaFromSpriteId(u8 spriteId);
static void AnimTask_BlendPalInAndOutSetup(struct Task *task);
static void sub_80A7AFC(u8 taskId);
static void sub_80A8CAC(u8 taskId);
static void AnimTask_BlendMonInAndOutStep(u8 taskId);
static void AnimTask_AlphaFadeIn_Step(u8 taskId);
static void AnimTask_AttackerPunchWithTrace_Step(u8 taskId);
static void AnimTask_BlendMonInAndOut_Step(u8 taskId);
static bool8 sub_80A7238(void);
static void sub_80A8D78(struct Task *task, u8 taskId);
@ -1036,7 +1036,7 @@ void StartAnimLinearTranslation(struct Sprite *sprite)
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
InitAnimLinearTranslation(sprite);
sprite->callback = sub_80A6F98;
sprite->callback = AnimTranslateLinear_WaitEnd;
sprite->callback(sprite);
}
@ -1079,7 +1079,7 @@ bool8 AnimTranslateLinear(struct Sprite *sprite)
return FALSE;
}
void sub_80A6F98(struct Sprite *sprite)
void AnimTranslateLinear_WaitEnd(struct Sprite *sprite)
{
if (AnimTranslateLinear(sprite))
SetCallbackToStoredInData6(sprite);
@ -1092,19 +1092,19 @@ static void sub_80A6FB4(struct Sprite *sprite)
SetCallbackToStoredInData6(sprite);
}
void sub_80A6FD4(struct Sprite *sprite)
void InitAnimLinearTranslationWithSpeed(struct Sprite *sprite)
{
int v1 = abs(sprite->data[2] - sprite->data[1]) << 8;
sprite->data[0] = v1 / sprite->data[0];
InitAnimLinearTranslation(sprite);
}
void sub_80A7000(struct Sprite *sprite)
void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite)
{
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
sub_80A6FD4(sprite);
sprite->callback = sub_80A6F98;
InitAnimLinearTranslationWithSpeed(sprite);
sprite->callback = AnimTranslateLinear_WaitEnd;
sprite->callback(sprite);
}
@ -1141,7 +1141,7 @@ void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite)
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
InitAnimFastLinearTranslation(sprite);
sprite->callback = sub_80A7144;
sprite->callback = AnimFastTranslateLinearWaitEnd;
sprite->callback(sprite);
}
@ -1175,7 +1175,7 @@ bool8 AnimFastTranslateLinear(struct Sprite *sprite)
return FALSE;
}
static void sub_80A7144(struct Sprite *sprite)
static void AnimFastTranslateLinearWaitEnd(struct Sprite *sprite)
{
if (AnimFastTranslateLinear(sprite))
SetCallbackToStoredInData6(sprite);
@ -1188,12 +1188,12 @@ void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite)
InitAnimFastLinearTranslation(sprite);
}
void sub_80A718C(struct Sprite *sprite)
void InitAnimFastLinearTranslationWithSpeedAndPos(struct Sprite *sprite)
{
sprite->data[1] = sprite->pos1.x;
sprite->data[3] = sprite->pos1.y;
InitAnimFastLinearTranslationWithSpeed(sprite);
sprite->callback = sub_80A7144;
sprite->callback = AnimFastTranslateLinearWaitEnd;
sprite->callback(sprite);
}
@ -1442,9 +1442,10 @@ u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4)
return var;
}
u8 sub_80A77AC(u8 a1)
// Presumably something commented here, just returns arg
u8 AnimDummyReturnArg(u8 battler)
{
return a1;
return battler;
}
static u8 GetBattlerAtPosition_(u8 position)
@ -1615,10 +1616,10 @@ void AnimTask_AlphaFadeIn(u8 taskId)
gTasks[taskId].data[7] = gBattleAnimArgs[2];
gTasks[taskId].data[8] = gBattleAnimArgs[3];
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gBattleAnimArgs[0], gBattleAnimArgs[1]));
gTasks[taskId].func = sub_80A7AFC;
gTasks[taskId].func = AnimTask_AlphaFadeIn_Step;
}
static void sub_80A7AFC(u8 taskId)
static void AnimTask_AlphaFadeIn_Step(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -1672,10 +1673,10 @@ static void AnimTask_BlendPalInAndOutSetup(struct Task *task)
task->data[5] = gBattleAnimArgs[3];
task->data[6] = 0;
task->data[7] = gBattleAnimArgs[4];
task->func = AnimTask_BlendMonInAndOutStep;
task->func = AnimTask_BlendMonInAndOut_Step;
}
static void AnimTask_BlendMonInAndOutStep(u8 taskId)
static void AnimTask_BlendMonInAndOut_Step(u8 taskId)
{
struct Task *task = &gTasks[taskId];
@ -2354,10 +2355,10 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId)
task->data[6] = 3;
CpuCopy32(&gPlttBufferUnfaded[src], &gPlttBufferFaded[dest], 0x20);
BlendPalette(dest, 16, gBattleAnimArgs[1], gBattleAnimArgs[0]);
task->func = sub_80A8CAC;
task->func = AnimTask_AttackerPunchWithTrace_Step;
}
static void sub_80A8CAC(u8 taskId)
static void AnimTask_AttackerPunchWithTrace_Step(u8 taskId)
{
struct Task *task = &gTasks[taskId];
switch (task->data[2])
@ -2424,10 +2425,10 @@ void AnimWeatherBallUp(struct Sprite *sprite)
else
sprite->data[0] = -10;
sprite->data[1] = -40;
sprite->callback = sub_80A8E88;
sprite->callback = AnimWeatherBallUp_Step;
}
static void sub_80A8E88(struct Sprite *sprite)
static void AnimWeatherBallUp_Step(struct Sprite *sprite)
{
sprite->data[2] += sprite->data[0];
sprite->data[3] += sprite->data[1];

View file

@ -97,7 +97,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
{
if (battler != animBattlers[0] && battler != animBattlers[1] && IsBattlerSpriteVisible(battler))
selectedPalettes |= 0x10000 << sub_80A77AC(battler);
selectedPalettes |= 0x10000 << AnimDummyReturnArg(battler);
}
StartBlendAnimSpriteColor(taskId, selectedPalettes);