Document some battle anim funcs and data

This commit is contained in:
Marcus Huderle 2021-02-27 11:04:45 -06:00
parent 06ae5a37e2
commit c323e7f061
18 changed files with 228 additions and 241 deletions

View File

@ -854,7 +854,7 @@ Move_TWINEEDLE:
Move_FIRE_BLAST: Move_FIRE_BLAST:
loadspritegfx ANIM_TAG_SMALL_EMBER loadspritegfx ANIM_TAG_SMALL_EMBER
createsoundtask sub_8158B30, SE_M_FLAME_WHEEL, SE_M_FLAME_WHEEL2 createsoundtask SoundTask_FireBlast, SE_M_FLAME_WHEEL, SE_M_FLAME_WHEEL2
call FireBlastRing call FireBlastRing
call FireBlastRing call FireBlastRing
call FireBlastRing call FireBlastRing

View File

@ -108,7 +108,7 @@ u8 GetBattlerSpriteBGPriority(u8 battlerId);
void *LoadPointerFromVars(s16 bottom, s16 top); void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr); void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
void sub_80A8278(void); void sub_80A8278(void);
void sub_80A6B30(struct BattleAnimBgData*); void GetDefaultBattleAnimBgData(struct BattleAnimBgData*);
void sub_80A6B90(struct BattleAnimBgData*, u32 arg1); void sub_80A6B90(struct BattleAnimBgData*, u32 arg1);
u8 GetBattlerSpriteSubpriority(u8 battlerId); u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite);
@ -127,12 +127,12 @@ void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int); u8 sub_80A89C8(int, u8, int);
void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32); void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, u32);
void AnimLoadCompressedBgGfx(u32, const u32*, u32); void AnimLoadCompressedBgGfx(u32, const u32*, u32);
void sub_80A6DAC(bool8); void UpdateAnimBg3ScreenSize(bool8);
void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *); void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *);
void sub_80A653C(struct Sprite *); void sub_80A653C(struct Sprite *);
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId); void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7); void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
u8 sub_80A80C8(struct Task *task); u8 UpdateEruptAnimTask(struct Task *task);
void DestroyAnimSpriteAndDisableBlend(struct Sprite *); void DestroyAnimSpriteAndDisableBlend(struct Sprite *);
void AnimLoadCompressedBgTilemap(u32 bgId, const void *src); void AnimLoadCompressedBgTilemap(u32 bgId, const void *src);
void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite); void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite);
@ -149,7 +149,7 @@ bool8 RunAffineAnimFromTaskData(struct Task *task);
void AnimThrowProjectile(struct Sprite *sprite); void AnimThrowProjectile(struct Sprite *sprite);
void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused); void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm); u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm);
void sub_80A749C(struct Sprite *sprite); void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite);
void TradeMenuBouncePartySprites(struct Sprite *sprite); void TradeMenuBouncePartySprites(struct Sprite *sprite);
void DestroyAnimVisualTaskAndDisableBlend(u8 taskId); void DestroyAnimVisualTaskAndDisableBlend(u8 taskId);
void DestroySpriteAndFreeResources_(struct Sprite *sprite); void DestroySpriteAndFreeResources_(struct Sprite *sprite);

View File

@ -2300,7 +2300,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(28)), 0x1000, 0); RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(28)), 0x1000, 0);
} }
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
CpuFill16(0, animBg.bgTiles, 0x1000); CpuFill16(0, animBg.bgTiles, 0x1000);
CpuFill16(0xFF, animBg.bgTilemap, 0x800); CpuFill16(0xFF, animBg.bgTilemap, 0x800);
@ -2371,7 +2371,7 @@ static void sub_80A46A0(void)
if (IsSpeciesNotUnown(gContestResources->moveAnim->species)) if (IsSpeciesNotUnown(gContestResources->moveAnim->species))
{ {
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
ptr = animBg.bgTilemap; ptr = animBg.bgTilemap;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
@ -2411,7 +2411,7 @@ void sub_80A4720(u16 a, u16 *b, u32 c, u8 d)
void sub_80A477C(bool8 to_BG2) void sub_80A477C(bool8 to_BG2)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
if (!to_BG2 || IsContest()) if (!to_BG2 || IsContest())
{ {
@ -2435,7 +2435,7 @@ static void task_pA_ma0A_obj_to_bg_pal(u8 taskId)
spriteId = gTasks[taskId].data[0]; spriteId = gTasks[taskId].data[0];
palIndex = gTasks[taskId].data[6]; palIndex = gTasks[taskId].data[6];
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
x = gTasks[taskId].data[1] - (gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x); x = gTasks[taskId].data[1] - (gSprites[spriteId].pos1.x + gSprites[spriteId].pos2.x);
y = gTasks[taskId].data[2] - (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y); y = gTasks[taskId].data[2] - (gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y);

View File

@ -423,7 +423,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
task->data[3] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker); task->data[3] = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker);
if (task->data[3] == 1) if (task->data[3] == 1)
{ {
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
task->data[10] = gBattle_BG1_Y; task->data[10] = gBattle_BG1_Y;
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1);
FillPalette(0, animBg.paletteId * 16, 32); FillPalette(0, animBg.paletteId * 16, 32);
@ -564,7 +564,7 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId)
case 1: case 1:
if (task->data[3] == 1) if (task->data[3] == 1)
{ {
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
task->data[10] = gBattle_BG1_Y; task->data[10] = gBattle_BG1_Y;
FillPalette(0, animBg.paletteId * 16, 32); FillPalette(0, animBg.paletteId * 16, 32);
} }
@ -860,7 +860,7 @@ void AnimTask_MetallicShine(u8 taskId)
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
AnimLoadCompressedBgTilemap(animBg.bgId, gMetalShineTilemap); AnimLoadCompressedBgTilemap(animBg.bgId, gMetalShineTilemap);
AnimLoadCompressedBgGfx(animBg.bgId, gMetalShineGfx, animBg.tilesOffset); AnimLoadCompressedBgGfx(animBg.bgId, gMetalShineGfx, animBg.tilesOffset);
LoadCompressedPalette(gMetalShinePalette, animBg.paletteId * 16, 32); LoadCompressedPalette(gMetalShinePalette, animBg.paletteId * 16, 32);
@ -903,7 +903,7 @@ static void AnimTask_MetallicShine_Step(u8 taskId)
SetGreyscaleOrOriginalPalette(paletteNum, TRUE); SetGreyscaleOrOriginalPalette(paletteNum, TRUE);
DestroySprite(&gSprites[gTasks[taskId].data[0]]); DestroySprite(&gSprites[gTasks[taskId].data[0]]);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(animBg.bgId); sub_80A6C68(animBg.bgId);
if (gTasks[taskId].data[6] == 1) if (gTasks[taskId].data[6] == 1)
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++;

View File

@ -13,11 +13,11 @@ static void AnimDragonDanceOrb_Step(struct Sprite *);
static void AnimOverheatFlame(struct Sprite *); static void AnimOverheatFlame(struct Sprite *);
static void AnimOverheatFlame_Step(struct Sprite *); static void AnimOverheatFlame_Step(struct Sprite *);
static void AnimTask_DragonDanceWaver_Step(u8); static void AnimTask_DragonDanceWaver_Step(u8);
static void sub_8113574(struct Task *); static void UpdateDragonDanceScanlineEffect(struct Task *);
EWRAM_DATA static u16 gUnknown_0203A100[7] = {0}; EWRAM_DATA static u16 gUnusedOverheatData[7] = {0};
static const union AnimCmd gUnknown_08596E60[] = static const union AnimCmd sAnim_OutrageOverheatFire_0[] =
{ {
ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(16, 4), ANIMCMD_FRAME(16, 4),
@ -27,9 +27,9 @@ static const union AnimCmd gUnknown_08596E60[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
static const union AnimCmd *const gUnknown_08596E78[] = static const union AnimCmd *const sAnims_OutrageOverheatFire[] =
{ {
gUnknown_08596E60, sAnim_OutrageOverheatFire_0,
}; };
const struct SpriteTemplate gOutrageFlameSpriteTemplate = const struct SpriteTemplate gOutrageFlameSpriteTemplate =
@ -37,7 +37,7 @@ const struct SpriteTemplate gOutrageFlameSpriteTemplate =
.tileTag = ANIM_TAG_SMALL_EMBER, .tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_08596E78, .anims = sAnims_OutrageOverheatFire,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimOutrageFlame, .callback = AnimOutrageFlame,
@ -181,7 +181,7 @@ const struct SpriteTemplate gOverheatFlameSpriteTemplate =
.tileTag = ANIM_TAG_SMALL_EMBER, .tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_08596E78, .anims = sAnims_OutrageOverheatFire,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimOverheatFlame, .callback = AnimOverheatFlame,
@ -212,7 +212,7 @@ static void AnimOutrageFlame(struct Sprite *sprite)
sprite->callback = TranslateSpriteLinearAndFlicker; sprite->callback = TranslateSpriteLinearAndFlicker;
} }
static void sub_8113100(struct Sprite *sprite) static void StartDragonFireTranslation(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
@ -263,7 +263,7 @@ static void AnimDragonFireToTarget(struct Sprite *sprite)
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
StartSpriteAffineAnim(sprite, 1); StartSpriteAffineAnim(sprite, 1);
sub_8113100(sprite); StartDragonFireTranslation(sprite);
} }
static void AnimDragonDanceOrb(struct Sprite *sprite) static void AnimDragonDanceOrb(struct Sprite *sprite)
@ -328,27 +328,27 @@ static void AnimDragonDanceOrb_Step(struct Sprite *sprite)
// Used by Dragon Dance // Used by Dragon Dance
void AnimTask_DragonDanceWaver(u8 taskId) void AnimTask_DragonDanceWaver(u8 taskId)
{ {
struct ScanlineEffectParams sp; struct ScanlineEffectParams scanlineParams;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
u16 i; u16 i;
u8 r1; u8 y;
if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1)
{ {
sp.dmaDest = &REG_BG1HOFS; scanlineParams.dmaDest = &REG_BG1HOFS;
task->data[2] = gBattle_BG1_X; task->data[2] = gBattle_BG1_X;
} }
else else
{ {
sp.dmaDest = &REG_BG2HOFS; scanlineParams.dmaDest = &REG_BG2HOFS;
task->data[2] = gBattle_BG2_X; task->data[2] = gBattle_BG2_X;
} }
sp.dmaControl = 0xA2600001; scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT;
sp.initState = 1; scanlineParams.initState = 1;
sp.unused9 = 0; scanlineParams.unused9 = 0;
r1 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); y = GetBattlerYCoordWithElevation(gBattleAnimAttacker);
task->data[3] = r1 - 32; task->data[3] = y - 32;
task->data[4] = r1 + 32; task->data[4] = y + 32;
if (task->data[3] < 0) if (task->data[3] < 0)
task->data[3] = 0; task->data[3] = 0;
@ -358,7 +358,7 @@ void AnimTask_DragonDanceWaver(u8 taskId)
gScanlineEffectRegBuffers[1][i] = task->data[2]; gScanlineEffectRegBuffers[1][i] = task->data[2];
} }
ScanlineEffect_SetParams(sp); ScanlineEffect_SetParams(scanlineParams);
task->func = AnimTask_DragonDanceWaver_Step; task->func = AnimTask_DragonDanceWaver_Step;
} }
@ -374,12 +374,12 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId)
if (++task->data[6] == 3) if (++task->data[6] == 3)
task->data[0]++; task->data[0]++;
} }
sub_8113574(task); UpdateDragonDanceScanlineEffect(task);
break; break;
case 1: case 1:
if (++task->data[1] > 0x3C) if (++task->data[1] > 0x3C)
task->data[0]++; task->data[0]++;
sub_8113574(task); UpdateDragonDanceScanlineEffect(task);
break; break;
case 2: case 2:
if (++task->data[7] > 1) if (++task->data[7] > 1)
@ -388,7 +388,7 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId)
if (--task->data[6] == 0) if (--task->data[6] == 0)
task->data[0]++; task->data[0]++;
} }
sub_8113574(task); UpdateDragonDanceScanlineEffect(task);
break; break;
case 3: case 3:
gScanlineEffect.state = 3; gScanlineEffect.state = 3;
@ -400,14 +400,14 @@ static void AnimTask_DragonDanceWaver_Step(u8 taskId)
} }
} }
static void sub_8113574(struct Task *task) static void UpdateDragonDanceScanlineEffect(struct Task *task)
{ {
u16 r3 = task->data[5]; u16 sineIndex = task->data[5];
u16 i; u16 i;
for (i = task->data[3]; i <= task->data[4]; i++) for (i = task->data[3]; i <= task->data[4]; i++)
{ {
gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = ((gSineTable[r3] * task->data[6]) >> 7) + task->data[2]; gScanlineEffectRegBuffers[gScanlineEffect.srcBuffer][i] = ((gSineTable[sineIndex] * task->data[6]) >> 7) + task->data[2];
r3 = (r3 + 8) & 0xFF; sineIndex = (sineIndex + 8) & 0xFF;
} }
task->data[5] = (task->data[5] + 9) & 0xFF; task->data[5] = (task->data[5] + 9) & 0xFF;
@ -415,18 +415,18 @@ static void sub_8113574(struct Task *task)
static void AnimOverheatFlame(struct Sprite *sprite) static void AnimOverheatFlame(struct Sprite *sprite)
{ {
int r6 = (gBattleAnimArgs[2] * 3) / 5;
int i; int i;
int yAmplitude = (gBattleAnimArgs[2] * 3) / 5;
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[4]; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[4];
sprite->data[1] = Cos(gBattleAnimArgs[1], gBattleAnimArgs[2]); sprite->data[1] = Cos(gBattleAnimArgs[1], gBattleAnimArgs[2]);
sprite->data[2] = Sin(gBattleAnimArgs[1], r6); sprite->data[2] = Sin(gBattleAnimArgs[1], yAmplitude);
sprite->pos1.x += sprite->data[1] * gBattleAnimArgs[0]; sprite->pos1.x += sprite->data[1] * gBattleAnimArgs[0];
sprite->pos1.y += sprite->data[2] * gBattleAnimArgs[0]; sprite->pos1.y += sprite->data[2] * gBattleAnimArgs[0];
sprite->data[3] = gBattleAnimArgs[3]; sprite->data[3] = gBattleAnimArgs[3];
sprite->callback = AnimOverheatFlame_Step; sprite->callback = AnimOverheatFlame_Step;
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
gUnknown_0203A100[i] = sprite->data[i]; gUnusedOverheatData[i] = sprite->data[i];
} }
static void AnimOverheatFlame_Step(struct Sprite *sprite) static void AnimOverheatFlame_Step(struct Sprite *sprite)

View File

@ -3248,7 +3248,7 @@ void AnimTask_HeartsBackground(u8 taskId)
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
AnimLoadCompressedBgGfx(animBg.bgId, &gBattleAnimBgImage_Attract, animBg.tilesOffset); AnimLoadCompressedBgGfx(animBg.bgId, &gBattleAnimBgImage_Attract, animBg.tilesOffset);
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_Attract, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_Attract, 0);
LoadCompressedPalette(&gBattleAnimBgPalette_Attract, animBg.paletteId * 16, 32); LoadCompressedPalette(&gBattleAnimBgPalette_Attract, animBg.paletteId * 16, 32);
@ -3295,7 +3295,7 @@ static void AnimTask_HeartsBackground_Step(u8 taskId)
} }
break; break;
case 3: case 3:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(animBg.bgId); sub_80A6C68(animBg.bgId);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
break; break;
@ -3326,7 +3326,7 @@ void AnimTask_ScaryFace(u8 taskId)
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
if (IsContest()) if (IsContest())
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_ScaryFaceContest, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimBgTilemap_ScaryFaceContest, 0);
else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT) else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_OPPONENT)
@ -3379,7 +3379,7 @@ static void AnimTask_ScaryFace_Step(u8 taskId)
} }
break; break;
case 3: case 3:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(1); sub_80A6C68(1);
sub_80A6C68(2); sub_80A6C68(2);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;

View File

@ -2387,7 +2387,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
if (!IsContest()) if (!IsContest())
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0);
if (IsContest()) if (IsContest())
{ {
@ -2450,7 +2450,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
} }
break; break;
case 4: case 4:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(animBg.bgId); sub_80A6C68(animBg.bgId);
if (!IsContest()) if (!IsContest())
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0);
@ -2568,7 +2568,7 @@ void AnimTask_DoomDesireLightBeam(u8 taskId)
if (!IsContest()) if (!IsContest())
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0);
if (IsContest()) if (IsContest())
{ {
@ -2639,7 +2639,7 @@ void AnimTask_DoomDesireLightBeam(u8 taskId)
gTasks[taskId].data[0] = 1; gTasks[taskId].data[0] = 1;
break; break;
case 5: case 5:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(animBg.bgId); sub_80A6C68(animBg.bgId);
if (!IsContest()) if (!IsContest())
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0);
@ -3286,7 +3286,7 @@ static void AnimTask_RolePlaySilhouette_Step2(u8 taskId)
TrySetSpriteRotScale(&gSprites[spriteId], TRUE, gTasks[taskId].data[10], gTasks[taskId].data[11], 0); TrySetSpriteRotScale(&gSprites[spriteId], TRUE, gTasks[taskId].data[10], gTasks[taskId].data[11], 0);
if (++gTasks[taskId].data[12] == 9) if (++gTasks[taskId].data[12] == 9)
{ {
sub_80A749C(&gSprites[spriteId]); ResetSpriteRotScale_PreserveAffine(&gSprites[spriteId]);
DestroySpriteAndFreeResources_(&gSprites[spriteId]); DestroySpriteAndFreeResources_(&gSprites[spriteId]);
gTasks[taskId].func = DestroyAnimVisualTaskAndDisableBlend; gTasks[taskId].func = DestroyAnimVisualTaskAndDisableBlend;
} }

View File

@ -7,9 +7,9 @@
static void AnimLightning(struct Sprite *); static void AnimLightning(struct Sprite *);
static void AnimLightning_Step(struct Sprite *); static void AnimLightning_Step(struct Sprite *);
static void sub_810A214(struct Sprite *); static void AnimUnused_0810A214(struct Sprite *);
static void sub_810A258(struct Sprite *); static void AnimUnused_0810A214_Step(struct Sprite *);
static void sub_810A274(struct Sprite *); static void AnimUnused_0810A274(struct Sprite *);
static void AnimSparkElectricity(struct Sprite *); static void AnimSparkElectricity(struct Sprite *);
static void AnimZapCannonSpark(struct Sprite *); static void AnimZapCannonSpark(struct Sprite *);
static void AnimZapCannonSpark_Step(struct Sprite *); static void AnimZapCannonSpark_Step(struct Sprite *);
@ -29,13 +29,13 @@ static void AnimGrowingChargeOrb(struct Sprite *);
static void AnimElectricPuff(struct Sprite *); static void AnimElectricPuff(struct Sprite *);
static void AnimVoltTackleOrbSlide(struct Sprite *); static void AnimVoltTackleOrbSlide(struct Sprite *);
static void AnimVoltTackleOrbSlide_Step(struct Sprite *); static void AnimVoltTackleOrbSlide_Step(struct Sprite *);
static bool8 sub_810B154(struct Task *task, u8 taskId); static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId);
static void AnimVoltTackleBolt(struct Sprite *); static void AnimVoltTackleBolt(struct Sprite *);
static void AnimGrowingShockWaveOrb(struct Sprite *); static void AnimGrowingShockWaveOrb(struct Sprite *);
static bool8 sub_810B430(struct Task *task, u8 taskId); static bool8 CreateShockWaveBoltSprite(struct Task *task, u8 taskId);
static void AnimShockWaveProgressingBolt(struct Sprite *); static void AnimShockWaveProgressingBolt(struct Sprite *);
static bool8 sub_810B614(struct Task *task, u8 taskId); static bool8 CreateShockWaveLightningSprite(struct Task *task, u8 taskId);
static void sub_810B684(struct Sprite *sprite); static void AnimShockWaveLightning(struct Sprite *sprite);
static const union AnimCmd sAnim_Lightning[] = static const union AnimCmd sAnim_Lightning[] =
{ {
@ -63,7 +63,7 @@ const struct SpriteTemplate gLightningSpriteTemplate =
.callback = AnimLightning, .callback = AnimLightning,
}; };
static const union AffineAnimCmd gUnknown_085956D8[] = static const union AffineAnimCmd sAnim_Unused_085956D8[] =
{ {
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 20),
@ -71,24 +71,24 @@ static const union AffineAnimCmd gUnknown_085956D8[] =
AFFINEANIMCMD_END, AFFINEANIMCMD_END,
}; };
static const union AffineAnimCmd *const gUnknown_085956F8[] = static const union AffineAnimCmd *const sAnims_Unused_085956F8[] =
{ {
gUnknown_085956D8, sAnim_Unused_085956D8,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_085956FC = const struct SpriteTemplate gUnusedSpriteTemplate_085956FC =
{ {
.tileTag = ANIM_TAG_HANDS_AND_FEET, .tileTag = ANIM_TAG_HANDS_AND_FEET,
.paletteTag = ANIM_TAG_HANDS_AND_FEET, .paletteTag = ANIM_TAG_HANDS_AND_FEET,
.oam = &gOamData_AffineNormal_ObjNormal_32x32, .oam = &gOamData_AffineNormal_ObjNormal_32x32,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gUnknown_085956F8, .affineAnims = sAnims_Unused_085956F8,
.callback = sub_810A214, .callback = AnimUnused_0810A214,
}; };
static const union AnimCmd gUnknown_08595714[] = static const union AnimCmd sAnim_Unused_08595714[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_FRAME(16, 5), ANIMCMD_FRAME(16, 5),
@ -99,21 +99,21 @@ static const union AnimCmd gUnknown_08595714[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
static const union AnimCmd *const gUnknown_08595730[] = static const union AnimCmd *const sAnims_Unused_08595730[] =
{ {
gUnknown_08595714, sAnim_Unused_08595714,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_08595734 = const struct SpriteTemplate gUnusedSpriteTemplate_08595734 =
{ {
.tileTag = ANIM_TAG_SHOCK, .tileTag = ANIM_TAG_SHOCK,
.paletteTag = ANIM_TAG_SHOCK, .paletteTag = ANIM_TAG_SHOCK,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_08595730, .anims = sAnims_Unused_08595730,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810A274, .callback = AnimUnused_0810A274,
}; };
const struct SpriteTemplate gSparkElectricitySpriteTemplate = const struct SpriteTemplate gSparkElectricitySpriteTemplate =
@ -473,23 +473,23 @@ static void AnimLightning_Step(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
static void sub_810A214(struct Sprite *sprite) static void AnimUnused_0810A214(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
sprite->pos1.x -= gBattleAnimArgs[0]; sprite->pos1.x -= gBattleAnimArgs[0];
else else
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->callback = sub_810A258; sprite->callback = AnimUnused_0810A214_Step;
} }
static void sub_810A258(struct Sprite *sprite) static void AnimUnused_0810A214_Step(struct Sprite *sprite)
{ {
if (sprite->affineAnimEnded) if (sprite->affineAnimEnded)
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
} }
static void sub_810A274(struct Sprite *sprite) static void AnimUnused_0810A274(struct Sprite *sprite)
{ {
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
@ -1076,7 +1076,7 @@ void AnimTask_VoltTackleBolt(u8 taskId)
if (++task->data[2] > 0) if (++task->data[2] > 0)
{ {
task->data[2] = 0; task->data[2] = 0;
if (sub_810B154(task, taskId) || sub_810B154(task, taskId)) if (CreateVoltTackleBolt(task, taskId) || CreateVoltTackleBolt(task, taskId))
task->data[0]++; task->data[0]++;
} }
break; break;
@ -1086,7 +1086,7 @@ void AnimTask_VoltTackleBolt(u8 taskId)
} }
} }
static bool8 sub_810B154(struct Task *task, u8 taskId) static bool8 CreateVoltTackleBolt(struct Task *task, u8 taskId)
{ {
u8 spriteId = CreateSprite(&gVoltTackleBoltSpriteTemplate, task->data[3], task->data[5], 35); u8 spriteId = CreateSprite(&gVoltTackleBoltSpriteTemplate, task->data[3], task->data[5], 35);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
@ -1169,7 +1169,7 @@ void AnimTask_ShockWaveProgressingBolt(u8 taskId)
if (++task->data[1] > 0) if (++task->data[1] > 0)
{ {
task->data[1] = 0; task->data[1] = 0;
if (sub_810B430(task, taskId)) if (CreateShockWaveBoltSprite(task, taskId))
{ {
if (task->data[2] == 5) if (task->data[2] == 5)
task->data[0] = 3; task->data[0] = 3;
@ -1222,7 +1222,7 @@ void AnimTask_ShockWaveProgressingBolt(u8 taskId)
} }
} }
static bool8 sub_810B430(struct Task *task, u8 taskId) static bool8 CreateShockWaveBoltSprite(struct Task *task, u8 taskId)
{ {
u8 spriteId = CreateSprite(&gShockWaveProgressingBoltSpriteTemplate, task->data[6], task->data[7], 35); u8 spriteId = CreateSprite(&gShockWaveProgressingBoltSpriteTemplate, task->data[6], task->data[7], 35);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
@ -1291,7 +1291,7 @@ void AnimTask_ShockWaveLightning(u8 taskId)
if (++task->data[1] > 1) if (++task->data[1] > 1)
{ {
task->data[1] = 0; task->data[1] = 0;
if (sub_810B614(task, taskId)) if (CreateShockWaveLightningSprite(task, taskId))
task->data[0]++; task->data[0]++;
} }
break; break;
@ -1302,13 +1302,13 @@ void AnimTask_ShockWaveLightning(u8 taskId)
} }
} }
bool8 sub_810B614(struct Task *task, u8 taskId) static bool8 CreateShockWaveLightningSprite(struct Task *task, u8 taskId)
{ {
u8 spriteId = CreateSprite(&gLightningSpriteTemplate, task->data[13], task->data[14], task->data[12]); u8 spriteId = CreateSprite(&gLightningSpriteTemplate, task->data[13], task->data[14], task->data[12]);
if (spriteId != MAX_SPRITES) if (spriteId != MAX_SPRITES)
{ {
gSprites[spriteId].callback = sub_810B684; gSprites[spriteId].callback = AnimShockWaveLightning;
gSprites[spriteId].data[6] = taskId; gSprites[spriteId].data[6] = taskId;
gSprites[spriteId].data[7] = 10; gSprites[spriteId].data[7] = 10;
task->data[10]++; task->data[10]++;
@ -1319,7 +1319,7 @@ bool8 sub_810B614(struct Task *task, u8 taskId)
return FALSE; return FALSE;
} }
static void sub_810B684(struct Sprite *sprite) static void AnimShockWaveLightning(struct Sprite *sprite)
{ {
if (sprite->animEnded) if (sprite->animEnded)
{ {

View File

@ -6,7 +6,7 @@
#include "trig.h" #include "trig.h"
#include "constants/rgb.h" #include "constants/rgb.h"
static void unc_080B08A0(struct Sprite *); static void AnimUnused_080B08A0(struct Sprite *);
static void AnimSlideHandOrFootToTarget(struct Sprite *); static void AnimSlideHandOrFootToTarget(struct Sprite *);
static void AnimJumpKick(struct Sprite *); static void AnimJumpKick(struct Sprite *);
static void AnimBasicFistOrFoot(struct Sprite *); static void AnimBasicFistOrFoot(struct Sprite *);
@ -40,7 +40,7 @@ static void AnimSpinningKickOrPunchFinish(struct Sprite *);
extern struct SpriteTemplate gBasicHitSplatSpriteTemplate; extern struct SpriteTemplate gBasicHitSplatSpriteTemplate;
// Unused // Unused
const struct SpriteTemplate gUnknown_08595E14 = const struct SpriteTemplate gUnusedSpriteTemplate_08595E14 =
{ {
.tileTag = ANIM_TAG_HUMANOID_FOOT, .tileTag = ANIM_TAG_HUMANOID_FOOT,
.paletteTag = ANIM_TAG_HUMANOID_FOOT, .paletteTag = ANIM_TAG_HUMANOID_FOOT,
@ -48,7 +48,7 @@ const struct SpriteTemplate gUnknown_08595E14 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = unc_080B08A0, .callback = AnimUnused_080B08A0,
}; };
static const union AnimCmd sAnim_HandOrFoot[] = static const union AnimCmd sAnim_HandOrFoot[] =
@ -417,7 +417,7 @@ const struct SpriteTemplate gFocusPunchFistSpriteTemplate =
.callback = AnimFocusPunchFist, .callback = AnimFocusPunchFist,
}; };
static void unc_080B08A0(struct Sprite *sprite) static void AnimUnused_080B08A0(struct Sprite *sprite)
{ {
SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]); SetAnimSpriteInitialXOffset(sprite, gBattleAnimArgs[0]);
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -1008,7 +1008,7 @@ void AnimTask_MoveSkyUppercutBg(u8 taskId)
switch (task->data[0]) switch (task->data[0])
{ {
case 0: case 0:
sub_80A6DAC(0); UpdateAnimBg3ScreenSize(FALSE);
task->data[8] = gBattleAnimArgs[0]; task->data[8] = gBattleAnimArgs[0];
task->data[0]++; task->data[0]++;
break; break;
@ -1037,7 +1037,7 @@ void AnimTask_MoveSkyUppercutBg(u8 taskId)
{ {
gBattle_BG3_X = 0; gBattle_BG3_X = 0;
gBattle_BG3_Y = 0; gBattle_BG3_Y = 0;
sub_80A6DAC(1); UpdateAnimBg3ScreenSize(TRUE);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
} }

View File

@ -11,9 +11,9 @@ static void AnimFireSpiralInward(struct Sprite *);
static void AnimFireSpread(struct Sprite *); static void AnimFireSpread(struct Sprite *);
static void AnimFirePlume(struct Sprite *); static void AnimFirePlume(struct Sprite *);
static void AnimLargeFlame(struct Sprite *); static void AnimLargeFlame(struct Sprite *);
static void sub_8109028(struct Sprite *); static void AnimLargeFlame_Step(struct Sprite *);
static void sub_8109064(struct Sprite *); static void AnimUnused_8109064(struct Sprite *);
static void sub_81090D8(struct Sprite *); static void AnimUnused_8109064_Step(struct Sprite *);
static void AnimSunlight(struct Sprite *); static void AnimSunlight(struct Sprite *);
static void AnimEmberFlare(struct Sprite *); static void AnimEmberFlare(struct Sprite *);
static void AnimBurnFlame(struct Sprite *); static void AnimBurnFlame(struct Sprite *);
@ -162,7 +162,7 @@ const struct SpriteTemplate gFirePlumeSpriteTemplate =
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_08595440 = const struct SpriteTemplate gUnusedSpriteTemplate_08595440 =
{ {
.tileTag = ANIM_TAG_SMALL_EMBER, .tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER,
@ -173,7 +173,7 @@ const struct SpriteTemplate gUnknown_08595440 =
.callback = AnimFirePlume, .callback = AnimFirePlume,
}; };
static const union AnimCmd gUnknown_08595458[] = static const union AnimCmd sAnim_Unused_08595458[] =
{ {
ANIMCMD_FRAME(16, 6), ANIMCMD_FRAME(16, 6),
ANIMCMD_FRAME(32, 6), ANIMCMD_FRAME(32, 6),
@ -181,21 +181,21 @@ static const union AnimCmd gUnknown_08595458[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
static const union AnimCmd *const gUnknown_08595468[] = static const union AnimCmd *const sAnims_Unused_08595468[] =
{ {
gUnknown_08595458, sAnim_Unused_08595458,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_0859546C = const struct SpriteTemplate gUnusedSpriteTemplate_0859546C =
{ {
.tileTag = ANIM_TAG_SMALL_EMBER, .tileTag = ANIM_TAG_SMALL_EMBER,
.paletteTag = ANIM_TAG_SMALL_EMBER, .paletteTag = ANIM_TAG_SMALL_EMBER,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_08595468, .anims = sAnims_Unused_08595468,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8109064, .callback = AnimUnused_8109064,
}; };
static const union AffineAnimCmd sAffineAnim_SunlightRay[] = static const union AffineAnimCmd sAffineAnim_SunlightRay[] =
@ -292,23 +292,23 @@ static const union AnimCmd *const sAnims_FireBlastCross[] =
sAnim_FireBlastCross, sAnim_FireBlastCross,
}; };
static const union AffineAnimCmd gUnknown_08595544[] = static const union AffineAnimCmd sAnim_Unused_08595544[] =
{ {
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1), AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 1),
AFFINEANIMCMD_END, AFFINEANIMCMD_END,
}; };
static const union AffineAnimCmd gUnknown_08595554[] = static const union AffineAnimCmd sAnim_Unused_08595554[] =
{ {
AFFINEANIMCMD_FRAME(0xA0, 0xA0, 0, 0), AFFINEANIMCMD_FRAME(0xA0, 0xA0, 0, 0),
AFFINEANIMCMD_END, AFFINEANIMCMD_END,
}; };
// Unused // Unused
static const union AffineAnimCmd *const gUnknown_08595564[] = static const union AffineAnimCmd *const sAnims_Unused_08595564[] =
{ {
gUnknown_08595544, sAnim_Unused_08595544,
gUnknown_08595554, sAnim_Unused_08595554,
}; };
const struct SpriteTemplate gFireBlastCrossSpriteTemplate = const struct SpriteTemplate gFireBlastCrossSpriteTemplate =
@ -511,7 +511,7 @@ static void AnimFirePlume(struct Sprite *sprite)
sprite->data[4] = gBattleAnimArgs[3]; sprite->data[4] = gBattleAnimArgs[3];
sprite->data[3] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8109028; sprite->callback = AnimLargeFlame_Step;
} }
static void AnimLargeFlame(struct Sprite *sprite) static void AnimLargeFlame(struct Sprite *sprite)
@ -533,10 +533,10 @@ static void AnimLargeFlame(struct Sprite *sprite)
sprite->data[4] = gBattleAnimArgs[3]; sprite->data[4] = gBattleAnimArgs[3];
sprite->data[3] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[5];
sprite->callback = sub_8109028; sprite->callback = AnimLargeFlame_Step;
} }
static void sub_8109028(struct Sprite *sprite) static void AnimLargeFlame_Step(struct Sprite *sprite)
{ {
if (++sprite->data[0] < sprite->data[4]) if (++sprite->data[0] < sprite->data[4])
{ {
@ -548,7 +548,7 @@ static void sub_8109028(struct Sprite *sprite)
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
} }
static void sub_8109064(struct Sprite *sprite) static void AnimUnused_8109064(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
@ -570,10 +570,10 @@ static void sub_8109064(struct Sprite *sprite)
sprite->data[4] = gBattleAnimArgs[6]; sprite->data[4] = gBattleAnimArgs[6];
sprite->data[5] = 0; sprite->data[5] = 0;
sprite->callback = sub_81090D8; sprite->callback = AnimUnused_8109064_Step;
} }
static void sub_81090D8(struct Sprite *sprite) static void AnimUnused_8109064_Step(struct Sprite *sprite)
{ {
if (sprite->data[3]) if (sprite->data[3])
{ {
@ -611,8 +611,6 @@ static void AnimSunlight(struct Sprite *sprite)
StoreSpriteCallbackInData6(sprite, DestroyAnimSprite); StoreSpriteCallbackInData6(sprite, DestroyAnimSprite);
} }
//fire 2
// Animates the secondary effect of MOVE_EMBER, where the flames grow and slide // Animates the secondary effect of MOVE_EMBER, where the flames grow and slide
// horizontally a bit. // horizontally a bit.
// arg 0: initial x pixel offset // arg 0: initial x pixel offset
@ -792,15 +790,14 @@ void AnimTask_EruptionLaunchRocks(u8 taskId)
task->func = AnimTask_EruptionLaunchRocks_Step; task->func = AnimTask_EruptionLaunchRocks_Step;
} }
static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTION? static void AnimTask_EruptionLaunchRocks_Step(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
switch (task->data[0]) switch (task->data[0])
{ {
case 0: case 0:
sub_80A805C(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 0x20); PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32);
task->data[0]++; task->data[0]++;
case 1: case 1:
if (++task->data[1] > 1) if (++task->data[1] > 1)
@ -813,7 +810,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
gSprites[task->data[15]].pos2.x = -3; gSprites[task->data[15]].pos2.x = -3;
} }
if (task->data[5]) if (task->data[5] != B_SIDE_PLAYER)
{ {
if (++task->data[3] > 4) if (++task->data[3] > 4)
{ {
@ -822,7 +819,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
} }
} }
if(!sub_80A80C8(task)) if(!UpdateEruptAnimTask(task))
{ {
SetBattlerSpriteYOffsetFromYScale(task->data[15]); SetBattlerSpriteYOffsetFromYScale(task->data[15]);
gSprites[task->data[15]].pos2.x = 0; gSprites[task->data[15]].pos2.x = 0;
@ -836,20 +833,19 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
case 2: case 2:
if (++task->data[1] > 4) if (++task->data[1] > 4)
{ {
if (task->data[5]) if (task->data[5] != B_SIDE_PLAYER)
sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 0x6); PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 6);
else else
sub_80A805C(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 0x6); PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 6);
task->data[1] = 0; task->data[1] = 0;
task->data[0]++; task->data[0]++;
} }
break; break;
case 3: case 3:
if (!sub_80A80C8(task)) if (!UpdateEruptAnimTask(task))
{ {
CreateEruptionLaunchRocks(task->data[15], taskId, 6); CreateEruptionLaunchRocks(task->data[15], taskId, 6);
task->data[0]++; task->data[0]++;
} }
break; break;
@ -866,10 +862,10 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
if (++task->data[3] > 0x18) if (++task->data[3] > 0x18)
{ {
if (task->data[5]) if (task->data[5] != B_SIDE_PLAYER)
sub_80A805C(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 0x8); PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 8);
else else
sub_80A805C(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 0x8); PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 8);
if (task->data[2] & 1) if (task->data[2] & 1)
gSprites[task->data[15]].pos2.y -= 3; gSprites[task->data[15]].pos2.y -= 3;
@ -881,14 +877,13 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
} }
break; break;
case 5: case 5:
if (task->data[5]) if (task->data[5] != B_SIDE_PLAYER)
gSprites[task->data[15]].pos1.y--; gSprites[task->data[15]].pos1.y--;
if (!sub_80A80C8(task)) if (!UpdateEruptAnimTask(task))
{ {
gSprites[task->data[15]].pos1.y = task->data[4]; gSprites[task->data[15]].pos1.y = task->data[4];
ResetSpriteRotScale(task->data[15]); ResetSpriteRotScale(task->data[15]);
task->data[2] = 0; task->data[2] = 0;
task->data[0]++; task->data[0]++;
} }
@ -896,7 +891,6 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId) // animate Move_ERUPTIO
case 6: case 6:
if (!task->data[6]) if (!task->data[6])
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
break; break;
default: default:
break; break;
@ -955,16 +949,12 @@ static void AnimEruptionLaunchRock(struct Sprite *sprite)
static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId) static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId)
{ {
u16 y = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY; s16 y = gSprites[spriteId].pos1.y + gSprites[spriteId].pos2.y + gSprites[spriteId].centerToCornerVecY;
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
{ y += 74;
y = ((y << 16) + 0x4A0000) >> 16;
}
else else
{ y += 44;
y = ((y << 16) + 0x2C0000) >> 16;
}
return y; return y;
} }
@ -1282,14 +1272,14 @@ static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId)
} }
} }
// Used to add a color mask to the battle interface / HUD in Heat Wave. // Used to add a color mask to the battle background.
// arg 0: opacity // arg 0: opacity
// arg 1: color code // arg 1: color code
void AnimTask_BlendBackground(u8 taskId) void AnimTask_BlendBackground(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]); // u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }

View File

@ -18,9 +18,9 @@ static void AnimFlyBallUp_Step(struct Sprite *);
static void AnimFlyBallAttack(struct Sprite *); static void AnimFlyBallAttack(struct Sprite *);
static void AnimFlyBallAttack_Step(struct Sprite *); static void AnimFlyBallAttack_Step(struct Sprite *);
static void AnimFallingFeather(struct Sprite *); static void AnimFallingFeather(struct Sprite *);
static void sub_810E520(struct Sprite *); static void AnimFallingFeather_Step(struct Sprite *);
static void sub_810EB40(struct Sprite *); static void AnimWhirlwindLine_Step(struct Sprite *);
static void sub_810EA4C(struct Sprite *); static void AnimUnused_810EA4C(struct Sprite *);
static void AnimWhirlwindLine(struct Sprite *); static void AnimWhirlwindLine(struct Sprite *);
static void AnimBounceBallShrink(struct Sprite *); static void AnimBounceBallShrink(struct Sprite *);
static void AnimBounceBallLand(struct Sprite *); static void AnimBounceBallLand(struct Sprite *);
@ -30,8 +30,8 @@ static void AnimDiveBall_Step2(struct Sprite *);
static void AnimDiveWaterSplash(struct Sprite *); static void AnimDiveWaterSplash(struct Sprite *);
static void AnimSprayWaterDroplet(struct Sprite *); static void AnimSprayWaterDroplet(struct Sprite *);
static void AnimSprayWaterDroplet_Step(struct Sprite *); static void AnimSprayWaterDroplet_Step(struct Sprite *);
static void sub_810F004(struct Sprite *); static void AnimUnused_810F004(struct Sprite *);
static void sub_810F018(struct Sprite *); static void AnimUnused_810F004_Step(struct Sprite *);
static void AnimSkyAttackBird(struct Sprite *); static void AnimSkyAttackBird(struct Sprite *);
static void AnimSkyAttackBird_Step(struct Sprite *); static void AnimSkyAttackBird_Step(struct Sprite *);
static void AnimTask_AnimateGustTornadoPalette_Step(u8); static void AnimTask_AnimateGustTornadoPalette_Step(u8);
@ -179,7 +179,8 @@ const struct SpriteTemplate gFallingFeatherSpriteTemplate =
.callback = AnimFallingFeather, .callback = AnimFallingFeather,
}; };
const struct SpriteTemplate gUnknown_085963A0 = // Unused
const struct SpriteTemplate gUnusedSpriteTemplate_085963A0 =
{ {
.tileTag = ANIM_TAG_SMALL_BUBBLES, .tileTag = ANIM_TAG_SMALL_BUBBLES,
.paletteTag = ANIM_TAG_SMALL_BUBBLES, .paletteTag = ANIM_TAG_SMALL_BUBBLES,
@ -187,7 +188,7 @@ const struct SpriteTemplate gUnknown_085963A0 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810EA4C, .callback = AnimUnused_810EA4C,
}; };
static const union AnimCmd sAnim_WhirlwindLines[] = static const union AnimCmd sAnim_WhirlwindLines[] =
@ -289,7 +290,7 @@ const struct SpriteTemplate gDiveBallSpriteTemplate =
.callback = AnimDiveBall, .callback = AnimDiveBall,
}; };
static const union AffineAnimCmd gUnknown_085964A8[] = static const union AffineAnimCmd sAnim_Unused_085964A8[] =
{ {
AFFINEANIMCMD_FRAME(0x100, 0x0, 0, 0), AFFINEANIMCMD_FRAME(0x100, 0x0, 0, 0),
AFFINEANIMCMD_FRAME(0x0, 0x20, 0, 12), AFFINEANIMCMD_FRAME(0x0, 0x20, 0, 12),
@ -298,9 +299,9 @@ static const union AffineAnimCmd gUnknown_085964A8[] =
}; };
// Unused // Unused
static const union AffineAnimCmd *const gUnknown_085964C8[] = static const union AffineAnimCmd *const sAnims_Unused_085964C8[] =
{ {
gUnknown_085964A8, sAnim_Unused_085964A8,
}; };
const struct SpriteTemplate gDiveWaterSplashSpriteTemplate = const struct SpriteTemplate gDiveWaterSplashSpriteTemplate =
@ -325,7 +326,8 @@ const struct SpriteTemplate gSprayWaterDropletSpriteTemplate =
.callback = AnimSprayWaterDroplet, .callback = AnimSprayWaterDroplet,
}; };
const struct SpriteTemplate gUnknown_085964FC = // Unused
const struct SpriteTemplate gUnusedSpriteTemplate_085964FC =
{ {
.tileTag = ANIM_TAG_CIRCLE_OF_LIGHT, .tileTag = ANIM_TAG_CIRCLE_OF_LIGHT,
.paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT, .paletteTag = ANIM_TAG_CIRCLE_OF_LIGHT,
@ -333,7 +335,7 @@ const struct SpriteTemplate gUnknown_085964FC =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810F004, .callback = AnimUnused_810F004,
}; };
const struct SpriteTemplate gSkyAttackBirdSpriteTemplate = const struct SpriteTemplate gSkyAttackBirdSpriteTemplate =
@ -639,10 +641,10 @@ static void AnimFallingFeather(struct Sprite *sprite)
gOamMatrices[matrixNum].b = spriteCoord; gOamMatrices[matrixNum].b = spriteCoord;
gOamMatrices[matrixNum].c = -spriteCoord; gOamMatrices[matrixNum].c = -spriteCoord;
sprite->callback = sub_810E520; sprite->callback = AnimFallingFeather_Step;
} }
static void sub_810E520(struct Sprite *sprite) static void AnimFallingFeather_Step(struct Sprite *sprite)
{ {
u8 matrixNum, sinIndex; u8 matrixNum, sinIndex;
s16 sinVal = 0; s16 sinVal = 0;
@ -890,7 +892,7 @@ static void sub_810E520(struct Sprite *sprite)
} }
} }
static void sub_810EA4C(struct Sprite *sprite) static void AnimUnused_810EA4C(struct Sprite *sprite)
{ {
sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget);
sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
@ -900,7 +902,7 @@ static void sub_810EA4C(struct Sprite *sprite)
static void AnimWhirlwindLine(struct Sprite * sprite) static void AnimWhirlwindLine(struct Sprite * sprite)
{ {
u16 arg; u16 offset;
u8 mult; u8 mult;
if (gBattleAnimArgs[2] == ANIM_ATTACKER) if (gBattleAnimArgs[2] == ANIM_ATTACKER)
@ -918,15 +920,15 @@ static void AnimWhirlwindLine(struct Sprite * sprite)
sprite->pos1.x -= 32; sprite->pos1.x -= 32;
sprite->data[1] = 0x0ccc; sprite->data[1] = 0x0ccc;
arg = gBattleAnimArgs[4]; offset = gBattleAnimArgs[4];
mult = 12; mult = 12;
sprite->pos2.x += mult * arg; sprite->pos2.x += mult * offset;
sprite->data[0] = arg; sprite->data[0] = offset;
sprite->data[7] = gBattleAnimArgs[3]; sprite->data[7] = gBattleAnimArgs[3];
sprite->callback = sub_810EB40; sprite->callback = AnimWhirlwindLine_Step;
} }
static void sub_810EB40(struct Sprite *sprite) static void AnimWhirlwindLine_Step(struct Sprite *sprite)
{ {
sprite->pos2.x += sprite->data[1] >> 8; sprite->pos2.x += sprite->data[1] >> 8;
@ -1063,9 +1065,9 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1);
} }
sprite->data[1] = 512; sprite->data[1] = 0x200;
TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
sprite->data[0]++; sprite->data[0]++;
break; break;
case 1: case 1:
@ -1076,11 +1078,11 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
sprite->data[2]++; sprite->data[2]++;
TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
matrixNum = sprite->oam.matrixNum; matrixNum = sprite->oam.matrixNum;
t1 = 15616; t1 = 0x3D00;
t2 = t1 / gOamMatrices[matrixNum].d + 1; t2 = t1 / gOamMatrices[matrixNum].d + 1;
if (t2 > 128) if (t2 > 128)
@ -1091,7 +1093,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
if (sprite->data[2] == 24) if (sprite->data[2] == 24)
{ {
sub_80A749C(sprite); ResetSpriteRotScale_PreserveAffine(sprite);
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
break; break;
@ -1156,14 +1158,14 @@ static void AnimSprayWaterDroplet_Step(struct Sprite *sprite)
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
static void sub_810F004(struct Sprite *sprite) static void AnimUnused_810F004(struct Sprite *sprite)
{ {
sprite->data[6] = 0; sprite->data[6] = 0;
sprite->data[7] = 64; sprite->data[7] = 64;
sprite->callback = sub_810F018; sprite->callback = AnimUnused_810F004_Step;
} }
static void sub_810F018(struct Sprite *sprite) static void AnimUnused_810F004_Step(struct Sprite *sprite)
{ {
switch (sprite->data[0]) switch (sprite->data[0])
{ {
@ -1218,7 +1220,7 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
DestroySpriteAndMatrix(sprite); DestroySpriteAndMatrix(sprite);
} }
void unref_sub_810F184(u8 taskId) void AnimTask_Unused_810F184(u8 taskId)
{ {
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {

View File

@ -998,7 +998,7 @@ void AnimTask_HazeScrollingFog(u8 taskId)
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset); LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset);
AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0);
LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32); LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32);
@ -1052,7 +1052,7 @@ static void AnimTask_Haze2(u8 taskId)
} }
break; break;
case 3: case 3:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(1); sub_80A6C68(1);
sub_80A6C68(2); sub_80A6C68(2);
@ -1105,7 +1105,7 @@ void AnimTask_LoadMistTiles(u8 taskId)
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset); LoadBgTiles(animBg.bgId, gWeatherFogHorizontalTiles, 0x800, animBg.tilesOffset);
AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimFogTilemap, 0);
LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32); LoadPalette(&gUnknown_083970E8, animBg.paletteId * 16, 32);
@ -1154,7 +1154,7 @@ static void AnimTask_OverlayFogTiles(u8 taskId)
} }
break; break;
case 3: case 3:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(1); sub_80A6C68(1);
sub_80A6C68(2); sub_80A6C68(2);

View File

@ -849,25 +849,25 @@ bool8 IsDoubleBattle(void)
return IS_DOUBLE_BATTLE(); return IS_DOUBLE_BATTLE();
} }
void sub_80A6B30(struct BattleAnimBgData *unk) void GetDefaultBattleAnimBgData(struct BattleAnimBgData *out)
{ {
if (IsContest()) if (IsContest())
{ {
unk->bgTiles = gUnknown_0202305C; out->bgTiles = gUnknown_0202305C;
unk->bgTilemap = (u16 *)gUnknown_02023060; out->bgTilemap = (u16 *)gUnknown_02023060;
unk->paletteId = 14; out->paletteId = 14;
unk->bgId = 1; out->bgId = 1;
unk->tilesOffset = 0; out->tilesOffset = 0;
unk->unused = 0; out->unused = 0;
} }
else else
{ {
unk->bgTiles = gUnknown_0202305C; out->bgTiles = gUnknown_0202305C;
unk->bgTilemap = (u16 *)gUnknown_02023060; out->bgTilemap = (u16 *)gUnknown_02023060;
unk->paletteId = 8; out->paletteId = 8;
unk->bgId = 1; out->bgId = 1;
unk->tilesOffset = 0x200; out->tilesOffset = 0x200;
unk->unused = 0; out->unused = 0;
} }
} }
@ -884,7 +884,7 @@ void sub_80A6B90(struct BattleAnimBgData *unk, u32 arg1)
} }
else if (arg1 == 1) else if (arg1 == 1)
{ {
sub_80A6B30(unk); GetDefaultBattleAnimBgData(unk);
} }
else else
{ {
@ -970,9 +970,9 @@ u8 GetBattleBgPaletteNum(void)
return 2; return 2;
} }
void sub_80A6DAC(bool8 arg0) void UpdateAnimBg3ScreenSize(bool8 largeScreenSize)
{ {
if (!arg0 || IsContest()) if (!largeScreenSize || IsContest())
{ {
SetAnimBgAttribute(3, BG_ANIM_SCREEN_SIZE, 0); SetAnimBgAttribute(3, BG_ANIM_SCREEN_SIZE, 0);
SetAnimBgAttribute(3, BG_ANIM_AREA_OVERFLOW_MODE, 1); SetAnimBgAttribute(3, BG_ANIM_AREA_OVERFLOW_MODE, 1);
@ -1292,7 +1292,7 @@ void TrySetSpriteRotScale(struct Sprite *sprite, bool8 recalcCenterVector, s16 x
} }
} }
void sub_80A749C(struct Sprite *sprite) void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite)
{ {
TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, 0); TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, 0);
sprite->affineAnimPaused = FALSE; sprite->affineAnimPaused = FALSE;
@ -1896,19 +1896,19 @@ void *LoadPointerFromVars(s16 lo, s16 hi)
return (void *)((u16)lo | ((u16)hi << 16)); return (void *)((u16)lo | ((u16)hi << 16));
} }
void sub_80A805C(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7) void PrepareEruptAnimTaskData(struct Task *task, u8 spriteId, s16 xScaleStart, s16 yScaleStart, s16 xScaleEnd, s16 yScaleEnd, u16 duration)
{ {
task->data[8] = a7; task->data[8] = duration;
task->data[15] = a2; // spriteId task->data[15] = spriteId;
task->data[9] = a3; task->data[9] = xScaleStart;
task->data[10] = a4; task->data[10] = yScaleStart;
task->data[13] = a5; task->data[13] = xScaleEnd;
task->data[14] = a6; task->data[14] = yScaleEnd;
task->data[11] = (a5 - a3) / a7; task->data[11] = (xScaleEnd - xScaleStart) / duration;
task->data[12] = (a6 - a4) / a7; task->data[12] = (yScaleEnd - yScaleStart) / duration;
} }
u8 sub_80A80C8(struct Task *task) u8 UpdateEruptAnimTask(struct Task *task)
{ {
if (!task->data[8]) if (!task->data[8])
return 0; return 0;

View File

@ -411,7 +411,7 @@ void AnimTask_LoadSandstormBackground(u8 taskId)
SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X);
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Sandstorm, animBg.tilesOffset); AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Sandstorm, animBg.tilesOffset);
AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Sandstorm, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Sandstorm, 0);
LoadCompressedPalette(gBattleAnimSpritePal_FlyingDirt, animBg.paletteId * 16, 32); LoadCompressedPalette(gBattleAnimSpritePal_FlyingDirt, animBg.paletteId * 16, 32);
@ -470,7 +470,7 @@ static void AnimTask_LoadSandstormBackground_Step(u8 taskId)
} }
break; break;
case 3: case 3:
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
sub_80A6C68(animBg.bgId); sub_80A6C68(animBg.bgId);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
break; break;
@ -833,7 +833,7 @@ void AnimTask_MoveSeismicTossBg(u8 taskId)
{ {
if (gTasks[taskId].data[0] == 0) if (gTasks[taskId].data[0] == 0)
{ {
sub_80A6DAC(FALSE); UpdateAnimBg3ScreenSize(FALSE);
gTasks[taskId].data[1] = 200; gTasks[taskId].data[1] = 200;
} }
@ -842,7 +842,7 @@ void AnimTask_MoveSeismicTossBg(u8 taskId)
if (gTasks[taskId].data[0] == 120) if (gTasks[taskId].data[0] == 120)
{ {
sub_80A6DAC(TRUE); UpdateAnimBg3ScreenSize(TRUE);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
@ -853,7 +853,7 @@ void AnimTask_SeismicTossBgAccelerateDownAtEnd(u8 taskId)
{ {
if (gTasks[taskId].data[0] == 0) if (gTasks[taskId].data[0] == 0)
{ {
sub_80A6DAC(FALSE); UpdateAnimBg3ScreenSize(FALSE);
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
gTasks[taskId].data[2] = gBattle_BG3_Y; gTasks[taskId].data[2] = gBattle_BG3_Y;
} }
@ -865,7 +865,7 @@ void AnimTask_SeismicTossBgAccelerateDownAtEnd(u8 taskId)
if (gBattleAnimArgs[7] == 0xFFF) if (gBattleAnimArgs[7] == 0xFFF)
{ {
gBattle_BG3_Y = 0; gBattle_BG3_Y = 0;
sub_80A6DAC(TRUE); UpdateAnimBg3ScreenSize(TRUE);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
} }

View File

@ -6,16 +6,21 @@
#include "task.h" #include "task.h"
#include "constants/battle_anim.h" #include "constants/battle_anim.h"
// this file's functions static void SoundTask_FireBlast_Step1(u8 taskId);
static void sub_8158B98(u8 taskId); static void SoundTask_FireBlast_Step2(u8 taskId);
static void sub_8158C04(u8 taskId);
static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId); static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId);
static void SoundTask_PlayDoubleCry_Step(u8 taskId); static void SoundTask_PlayDoubleCry_Step(u8 taskId);
static void SoundTask_PlayCryWithEcho_Step(u8 taskId); static void SoundTask_PlayCryWithEcho_Step(u8 taskId);
static void SoundTask_AdjustPanningVar_Step(u8 taskId); static void SoundTask_AdjustPanningVar_Step(u8 taskId);
// task start // Loops the specified sound effect and pans from the
void sub_8158B30(u8 taskId) // attacker to the target. The second specified sound effect
// is played at the very end. This task is effectively
// hardcoded to the move FIRE_BLAST due to the baked-in
// durations.
// arg 0: looped sound effect
// arg 1: ending sound effect
void SoundTask_FireBlast(u8 taskId)
{ {
s8 pan1, pan2, panIncrement; s8 pan1, pan2, panIncrement;
@ -31,10 +36,10 @@ void sub_8158B30(u8 taskId)
gTasks[taskId].data[4] = panIncrement; gTasks[taskId].data[4] = panIncrement;
gTasks[taskId].data[10] = 10; gTasks[taskId].data[10] = 10;
gTasks[taskId].func = sub_8158B98; gTasks[taskId].func = SoundTask_FireBlast_Step1;
} }
static void sub_8158B98(u8 taskId) static void SoundTask_FireBlast_Step1(u8 taskId)
{ {
s16 pan = gTasks[taskId].data[2]; s16 pan = gTasks[taskId].data[2];
s8 panIncrement = gTasks[taskId].data[4]; s8 panIncrement = gTasks[taskId].data[4];
@ -42,7 +47,7 @@ static void sub_8158B98(u8 taskId)
{ {
gTasks[taskId].data[10] = 5; gTasks[taskId].data[10] = 5;
gTasks[taskId].data[11] = 0; gTasks[taskId].data[11] = 0;
gTasks[taskId].func = sub_8158C04; gTasks[taskId].func = SoundTask_FireBlast_Step2;
} }
else else
{ {
@ -56,7 +61,7 @@ static void sub_8158B98(u8 taskId)
} }
} }
static void sub_8158C04(u8 taskId) static void SoundTask_FireBlast_Step2(u8 taskId)
{ {
if (++gTasks[taskId].data[10] == 6) if (++gTasks[taskId].data[10] == 6)
{ {
@ -69,9 +74,7 @@ static void sub_8158C04(u8 taskId)
DestroyAnimSoundTask(taskId); DestroyAnimSoundTask(taskId);
} }
} }
// task end
// task start
void SoundTask_LoopSEAdjustPanning(u8 taskId) void SoundTask_LoopSEAdjustPanning(u8 taskId)
{ {
u16 songId = gBattleAnimArgs[0]; u16 songId = gBattleAnimArgs[0];
@ -123,9 +126,7 @@ static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId)
gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan); gTasks[taskId].data[11] = KeepPanInRange(gTasks[taskId].data[11], oldPan);
} }
} }
// task end
// task start
void SoundTask_PlayCryHighPitch(u8 taskId) void SoundTask_PlayCryHighPitch(u8 taskId)
{ {
u16 species = 0; u16 species = 0;
@ -169,9 +170,7 @@ void SoundTask_PlayCryHighPitch(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
// task end
// task start
void SoundTask_PlayDoubleCry(u8 taskId) void SoundTask_PlayDoubleCry(u8 taskId)
{ {
u16 species = 0; u16 species = 0;
@ -258,7 +257,6 @@ static void SoundTask_PlayDoubleCry_Step(u8 taskId)
} }
} }
} }
// task end
void SoundTask_WaitForCry(u8 taskId) void SoundTask_WaitForCry(u8 taskId)
{ {
@ -273,7 +271,6 @@ void SoundTask_WaitForCry(u8 taskId)
} }
} }
// task start
void SoundTask_PlayCryWithEcho(u8 taskId) void SoundTask_PlayCryWithEcho(u8 taskId)
{ {
u16 species; u16 species;
@ -329,7 +326,6 @@ static void SoundTask_PlayCryWithEcho_Step(u8 taskId)
break; break;
} }
} }
// task end
void SoundTask_PlaySE1WithPanning(u8 taskId) void SoundTask_PlaySE1WithPanning(u8 taskId)
{ {
@ -389,4 +385,3 @@ static void SoundTask_AdjustPanningVar_Step(u8 taskId)
if (gTasks[taskId].data[11] == gTasks[taskId].data[2]) if (gTasks[taskId].data[11] == gTasks[taskId].data[2])
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }

View File

@ -464,7 +464,7 @@ void unref_sub_8170478(u8 taskId)
gSprites[spriteId3].callback = SpriteCallbackDummy; gSprites[spriteId3].callback = SpriteCallbackDummy;
gSprites[spriteId4].callback = SpriteCallbackDummy; gSprites[spriteId4].callback = SpriteCallbackDummy;
sub_80A6B30(&unknownStruct); GetDefaultBattleAnimBgData(&unknownStruct);
AnimLoadCompressedBgTilemap(unknownStruct.bgId, gUnknown_08C2EA9C); AnimLoadCompressedBgTilemap(unknownStruct.bgId, gUnknown_08C2EA9C);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C2EA50, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C2EA50, unknownStruct.tilesOffset);
LoadCompressedPalette(gCureBubblesPal, unknownStruct.paletteId << 4, 32); LoadCompressedPalette(gCureBubblesPal, unknownStruct.paletteId << 4, 32);

View File

@ -330,7 +330,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species);
sub_80A6B30(&unknownStruct); GetDefaultBattleAnimBgData(&unknownStruct);
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gUnknown_08C20684, 0); AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gUnknown_08C20684, 0);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C20668, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C20668, unknownStruct.tilesOffset);
LoadPalette(&gUnknown_08597418, unknownStruct.paletteId * 16 + 1, 2); LoadPalette(&gUnknown_08597418, unknownStruct.paletteId * 16 + 1, 2);
@ -377,7 +377,7 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
sprite = &gSprites[gTasks[taskId].data[0]]; sprite = &gSprites[gTasks[taskId].data[0]];
DestroySprite(sprite); DestroySprite(sprite);
sub_80A6B30(&unknownStruct); GetDefaultBattleAnimBgData(&unknownStruct);
sub_80A6C68(unknownStruct.bgId); sub_80A6C68(unknownStruct.bgId);
if (gTasks[taskId].data[6] == 1) if (gTasks[taskId].data[6] == 1)
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++; gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].oam.priority++;
@ -468,7 +468,7 @@ static void sub_81170EC(u8 taskId)
spriteId2 = sub_80A89C8(sAnimStatsChangeData->battler2, battlerSpriteId, sAnimStatsChangeData->species); spriteId2 = sub_80A89C8(sAnimStatsChangeData->battler2, battlerSpriteId, sAnimStatsChangeData->species);
} }
sub_80A6B30(&unknownStruct); GetDefaultBattleAnimBgData(&unknownStruct);
if (sAnimStatsChangeData->data[0] == 0) if (sAnimStatsChangeData->data[0] == 0)
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gBattleStatMask1_Tilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gBattleStatMask1_Tilemap, 0);
else else
@ -705,7 +705,7 @@ void AnimTask_StartSlidingBg(u8 taskId)
{ {
u8 newTaskId; u8 newTaskId;
sub_80A6DAC(0); UpdateAnimBg3ScreenSize(FALSE);
newTaskId = CreateTask(AnimTask_UpdateSlidingBg, 5); newTaskId = CreateTask(AnimTask_UpdateSlidingBg, 5);
if (gBattleAnimArgs[2] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (gBattleAnimArgs[2] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{ {
@ -733,7 +733,7 @@ static void AnimTask_UpdateSlidingBg(u8 taskId)
{ {
gBattle_BG3_X = 0; gBattle_BG3_X = 0;
gBattle_BG3_Y = 0; gBattle_BG3_Y = 0;
sub_80A6DAC(1); UpdateAnimBg3ScreenSize(TRUE);
DestroyTask(taskId); DestroyTask(taskId);
} }
} }
@ -824,7 +824,7 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5,
if (arg4) if (arg4)
spriteId2 = sub_80A89C8(battler2, gBattlerSpriteIds[battler2], species); spriteId2 = sub_80A89C8(battler2, gBattlerSpriteIds[battler2], species);
sub_80A6B30(&unknownStruct); GetDefaultBattleAnimBgData(&unknownStruct);
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, tilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, tilemap, 0);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gfx, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(unknownStruct.bgId, gfx, unknownStruct.tilesOffset);
LoadCompressedPalette(palette, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(palette, unknownStruct.paletteId * 16, 32);

View File

@ -811,7 +811,7 @@ void AnimTask_CreateSurfWave(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1); SetAnimBgAttribute(1, BG_ANIM_PRIORITY, 1);
SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 1); SetAnimBgAttribute(1, BG_ANIM_SCREEN_SIZE, 1);
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
if (!IsContest()) if (!IsContest())
{ {
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 1);
@ -884,7 +884,7 @@ static void AnimTask_CreateSurfWave_Step1(u8 taskId)
*BGptrX += gTasks[taskId].data[0]; *BGptrX += gTasks[taskId].data[0];
*BGptrY += gTasks[taskId].data[1]; *BGptrY += gTasks[taskId].data[1];
sub_80A6B30(&animBg); GetDefaultBattleAnimBgData(&animBg);
gTasks[taskId].data[2] += gTasks[taskId].data[1]; gTasks[taskId].data[2] += gTasks[taskId].data[1];
if (++gTasks[taskId].data[5] == 4) if (++gTasks[taskId].data[5] == 4)
{ {
@ -1053,7 +1053,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
switch (task->data[0]) switch (task->data[0])
{ {
case 0: case 0:
sub_80A805C(task, task->data[15], 0x100, 0x100, 224, 0x200, 32); PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32);
task->data[0]++; task->data[0]++;
case 1: case 1:
if (++task->data[3] > 1) if (++task->data[3] > 1)
@ -1069,7 +1069,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
gSprites[task->data[15]].pos2.x = -3; gSprites[task->data[15]].pos2.x = -3;
} }
} }
if (sub_80A80C8(task) == 0) if (UpdateEruptAnimTask(task) == 0)
{ {
SetBattlerSpriteYOffsetFromYScale(task->data[15]); SetBattlerSpriteYOffsetFromYScale(task->data[15]);
gSprites[task->data[15]].pos2.x = 0; gSprites[task->data[15]].pos2.x = 0;
@ -1081,13 +1081,13 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
case 2: case 2:
if (++task->data[3] > 4) if (++task->data[3] > 4)
{ {
sub_80A805C(task, task->data[15], 224, 0x200, 384, 224, 8); PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xE0, 8);
task->data[3] = 0; task->data[3] = 0;
task->data[0]++; task->data[0]++;
} }
break; break;
case 3: case 3:
if (sub_80A80C8(task) == 0) if (UpdateEruptAnimTask(task) == 0)
{ {
task->data[3] = 0; task->data[3] = 0;
task->data[4] = 0; task->data[4] = 0;
@ -1107,7 +1107,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
gSprites[task->data[15]].pos2.y -= 2; gSprites[task->data[15]].pos2.y -= 2;
if (task->data[4] == 10) if (task->data[4] == 10)
{ {
sub_80A805C(task, task->data[15], 384, 224, 0x100, 0x100, 8); PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xE0, 0x100, 0x100, 8);
task->data[3] = 0; task->data[3] = 0;
task->data[4] = 0; task->data[4] = 0;
task->data[0]++; task->data[0]++;
@ -1116,7 +1116,7 @@ static void AnimTask_WaterSpoutLaunch_Step(u8 taskId)
break; break;
case 6: case 6:
gSprites[task->data[15]].pos1.y--; gSprites[task->data[15]].pos1.y--;
if (sub_80A80C8(task) == 0) if (UpdateEruptAnimTask(task) == 0)
{ {
ResetSpriteRotScale(task->data[15]); ResetSpriteRotScale(task->data[15]);
gSprites[task->data[15]].pos1.y = task->data[5]; gSprites[task->data[15]].pos1.y = task->data[5];