Document more battle anim effects

This commit is contained in:
Marcus Huderle 2021-02-27 17:41:30 -06:00 committed by huderlem
parent ea748ff7f5
commit a85fada314
27 changed files with 365 additions and 372 deletions

View File

@ -2628,7 +2628,7 @@ Move_FISSURE:
delay 40 delay 40
restorebg restorebg
waitbgfadeout waitbgfadeout
setarg 7, 0xFFFF setarg 7, -1
waitbgfadein waitbgfadein
end end

View File

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 175 B

View File

@ -65,7 +65,7 @@ s8 BattleAnimAdjustPanning2(s8 pan);
s16 KeepPanInRange(s16 a, int oldPan); s16 KeepPanInRange(s16 a, int oldPan);
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan); s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
void sub_80A4720(u16 a, u16 *b, u32 c, u8 d); void sub_80A4720(u16 a, u16 *b, u32 c, u8 d);
void sub_80A477C(bool8); void ResetBattleAnimBg(bool8);
// battle_intro.c // battle_intro.c
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value); void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
@ -75,8 +75,8 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId);
// battle_anim_mons.c // battle_anim_mons.c
void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite); void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite);
void sub_80A8AEC(struct Sprite *sprite); void AnimUnused_80A8AEC(struct Sprite *sprite);
void sub_80A8A6C(struct Sprite *sprite); void AnimUnused_80A8A6C(struct Sprite *sprite);
void AnimWeatherBallUp(struct Sprite *sprite); void AnimWeatherBallUp(struct Sprite *sprite);
void AnimWeatherBallDown(struct Sprite *sprite); void AnimWeatherBallDown(struct Sprite *sprite);
void AnimSpinningSparkle(struct Sprite *sprite); void AnimSpinningSparkle(struct Sprite *sprite);
@ -108,8 +108,8 @@ 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 GetDefaultBattleAnimBgData(struct BattleAnimBgData*); void GetBattleAnimBg1Data(struct BattleAnimBgData*);
void sub_80A6B90(struct BattleAnimBgData*, u32 arg1); void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1);
u8 GetBattlerSpriteSubpriority(u8 battlerId); u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimHorizontalArc(struct Sprite *sprite); bool8 TranslateAnimHorizontalArc(struct Sprite *sprite);
void sub_80A6630(struct Sprite *sprite); void sub_80A6630(struct Sprite *sprite);
@ -119,12 +119,12 @@ void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
void InitSpriteDataForLinearTranslation(struct Sprite *sprite); void InitSpriteDataForLinearTranslation(struct Sprite *sprite);
void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode); void PrepareBattlerSpriteForRotScale(u8 spriteId, u8 objMode);
void SetBattlerSpriteYOffsetFromRotation(u8 spriteId); void SetBattlerSpriteYOffsetFromRotation(u8 spriteId);
u32 sub_80A75AC(u8 a1, u8 a2, u8 a3, u8 a4, u8 a5, u8 a6, u8 a7); u32 GetBattleBgPalettesMask(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); u32 GetBattleMonSpritePalettesMask(u8 a1, u8 a2, u8 a3, u8 a4);
u8 AnimDummyReturnArg(u8 battler); u8 AnimDummyReturnArg(u8 battler);
s16 CloneBattlerSpriteWithBlend(u8); s16 CloneBattlerSpriteWithBlend(u8);
void obj_delete_but_dont_free_vram(struct Sprite*); void obj_delete_but_dont_free_vram(struct Sprite*);
u8 sub_80A89C8(int, u8, int); u8 CreateInvisibleSpriteCopy(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 UpdateAnimBg3ScreenSize(bool8); void UpdateAnimBg3ScreenSize(bool8);
@ -183,7 +183,7 @@ enum
u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId); u8 GetBattlerSpriteCoord(u8 battlerId, u8 attributeId);
bool8 IsBattlerSpritePresent(u8 battlerId); bool8 IsBattlerSpritePresent(u8 battlerId);
void sub_80A6C68(u32 arg0); void ClearBattleAnimBg(u32 arg0);
u8 GetAnimBattlerSpriteId(u8 wantedBattler); u8 GetAnimBattlerSpriteId(u8 wantedBattler);
bool8 IsDoubleBattle(void); bool8 IsDoubleBattle(void);
u8 GetBattleBgPaletteNum(void); u8 GetBattleBgPaletteNum(void);
@ -214,8 +214,8 @@ u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId);
u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId);
// battle_anim_utility_funcs.c // battle_anim_utility_funcs.c
void sub_8116EB4(u8); void InitStatsChangeAnimation(u8);
void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette); void StartMonScrollingBgMask(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *arg8, const u32 *arg9, const u32 *palette);
// battle_anim_effects_1.c // battle_anim_effects_1.c
void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite);
@ -231,7 +231,7 @@ void DestroyAnimSpriteAfterTimer(struct Sprite *sprite);
// battle_anim_smokescreen.c // battle_anim_smokescreen.c
u8 SmokescreenImpact(s16 x, s16 y, u8 a3); u8 SmokescreenImpact(s16 x, s16 y, u8 a3);
u32 UnpackSelectedBattleAnimPalettes(s16); u32 UnpackSelectedBattleBgPalettes(s16);
u8 GetBattlerSpriteFinal_Y(u8, u16, u8); u8 GetBattlerSpriteFinal_Y(u8, u16, u8);

View File

@ -117,7 +117,7 @@ struct Weather
// field_weather.c // field_weather.c
extern struct Weather gWeather; extern struct Weather gWeather;
extern struct Weather *const gWeatherPtr; extern struct Weather *const gWeatherPtr;
extern const u16 gUnknown_083970E8[]; extern const u16 gFogPalette[];
// field_weather_effect.c // field_weather_effect.c
extern const u8 gWeatherFogHorizontalTiles[]; extern const u8 gWeatherFogHorizontalTiles[];

View File

@ -4199,8 +4199,8 @@ extern const u32 gBattleAnimSpriteGfx_HumanoidFoot[];
extern const u32 gBattleAnimSpriteGfx_MonsterFoot[]; extern const u32 gBattleAnimSpriteGfx_MonsterFoot[];
extern const u32 gBattleAnimSpriteGfx_HumanoidHand[]; extern const u32 gBattleAnimSpriteGfx_HumanoidHand[];
extern const u32 gBattleAnimSpriteGfx_NoiseLine[]; extern const u32 gBattleAnimSpriteGfx_NoiseLine[];
extern const u32 gUnknown_08C2EA50[]; extern const u32 UnusedLevelupAnimationGfx[];
extern const u32 gUnknown_08C2EA9C[]; extern const u32 UnusedLevelupAnimationTilemap[];
extern const u32 gBattleAnimSpriteGfx_YellowUnk[]; extern const u32 gBattleAnimSpriteGfx_YellowUnk[];
extern const u32 gBattleAnimSpriteGfx_RedFist[]; extern const u32 gBattleAnimSpriteGfx_RedFist[];
extern const u32 gBattleAnimSpriteGfx_SlamHit[]; extern const u32 gBattleAnimSpriteGfx_SlamHit[];
@ -4764,8 +4764,8 @@ extern const u32 gMetalShineGfx[];
extern const u32 gMetalShinePalette[]; extern const u32 gMetalShinePalette[];
extern const u32 gMetalShineTilemap[]; extern const u32 gMetalShineTilemap[];
extern const u32 gUnknown_08C20668[]; extern const u32 gBattleAnimMaskImage_Curse[];
extern const u32 gUnknown_08C20684[]; extern const u32 gBattleAnimMaskTilemap_Curse[];
extern const u32 gBattleStatMask_Gfx[]; extern const u32 gBattleStatMask_Gfx[];
extern const u32 gBattleStatMask1_Tilemap[]; extern const u32 gBattleStatMask1_Tilemap[];
extern const u32 gBattleStatMask2_Tilemap[]; extern const u32 gBattleStatMask2_Tilemap[];

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);
} }
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
CpuFill16(0, animBg.bgTiles, 0x1000); CpuFill16(0, animBg.bgTiles, 0x1000);
CpuFill16(0xFF, animBg.bgTilemap, 0x800); CpuFill16(0xFF, animBg.bgTilemap, 0x800);
@ -2338,7 +2338,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
{ {
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(12)), 0x2000, 1); RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(12)), 0x2000, 1);
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 1); RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 1);
sub_80A6B90(&animBg, 2); GetBattleAnimBgData(&animBg, 2);
CpuFill16(0, animBg.bgTiles + 0x1000, 0x1000); CpuFill16(0, animBg.bgTiles + 0x1000, 0x1000);
CpuFill16(0, animBg.bgTilemap + 0x400, 0x800); CpuFill16(0, animBg.bgTilemap + 0x400, 0x800);
SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 2); SetAnimBgAttribute(2, BG_ANIM_PRIORITY, 2);
@ -2371,7 +2371,7 @@ static void sub_80A46A0(void)
if (IsSpeciesNotUnown(gContestResources->moveAnim->species)) if (IsSpeciesNotUnown(gContestResources->moveAnim->species))
{ {
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
ptr = animBg.bgTilemap; ptr = animBg.bgTilemap;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
{ {
@ -2408,20 +2408,20 @@ void sub_80A4720(u16 a, u16 *b, u32 c, u8 d)
} }
} }
void sub_80A477C(bool8 to_BG2) void ResetBattleAnimBg(bool8 toBG2)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
if (!to_BG2 || IsContest()) if (!toBG2 || IsContest())
{ {
sub_80A6C68(1); ClearBattleAnimBg(1);
gBattle_BG1_X = 0; gBattle_BG1_X = 0;
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
} }
else else
{ {
sub_80A6C68(2); ClearBattleAnimBg(2);
gBattle_BG2_X = 0; gBattle_BG2_X = 0;
gBattle_BG2_Y = 0; gBattle_BG2_Y = 0;
} }
@ -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];
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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);
@ -2510,13 +2510,13 @@ static void sub_80A4980(u8 taskId)
if (sMonAnimTaskIdArray[0] != TASK_NONE) if (sMonAnimTaskIdArray[0] != TASK_NONE)
{ {
sub_80A477C(to_BG2); ResetBattleAnimBg(to_BG2);
DestroyTask(sMonAnimTaskIdArray[0]); DestroyTask(sMonAnimTaskIdArray[0]);
sMonAnimTaskIdArray[0] = TASK_NONE; sMonAnimTaskIdArray[0] = TASK_NONE;
} }
if (gTasks[taskId].data[0] > 1) if (gTasks[taskId].data[0] > 1)
{ {
sub_80A477C(to_BG2 ^ 1); ResetBattleAnimBg(to_BG2 ^ 1);
DestroyTask(sMonAnimTaskIdArray[1]); DestroyTask(sMonAnimTaskIdArray[1]);
sMonAnimTaskIdArray[1] = TASK_NONE; sMonAnimTaskIdArray[1] = TASK_NONE;
} }
@ -2617,9 +2617,9 @@ static void sub_80A4BB0(u8 taskId)
toBG_2 = TRUE; toBG_2 = TRUE;
if (IsBattlerSpriteVisible(battlerId)) if (IsBattlerSpriteVisible(battlerId))
sub_80A477C(toBG_2); ResetBattleAnimBg(toBG_2);
if (gTasks[taskId].data[0] > 1 && IsBattlerSpriteVisible(battlerId ^ BIT_FLANK)) if (gTasks[taskId].data[0] > 1 && IsBattlerSpriteVisible(battlerId ^ BIT_FLANK))
sub_80A477C(toBG_2 ^ 1); ResetBattleAnimBg(toBG_2 ^ 1);
DestroyTask(taskId); DestroyTask(taskId);
} }
@ -3407,9 +3407,9 @@ static void ScriptCmd_doublebattle_2D(void)
gSprites[spriteId].oam.priority = 3; gSprites[spriteId].oam.priority = 3;
if (r4 == 1) if (r4 == 1)
sub_80A477C(FALSE); ResetBattleAnimBg(FALSE);
else else
sub_80A477C(TRUE); ResetBattleAnimBg(TRUE);
} }
} }
} }

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)
{ {
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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)
{ {
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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);
} }
@ -787,10 +787,10 @@ void AnimTask_InitMementoShadow(u8 taskId)
void sub_8114470(u8 taskId) void sub_8114470(u8 taskId)
{ {
u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0; u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0;
sub_80A477C(toBG2); ResetBattleAnimBg(toBG2);
if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker))) if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
sub_80A477C(toBG2 ^ 1); ResetBattleAnimBg(toBG2 ^ 1);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
@ -858,9 +858,9 @@ void AnimTask_MetallicShine(u8 taskId)
} }
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); newSpriteId = CreateInvisibleSpriteCopy(gBattleAnimAttacker, spriteId, species);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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,8 +903,8 @@ 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]]);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(animBg.bgId); ClearBattleAnimBg(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

@ -4338,7 +4338,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite)
sprite->data[1] = 0; sprite->data[1] = 0;
} }
BlendPalettes(sub_80A75AC(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB(31, 31, 31)); BlendPalettes(GetBattleBgPalettesMask(1, 1, 1, 1, 1, 0, 0), sprite->data[1], RGB(31, 31, 31));
if (sprite->data[1] == 16) if (sprite->data[1] == 16)
{ {
int pal; int pal;
@ -4991,7 +4991,7 @@ static void AnimMoonlightSparkle_Step(struct Sprite* sprite)
void AnimTask_MoonlightEndFade(u8 taskId) void AnimTask_MoonlightEndFade(u8 taskId)
{ {
int a = sub_80A75AC(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; int a = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
int b; int b;
int c; int c;
int d; int d;
@ -5006,7 +5006,7 @@ void AnimTask_MoonlightEndFade(u8 taskId)
gTasks[taskId].data[7] = 13; gTasks[taskId].data[7] = 13;
gTasks[taskId].data[8] = 14; gTasks[taskId].data[8] = 14;
gTasks[taskId].data[9] = 15; gTasks[taskId].data[9] = 15;
b = sub_80A76C4(1, 1, 1, 1); b = GetBattleMonSpritePalettesMask(1, 1, 1, 1);
c = a | b; c = a | b;
StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c); StorePointerInVars(&gTasks[taskId].data[14], &gTasks[taskId].data[15], (void*)c);
b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON)); b = b | (0x10000 << IndexOfSpritePaletteTag(ANIM_TAG_MOON));

View File

@ -3106,7 +3106,7 @@ static void AnimTask_FakeOut_Step2(u8 taskId)
{ {
gTasks[taskId].data[11] = 0x88; gTasks[taskId].data[11] = 0x88;
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN);
BlendPalettes(sub_80A75AC(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31)); BlendPalettes(GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31));
} }
else if (gTasks[taskId].data[10] > 4) else if (gTasks[taskId].data[10] > 4)
{ {
@ -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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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,8 +3295,8 @@ static void AnimTask_HeartsBackground_Step(u8 taskId)
} }
break; break;
case 3: case 3:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(animBg.bgId); ClearBattleAnimBg(animBg.bgId);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
break; break;
case 4: case 4:
@ -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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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,9 +3379,9 @@ static void AnimTask_ScaryFace_Step(u8 taskId)
} }
break; break;
case 3: case 3:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(1); ClearBattleAnimBg(1);
sub_80A6C68(2); ClearBattleAnimBg(2);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
// fall through // fall through
case 4: case 4:

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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0);
if (IsContest()) if (IsContest())
{ {
@ -2450,8 +2450,8 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
} }
break; break;
case 4: case 4:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(animBg.bgId); ClearBattleAnimBg(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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0); AnimLoadCompressedBgTilemapHandleContest(&animBg, &gBattleAnimMaskTilemap_LightBeam, 0);
if (IsContest()) if (IsContest())
{ {
@ -2639,8 +2639,8 @@ void AnimTask_DoomDesireLightBeam(u8 taskId)
gTasks[taskId].data[0] = 1; gTasks[taskId].data[0] = 1;
break; break;
case 5: case 5:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(animBg.bgId); ClearBattleAnimBg(animBg.bgId);
if (!IsContest()) if (!IsContest())
SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0); SetAnimBgAttribute(1, BG_ANIM_CHAR_BASE_BLOCK, 0);
@ -3866,7 +3866,7 @@ static void AnimTask_FacadeColorBlend_Step(u8 taskId)
// The sliding circle effect used by Refresh and Aromatherapy // The sliding circle effect used by Refresh and Aromatherapy
void AnimTask_StatusClearedEffect(u8 taskId) void AnimTask_StatusClearedEffect(u8 taskId)
{ {
sub_8117854( StartMonScrollingBgMask(
taskId, taskId,
0, 0,
0x1A0, 0x1A0,

View File

@ -1278,7 +1278,7 @@ static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId)
void AnimTask_BlendBackground(u8 taskId) void AnimTask_BlendBackground(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]); BlendPalette(animBg.paletteId * 16, 16, gBattleAnimArgs[0], gBattleAnimArgs[1]);
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }

View File

@ -13,7 +13,7 @@
static void AnimConfuseRayBallBounce(struct Sprite *); static void AnimConfuseRayBallBounce(struct Sprite *);
static void AnimConfuseRayBallBounce_Step1(struct Sprite *); static void AnimConfuseRayBallBounce_Step1(struct Sprite *);
static void AnimConfuseRayBallBounce_Step2(struct Sprite *); static void AnimConfuseRayBallBounce_Step2(struct Sprite *);
static void sub_8111764(struct Sprite *); static void UpdateConfuseRayBallBlend(struct Sprite *);
static void AnimConfuseRayBallSpiral(struct Sprite *); static void AnimConfuseRayBallSpiral(struct Sprite *);
static void AnimConfuseRayBallSpiral_Step(struct Sprite *); static void AnimConfuseRayBallSpiral_Step(struct Sprite *);
static void AnimTask_NightShadeClone_Step1(u8 taskId); static void AnimTask_NightShadeClone_Step1(u8 taskId);
@ -39,8 +39,8 @@ static void AnimGhostStatusSprite(struct Sprite *);
static void AnimGhostStatusSprite_Step(struct Sprite *); static void AnimGhostStatusSprite_Step(struct Sprite *);
static void AnimTask_GrudgeFlames_Step(u8 taskId); static void AnimTask_GrudgeFlames_Step(u8 taskId);
static void AnimGrudgeFlame(struct Sprite *); static void AnimGrudgeFlame(struct Sprite *);
static void sub_8112F60(struct Sprite *); static void AnimUnused_8112F60(struct Sprite *);
static void sub_8112FB8(struct Sprite *); static void AnimUnused_8112F60_Step(struct Sprite *);
static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] = static const union AffineAnimCmd sAffineAnim_ConfuseRayBallBounce[] =
{ {
@ -124,16 +124,16 @@ const struct SpriteTemplate gLickSpriteTemplate =
.callback = AnimLick, .callback = AnimLick,
}; };
static const union AffineAnimCmd gUnknown_08596DA4[] = static const union AffineAnimCmd sAnim_Unused_08596DA4[] =
{ {
AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0), AFFINEANIMCMD_FRAME(0x200, 0x200, 0, 0),
AFFINEANIMCMD_END, AFFINEANIMCMD_END,
}; };
// Unused // Unused
static const union AffineAnimCmd *const gUnknown_08596DB4[] = static const union AffineAnimCmd *const gAnims_Unused_08596DB4[] =
{ {
gUnknown_08596DA4, sAnim_Unused_08596DA4,
}; };
const struct SpriteTemplate gDestinyBondWhiteShadowSpriteTemplate = const struct SpriteTemplate gDestinyBondWhiteShadowSpriteTemplate =
@ -206,7 +206,7 @@ const struct SpriteTemplate gGrudgeFlameSpriteTemplate =
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_08596E48 = const struct SpriteTemplate gUnusedSpriteTemplate_08596E48 =
{ {
.tileTag = 0, .tileTag = 0,
.paletteTag = 0, .paletteTag = 0,
@ -214,12 +214,12 @@ const struct SpriteTemplate gUnknown_08596E48 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_8112F60, .callback = AnimUnused_8112F60,
}; };
static void AnimConfuseRayBallBounce(struct Sprite *sprite) static void AnimConfuseRayBallBounce(struct Sprite *sprite)
{ {
InitSpritePosToAnimAttacker(sprite, 1); InitSpritePosToAnimAttacker(sprite, TRUE);
sprite->data[0] = gBattleAnimArgs[2]; sprite->data[0] = gBattleAnimArgs[2];
sprite->data[1] = sprite->pos1.x; sprite->data[1] = sprite->pos1.x;
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2); sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
@ -236,7 +236,7 @@ static void AnimConfuseRayBallBounce_Step1(struct Sprite *sprite)
{ {
s16 r0; s16 r0;
s16 r2; s16 r2;
sub_8111764(sprite); UpdateConfuseRayBallBlend(sprite);
if (AnimTranslateLinear(sprite)) if (AnimTranslateLinear(sprite))
{ {
sprite->callback = AnimConfuseRayBallBounce_Step2; sprite->callback = AnimConfuseRayBallBounce_Step2;
@ -280,13 +280,11 @@ static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite)
sprite->callback = DestroyAnimSpriteAndDisableBlend; sprite->callback = DestroyAnimSpriteAndDisableBlend;
} }
else else
sub_8111764(sprite); UpdateConfuseRayBallBlend(sprite);
} }
static void sub_8111764(struct Sprite *sprite) static void UpdateConfuseRayBallBlend(struct Sprite *sprite)
{ {
s16 r0;
if (sprite->data[6] > 0xFF) if (sprite->data[6] > 0xFF)
{ {
if (++sprite->data[6] == 0x10d) if (++sprite->data[6] == 0x10d)
@ -294,10 +292,7 @@ static void sub_8111764(struct Sprite *sprite)
return; return;
} }
r0 = sprite->data[7]; if ((sprite->data[7]++ & 0xFF) == 0)
sprite->data[7]++;
if ((r0 & 0xFF) == 0)
{ {
sprite->data[7] &= 0xff00; sprite->data[7] &= 0xff00;
if ((sprite->data[7] & 0x100) != 0) if ((sprite->data[7] & 0x100) != 0)
@ -648,7 +643,7 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId)
break; break;
case 1: case 1:
task->data[14] = (task->data[14] + 16) * 16; task->data[14] = (task->data[14] + 16) * 16;
CpuSet(&gPlttBufferUnfaded[task->data[4]], &gPlttBufferFaded[task->data[14]], 0x4000008); CpuCopy32(&gPlttBufferUnfaded[task->data[4]], &gPlttBufferFaded[task->data[14]], 32);
BlendPalette(task->data[4], 16, 10, RGB(13, 0, 15)); BlendPalette(task->data[4], 16, 10, RGB(13, 0, 15));
task->data[15]++; task->data[15]++;
break; break;
@ -1009,7 +1004,7 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId)
right = 240; right = 240;
top = 0; top = 0;
bottom = 112; bottom = 112;
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0)); BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0));
gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2; gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2;
} }
@ -1307,7 +1302,7 @@ static void AnimGrudgeFlame(struct Sprite *sprite)
} }
} }
static void sub_8112F60(struct Sprite *sprite) static void AnimUnused_8112F60(struct Sprite *sprite)
{ {
sprite->invisible = TRUE; sprite->invisible = TRUE;
sprite->data[5] = gBattlerSpriteIds[gBattleAnimAttacker]; sprite->data[5] = gBattlerSpriteIds[gBattleAnimAttacker];
@ -1315,12 +1310,12 @@ static void sub_8112F60(struct Sprite *sprite)
sprite->data[1] = 10; sprite->data[1] = 10;
sprite->data[2] = gBattleAnimArgs[0]; sprite->data[2] = gBattleAnimArgs[0];
sprite->data[3] = gBattleAnimArgs[1]; sprite->data[3] = gBattleAnimArgs[1];
sprite->callback = sub_8112FB8; sprite->callback = AnimUnused_8112F60_Step;
gSprites[sprite->data[5]].pos1.y += 8; gSprites[sprite->data[5]].pos1.y += 8;
} }
static void sub_8112FB8(struct Sprite *sprite) static void AnimUnused_8112F60_Step(struct Sprite *sprite)
{ {
if (sprite->data[3]) if (sprite->data[3])
{ {

View File

@ -21,11 +21,11 @@ static void AnimTask_DigBounceMovement(u8);
static void AnimTask_DigEndBounceMovementSetInvisible(u8); static void AnimTask_DigEndBounceMovementSetInvisible(u8);
static void AnimTask_DigSetVisibleUnderground(u8); static void AnimTask_DigSetVisibleUnderground(u8);
static void AnimTask_DigRiseUpFromHole(u8); static void AnimTask_DigRiseUpFromHole(u8);
static void sub_81150E0(u8, s16, s16); static void SetDigScanlineEffect(u8, s16, s16);
static void AnimTask_ShakeTerrain(u8); static void AnimTask_ShakeTerrain(u8);
static void AnimTask_ShakeBattlers(u8); static void AnimTask_ShakeBattlers(u8);
static void SetBattlersXOffsetForShake(struct Task *); static void SetBattlersXOffsetForShake(struct Task *);
static void sub_81156D0(u8); static void WaitForFissureCompletion(u8);
static const union AffineAnimCmd sAffineAnim_Bonemerang[] = static const union AffineAnimCmd sAffineAnim_Bonemerang[] =
{ {
@ -299,7 +299,7 @@ void AnimTask_DigDownMovement(u8 taskId)
static void AnimTask_DigBounceMovement(u8 taskId) static void AnimTask_DigBounceMovement(u8 taskId)
{ {
u8 var0; u8 y;
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
switch (task->data[0]) switch (task->data[0])
@ -318,9 +318,9 @@ static void AnimTask_DigBounceMovement(u8 taskId)
task->data[13] = gBattle_BG2_Y; task->data[13] = gBattle_BG2_Y;
} }
var0 = GetBattlerYCoordWithElevation(gBattleAnimAttacker); y = GetBattlerYCoordWithElevation(gBattleAnimAttacker);
task->data[14] = var0 - 32; task->data[14] = y - 32;
task->data[15] = var0 + 32; task->data[15] = y + 32;
if (task->data[14] < 0) if (task->data[14] < 0)
task->data[14] = 0; task->data[14] = 0;
@ -328,7 +328,7 @@ static void AnimTask_DigBounceMovement(u8 taskId)
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
sub_81150E0(task->data[11], task->data[14], task->data[15]); SetDigScanlineEffect(task->data[11], task->data[14], task->data[15]);
task->data[0]++; task->data[0]++;
break; break;
case 2: case 2:
@ -434,7 +434,7 @@ static void AnimTask_DigRiseUpFromHole(u8 taskId)
task->data[0]++; task->data[0]++;
break; break;
case 1: case 1:
sub_81150E0(task->data[11], 0, task->data[15]); SetDigScanlineEffect(task->data[11], 0, task->data[15]);
task->data[0]++; task->data[0]++;
break; break;
case 2: case 2:
@ -455,7 +455,7 @@ static void AnimTask_DigRiseUpFromHole(u8 taskId)
} }
} }
static void sub_81150E0(u8 useBG1, s16 y, s16 endY) static void SetDigScanlineEffect(u8 useBG1, s16 y, s16 endY)
{ {
s16 bgX; s16 bgX;
struct ScanlineEffectParams scanlineParams; struct ScanlineEffectParams scanlineParams;
@ -743,21 +743,23 @@ void AnimTask_PositionFissureBgOnBattler(u8 taskId)
u8 battler = (gBattleAnimArgs[0] & ANIM_TARGET) ? gBattleAnimTarget : gBattleAnimAttacker; u8 battler = (gBattleAnimArgs[0] & ANIM_TARGET) ? gBattleAnimTarget : gBattleAnimAttacker;
if (gBattleAnimArgs[0] > ANIM_TARGET) if (gBattleAnimArgs[0] > ANIM_TARGET)
battler ^= 2; battler = BATTLE_PARTNER(battler);
newTask = &gTasks[CreateTask(sub_81156D0, gBattleAnimArgs[1])]; newTask = &gTasks[CreateTask(WaitForFissureCompletion, gBattleAnimArgs[1])];
newTask->data[1] = (32 - GetBattlerSpriteCoord(battler, 2)) & 0x1FF; newTask->data[1] = (32 - GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2)) & 0x1FF;
newTask->data[2] = (64 - GetBattlerSpriteCoord(battler, 3)) & 0xFF; newTask->data[2] = (64 - GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET)) & 0xFF;
gBattle_BG3_X = newTask->data[1]; gBattle_BG3_X = newTask->data[1];
gBattle_BG3_Y = newTask->data[2]; gBattle_BG3_Y = newTask->data[2];
newTask->data[3] = gBattleAnimArgs[2]; newTask->data[3] = gBattleAnimArgs[2];
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
static void sub_81156D0(u8 taskId) static void WaitForFissureCompletion(u8 taskId)
{ {
struct Task *task = &gTasks[taskId]; struct Task *task = &gTasks[taskId];
// Holds the BG3 offsets until gBattleAnimArgs[7]
// is set to a special terminator value.
if (gBattleAnimArgs[7] == task->data[3]) if (gBattleAnimArgs[7] == task->data[3])
{ {
gBattle_BG3_X = 0; gBattle_BG3_X = 0;

View File

@ -20,8 +20,8 @@ struct HailStruct {
s32 unk3:4; s32 unk3:4;
}; };
static void sub_810B6C4(struct Sprite *); static void AnimUnused_810B6C4(struct Sprite *);
static void sub_810B848(struct Sprite *); static void AnimUnused_810B6C4_Step(struct Sprite *);
static void AnimIcePunchSwirlingParticle(struct Sprite *); static void AnimIcePunchSwirlingParticle(struct Sprite *);
static void AnimIceBeamParticle(struct Sprite *); static void AnimIceBeamParticle(struct Sprite *);
static void AnimIceEffectParticle(struct Sprite *); static void AnimIceEffectParticle(struct Sprite *);
@ -44,25 +44,25 @@ static void InitIceBallAnim(struct Sprite *);
static void AnimThrowIceBall(struct Sprite *); static void AnimThrowIceBall(struct Sprite *);
static void InitIceBallParticle(struct Sprite *); static void InitIceBallParticle(struct Sprite *);
static void AnimIceBallParticle(struct Sprite *); static void AnimIceBallParticle(struct Sprite *);
static void AnimTask_Haze2(u8); static void AnimTask_HazeScrollingFog_Step(u8);
static void AnimTask_OverlayFogTiles(u8); static void AnimTask_LoadMistTiles_Step(u8);
static void AnimTask_Hail2(u8); static void AnimTask_Hail2(u8);
static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c); static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c);
static const union AnimCmd gUnknown_08595A48[] = static const union AnimCmd sAnim_Unused_08595A48[] =
{ {
ANIMCMD_FRAME(0, 5, .hFlip = TRUE), ANIMCMD_FRAME(0, 5, .hFlip = TRUE),
ANIMCMD_FRAME(1, 5, .hFlip = TRUE), ANIMCMD_FRAME(1, 5, .hFlip = TRUE),
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
static const union AnimCmd *const gUnknown_08595A54[] = static const union AnimCmd *const sAnims_Unused_08595A54[] =
{ {
gUnknown_08595A48, sAnim_Unused_08595A48,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_08595A58 = const struct SpriteTemplate gUnusedSpriteTemplate_08595A58 =
{ {
.tileTag = ANIM_TAG_ICE_CRYSTALS, .tileTag = ANIM_TAG_ICE_CRYSTALS,
.paletteTag = ANIM_TAG_ICE_CRYSTALS, .paletteTag = ANIM_TAG_ICE_CRYSTALS,
@ -70,10 +70,10 @@ const struct SpriteTemplate gUnknown_08595A58 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_810B6C4, .callback = AnimUnused_810B6C4,
}; };
static const union AnimCmd gUnknown_08595A70[] = static const union AnimCmd sAnim_Unused_08595A70[] =
{ {
ANIMCMD_FRAME(0, 1), ANIMCMD_FRAME(0, 1),
ANIMCMD_END, ANIMCMD_END,
@ -111,9 +111,9 @@ static const union AnimCmd sAnim_SmallBubblePair[] =
}; };
// Unused // Unused
static const union AnimCmd *const gUnknown_08595AA4[] = static const union AnimCmd *const sAnims_Unused_08595AA4[] =
{ {
gUnknown_08595A70, sAnim_Unused_08595A70,
}; };
static const union AnimCmd *const sAnims_IceCrystalLarge[] = static const union AnimCmd *const sAnims_IceCrystalLarge[] =
@ -337,7 +337,7 @@ const struct SpriteTemplate gSmogCloudSpriteTemplate =
.callback = InitSwirlingFogAnim, .callback = InitSwirlingFogAnim,
}; };
static const u8 sUnknown_08595C5C[] = static const u8 sHazeBlendAmounts[] =
{ {
0, 1, 2, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 6, 7, 8, 8, 8, 9, 0, 1, 2, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 6, 7, 8, 8, 8, 9,
}; };
@ -353,7 +353,7 @@ const struct SpriteTemplate gMistBallSpriteTemplate =
.callback = AnimThrowMistBall, .callback = AnimThrowMistBall,
}; };
static const u8 sUnknown_08595C88[] = static const u8 wMistBlendAmounts[] =
{ {
0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5,
}; };
@ -524,7 +524,7 @@ const struct SpriteTemplate gIceBallImpactShardSpriteTemplate =
}; };
// Unused // Unused
static void sub_810B6C4(struct Sprite *sprite) static void AnimUnused_810B6C4(struct Sprite *sprite)
{ {
s16 targetX, targetY, attackerX, attackerY; s16 targetX, targetY, attackerX, attackerY;
@ -560,10 +560,10 @@ static void sub_810B6C4(struct Sprite *sprite)
sub_80A64EC(sprite); sub_80A64EC(sprite);
sprite->data[3] = gBattleAnimArgs[5]; sprite->data[3] = gBattleAnimArgs[5];
sprite->data[4] = gBattleAnimArgs[6]; sprite->data[4] = gBattleAnimArgs[6];
sprite->callback = sub_810B848; sprite->callback = AnimUnused_810B6C4_Step;
} }
static void sub_810B848(struct Sprite *sprite) static void AnimUnused_810B6C4_Step(struct Sprite *sprite)
{ {
if (sprite->data[0] != 0) if (sprite->data[0] != 0)
{ {
@ -998,15 +998,15 @@ 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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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(&gFogPalette, animBg.paletteId * 16, 32);
gTasks[taskId].func = AnimTask_Haze2; gTasks[taskId].func = AnimTask_HazeScrollingFog_Step;
} }
static void AnimTask_Haze2(u8 taskId) static void AnimTask_HazeScrollingFog_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -1020,7 +1020,7 @@ static void AnimTask_Haze2(u8 taskId)
{ {
gTasks[taskId].data[10] = 0; gTasks[taskId].data[10] = 0;
gTasks[taskId].data[9]++; gTasks[taskId].data[9]++;
gTasks[taskId].data[11] = sUnknown_08595C5C[gTasks[taskId].data[9]]; gTasks[taskId].data[11] = sHazeBlendAmounts[gTasks[taskId].data[9]];
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 16 - gTasks[taskId].data[11]));
if (gTasks[taskId].data[11] == 9) if (gTasks[taskId].data[11] == 9)
@ -1052,12 +1052,10 @@ static void AnimTask_Haze2(u8 taskId)
} }
break; break;
case 3: case 3:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(1); ClearBattleAnimBg(1);
sub_80A6C68(2); ClearBattleAnimBg(2);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
// fall through // fall through
case 4: case 4:
if (!IsContest()) if (!IsContest())
@ -1105,16 +1103,16 @@ 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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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(&gFogPalette, animBg.paletteId * 16, 32);
gTasks[taskId].data[15] = -1; gTasks[taskId].data[15] = -1;
gTasks[taskId].func = AnimTask_OverlayFogTiles; gTasks[taskId].func = AnimTask_LoadMistTiles_Step;
} }
static void AnimTask_OverlayFogTiles(u8 taskId) static void AnimTask_LoadMistTiles_Step(u8 taskId)
{ {
struct BattleAnimBgData animBg; struct BattleAnimBgData animBg;
@ -1125,7 +1123,7 @@ static void AnimTask_OverlayFogTiles(u8 taskId)
{ {
case 0: case 0:
gTasks[taskId].data[9] += 1; gTasks[taskId].data[9] += 1;
gTasks[taskId].data[11] = sUnknown_08595C88[gTasks[taskId].data[9]]; gTasks[taskId].data[11] = wMistBlendAmounts[gTasks[taskId].data[9]];
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 17 - gTasks[taskId].data[11])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 17 - gTasks[taskId].data[11]));
if (gTasks[taskId].data[11] == 5) if (gTasks[taskId].data[11] == 5)
{ {
@ -1154,9 +1152,9 @@ static void AnimTask_OverlayFogTiles(u8 taskId)
} }
break; break;
case 3: case 3:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(1); ClearBattleAnimBg(1);
sub_80A6C68(2); ClearBattleAnimBg(2);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;

View File

@ -849,7 +849,7 @@ bool8 IsDoubleBattle(void)
return IS_DOUBLE_BATTLE(); return IS_DOUBLE_BATTLE();
} }
void GetDefaultBattleAnimBgData(struct BattleAnimBgData *out) void GetBattleAnimBg1Data(struct BattleAnimBgData *out)
{ {
if (IsContest()) if (IsContest())
{ {
@ -871,68 +871,68 @@ void GetDefaultBattleAnimBgData(struct BattleAnimBgData *out)
} }
} }
void sub_80A6B90(struct BattleAnimBgData *unk, u32 arg1) void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId)
{ {
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 if (arg1 == 1) else if (bgId == 1)
{ {
GetDefaultBattleAnimBgData(unk); GetBattleAnimBg1Data(out);
} }
else else
{ {
unk->bgTiles = gUnknown_0202305C; out->bgTiles = gUnknown_0202305C;
unk->bgTilemap = (u16 *)gUnknown_02023060; out->bgTilemap = (u16 *)gUnknown_02023060;
unk->paletteId = 9; out->paletteId = 9;
unk->bgId = 2; out->bgId = 2;
unk->tilesOffset = 0x300; out->tilesOffset = 0x300;
unk->unused = 0; out->unused = 0;
} }
} }
void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused) void sub_80A6BFC(struct BattleAnimBgData *out, u8 unused)
{ {
unk->bgTiles = gUnknown_0202305C; out->bgTiles = gUnknown_0202305C;
unk->bgTilemap = (u16 *)gUnknown_02023060; out->bgTilemap = (u16 *)gUnknown_02023060;
if (IsContest()) if (IsContest())
{ {
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 if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1) else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1)
{ {
unk->paletteId = 8; out->paletteId = 8;
unk->bgId = 1; out->bgId = 1;
unk->tilesOffset = 0x200; out->tilesOffset = 0x200;
unk->unused = 0; out->unused = 0;
} }
else else
{ {
unk->paletteId = 9; out->paletteId = 9;
unk->bgId = 2; out->bgId = 2;
unk->tilesOffset = 0x300; out->tilesOffset = 0x300;
unk->unused = 0; out->unused = 0;
} }
} }
void sub_80A6C68(u32 bgId) void ClearBattleAnimBg(u32 bgId)
{ {
struct BattleAnimBgData unkStruct; struct BattleAnimBgData bgAnimData;
sub_80A6B90(&unkStruct, bgId); GetBattleAnimBgData(&bgAnimData, bgId);
CpuFill32(0, unkStruct.bgTiles, 0x2000); CpuFill32(0, bgAnimData.bgTiles, 0x2000);
LoadBgTiles(unkStruct.bgId, unkStruct.bgTiles, 0x2000, unkStruct.tilesOffset); LoadBgTiles(bgAnimData.bgId, bgAnimData.bgTiles, 0x2000, bgAnimData.tilesOffset);
FillBgTilemapBufferRect(unkStruct.bgId, 0, 0, 0, 32, 64, 17); FillBgTilemapBufferRect(bgAnimData.bgId, 0, 0, 0, 32, 64, 17);
CopyBgTilemapBufferToVram(unkStruct.bgId); CopyBgTilemapBufferToVram(bgAnimData.bgId);
} }
void AnimLoadCompressedBgGfx(u32 bgId, const u32 *src, u32 tilesOffset) void AnimLoadCompressedBgGfx(u32 bgId, const u32 *src, u32 tilesOffset)
@ -1339,7 +1339,7 @@ void SetGreyscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor)
} }
} }
u32 sub_80A75AC(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7) u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7)
{ {
u32 selectedPalettes = 0; u32 selectedPalettes = 0;
u32 shift; u32 shift;
@ -1392,54 +1392,54 @@ u32 sub_80A75AC(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner,
return selectedPalettes; return selectedPalettes;
} }
u32 sub_80A76C4(u8 a1, u8 a2, u8 a3, u8 a4) u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight)
{ {
u32 var = 0; u32 selectedPalettes = 0;
u32 shift; u32 shift;
if (IsContest()) if (IsContest())
{ {
if (a1) if (playerLeft)
{ {
var |= 1 << 18; selectedPalettes |= 1 << 18;
return var; return selectedPalettes;
} }
} }
else else
{ {
if (a1) if (playerLeft)
{ {
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_LEFT))) if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)))
{ {
var |= 1 << (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) + 16); selectedPalettes |= 1 << (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) + 16);
} }
} }
if (a2) if (playerRight)
{ {
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT))) if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)))
{ {
shift = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT) + 16; shift = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT) + 16;
var |= 1 << shift; selectedPalettes |= 1 << shift;
} }
} }
if (a3) if (opponentLeft)
{ {
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT))) if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)))
{ {
shift = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT) + 16; shift = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT) + 16;
var |= 1 << shift; selectedPalettes |= 1 << shift;
} }
} }
if (a4) if (opponentRight)
{ {
if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT))) if (IsBattlerSpriteVisible(GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)))
{ {
shift = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT) + 16; shift = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT) + 16;
var |= 1 << shift; selectedPalettes |= 1 << shift;
} }
} }
} }
return var; return selectedPalettes;
} }
// Presumably something commented here, just returns arg // Presumably something commented here, just returns arg
@ -2261,7 +2261,7 @@ void SetAverageBattlerPositions(u8 battlerId, bool8 respectMonPicOffsets, s16 *x
*y = (battlerY + partnerY) / 2; *y = (battlerY + partnerY) / 2;
} }
u8 sub_80A89C8(int battlerId, u8 spriteId, int species) u8 CreateInvisibleSpriteCopy(int battlerId, u8 spriteId, int species)
{ {
u8 newSpriteId = CreateInvisibleSpriteWithCallback(SpriteCallbackDummy); u8 newSpriteId = CreateInvisibleSpriteWithCallback(SpriteCallbackDummy);
gSprites[newSpriteId] = gSprites[spriteId]; gSprites[newSpriteId] = gSprites[spriteId];
@ -2273,7 +2273,7 @@ u8 sub_80A89C8(int battlerId, u8 spriteId, int species)
return newSpriteId; return newSpriteId;
} }
void sub_80A8A6C(struct Sprite *sprite) void AnimUnused_80A8A6C(struct Sprite *sprite)
{ {
SetSpriteCoordsToAnimAttackerCoords(sprite); SetSpriteCoordsToAnimAttackerCoords(sprite);
if (GetBattlerSide(gBattleAnimAttacker)) if (GetBattlerSide(gBattleAnimAttacker))
@ -2295,7 +2295,8 @@ void sub_80A8A6C(struct Sprite *sprite)
sprite->callback = TranslateSpriteLinearAndFlicker; sprite->callback = TranslateSpriteLinearAndFlicker;
} }
void sub_80A8AEC(struct Sprite *sprite) // Used by three different unused battle anim sprite templates.
void AnimUnused_80A8AEC(struct Sprite *sprite)
{ {
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
{ {

View File

@ -12,7 +12,7 @@ static void AnimSimplePaletteBlend_Step(struct Sprite *);
static void AnimComplexPaletteBlend(struct Sprite *); static void AnimComplexPaletteBlend(struct Sprite *);
static void AnimComplexPaletteBlend_Step1(struct Sprite *); static void AnimComplexPaletteBlend_Step1(struct Sprite *);
static void AnimComplexPaletteBlend_Step2(struct Sprite *); static void AnimComplexPaletteBlend_Step2(struct Sprite *);
static void sub_81159B4(struct Sprite *); static void AnimUnused_81159B4(struct Sprite *);
static void AnimShakeMonOrBattleTerrain(struct Sprite *); static void AnimShakeMonOrBattleTerrain(struct Sprite *);
static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *); static void AnimShakeMonOrBattleTerrain_Step(struct Sprite *);
static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void); static void AnimShakeMonOrBattleTerrain_UpdateCoordOffsetEnabled(void);
@ -92,7 +92,7 @@ const struct SpriteTemplate gComplexPaletteBlendSpriteTemplate =
.callback = AnimComplexPaletteBlend, .callback = AnimComplexPaletteBlend,
}; };
static const union AnimCmd gUnknown_085972A4[] = static const union AnimCmd sAnim_Unused_085972A4[] =
{ {
ANIMCMD_FRAME(0, 3), ANIMCMD_FRAME(0, 3),
ANIMCMD_FRAME(16, 3), ANIMCMD_FRAME(16, 3),
@ -102,21 +102,21 @@ static const union AnimCmd gUnknown_085972A4[] =
ANIMCMD_JUMP(0), ANIMCMD_JUMP(0),
}; };
static const union AnimCmd *const gUnknown_085972BC[] = static const union AnimCmd *const sAnims_Unused_085972BC[] =
{ {
gUnknown_085972A4, sAnim_Unused_085972A4,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_085972C0 = const struct SpriteTemplate gUnusedSpriteTemplate_085972C0 =
{ {
.tileTag = ANIM_TAG_SPARKLE_4, .tileTag = ANIM_TAG_SPARKLE_4,
.paletteTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = gUnknown_085972BC, .anims = sAnims_Unused_085972BC,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_81159B4, .callback = AnimUnused_81159B4,
}; };
const struct SpriteTemplate gShakeMonOrTerrainSpriteTemplate = const struct SpriteTemplate gShakeMonOrTerrainSpriteTemplate =
@ -304,7 +304,7 @@ static void AnimConfusionDuck_Step(struct Sprite *sprite)
// arg 4: blend color // arg 4: blend color
static void AnimSimplePaletteBlend(struct Sprite *sprite) static void AnimSimplePaletteBlend(struct Sprite *sprite)
{ {
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]); u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]); BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]);
sprite->invisible = TRUE; sprite->invisible = TRUE;
sprite->callback = AnimSimplePaletteBlend_Step; sprite->callback = AnimSimplePaletteBlend_Step;
@ -319,7 +319,7 @@ static void AnimSimplePaletteBlend(struct Sprite *sprite)
// 4: gBattleAnimTarget partner OBJ palette // 4: gBattleAnimTarget partner OBJ palette
// 5: BG palette 4 // 5: BG palette 4
// 6: BG palette 5 // 6: BG palette 5
u32 UnpackSelectedBattleAnimPalettes(s16 selector) u32 UnpackSelectedBattleBgPalettes(s16 selector)
{ {
u8 battleBackground = selector & 1; u8 battleBackground = selector & 1;
u8 attacker = (selector >> 1) & 1; u8 attacker = (selector >> 1) & 1;
@ -328,7 +328,7 @@ u32 UnpackSelectedBattleAnimPalettes(s16 selector)
u8 targetPartner = (selector >> 4) & 1; u8 targetPartner = (selector >> 4) & 1;
u8 arg5 = (selector >> 5) & 1; u8 arg5 = (selector >> 5) & 1;
u8 arg6 = (selector >> 6) & 1; u8 arg6 = (selector >> 6) & 1;
return sub_80A75AC(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6); return GetBattleBgPalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6);
} }
static void AnimSimplePaletteBlend_Step(struct Sprite *sprite) static void AnimSimplePaletteBlend_Step(struct Sprite *sprite)
@ -350,7 +350,7 @@ static void AnimComplexPaletteBlend(struct Sprite *sprite)
sprite->data[6] = gBattleAnimArgs[6]; sprite->data[6] = gBattleAnimArgs[6];
sprite->data[7] = gBattleAnimArgs[0]; sprite->data[7] = gBattleAnimArgs[0];
selectedPalettes = UnpackSelectedBattleAnimPalettes(sprite->data[7]); selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]); BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]);
sprite->invisible = TRUE; sprite->invisible = TRUE;
sprite->callback = AnimComplexPaletteBlend_Step1; sprite->callback = AnimComplexPaletteBlend_Step1;
@ -375,7 +375,7 @@ static void AnimComplexPaletteBlend_Step1(struct Sprite *sprite)
return; return;
} }
selectedPalettes = UnpackSelectedBattleAnimPalettes(sprite->data[7]); selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
if (sprite->data[1] & 0x100) if (sprite->data[1] & 0x100)
BlendPalettes(selectedPalettes, sprite->data[4], sprite->data[3]); BlendPalettes(selectedPalettes, sprite->data[4], sprite->data[3]);
else else
@ -392,13 +392,13 @@ static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite)
if (!gPaletteFade.active) if (!gPaletteFade.active)
{ {
selectedPalettes = UnpackSelectedBattleAnimPalettes(sprite->data[7]); selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
BlendPalettes(selectedPalettes, 0, 0); BlendPalettes(selectedPalettes, 0, 0);
DestroyAnimSprite(sprite); DestroyAnimSprite(sprite);
} }
} }
static void sub_81159B4(struct Sprite *sprite) static void AnimUnused_81159B4(struct Sprite *sprite)
{ {
sprite->pos1.x += gBattleAnimArgs[0]; sprite->pos1.x += gBattleAnimArgs[0];
sprite->pos1.y += gBattleAnimArgs[1]; sprite->pos1.y += gBattleAnimArgs[1];
@ -442,7 +442,7 @@ void AnimTask_BlendColorCycle(u8 taskId)
static void BlendColorCycle(u8 taskId, u8 startBlendAmount, u8 targetBlendAmount) static void BlendColorCycle(u8 taskId, u8 startBlendAmount, u8 targetBlendAmount)
{ {
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gTasks[taskId].tPalSelector); u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gTasks[taskId].tPalSelector);
BeginNormalPaletteFade( BeginNormalPaletteFade(
selectedPalettes, selectedPalettes,
gTasks[taskId].tDelay, gTasks[taskId].tDelay,
@ -721,7 +721,7 @@ void AnimTask_InvertScreenColor(u8 taskId)
u8 targetBattler = gBattleAnimTarget; u8 targetBattler = gBattleAnimTarget;
if (gBattleAnimArgs[0] & 0x100) if (gBattleAnimArgs[0] & 0x100)
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
if (gBattleAnimArgs[1] & 0x100) if (gBattleAnimArgs[1] & 0x100)
selectedPalettes |= (0x10000 << attackerBattler); selectedPalettes |= (0x10000 << attackerBattler);
@ -733,7 +733,7 @@ void AnimTask_InvertScreenColor(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
void sub_8115F94(u8 taskId) void UnusedAnimTask_8115F94(u8 taskId)
{ {
u8 attackerBattler; u8 attackerBattler;
u8 targetBattler; u8 targetBattler;

View File

@ -565,14 +565,14 @@ static void AnimDefensiveWall_Step5(struct Sprite *sprite)
u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); u8 battler = battlerCopy = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
u8 rank = GetBattlerSpriteBGPriorityRank(battler); u8 rank = GetBattlerSpriteBGPriorityRank(battler);
int var0 = 1; int var0 = 1;
u8 toBG_2 = (rank ^ var0) != 0; bool8 toBG2 = (rank ^ var0) != 0;
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
sub_80A477C(toBG_2); ResetBattleAnimBg(toBG2);
battler = battlerCopy ^ 2; battler = battlerCopy ^ 2;
if (IsBattlerSpriteVisible(battler)) if (IsBattlerSpriteVisible(battler))
sub_80A477C(toBG_2 ^ var0); ResetBattleAnimBg(toBG2 ^ var0);
} }
sprite->callback = DestroyAnimSprite; sprite->callback = DestroyAnimSprite;
@ -836,7 +836,7 @@ static void AnimTask_ImprisonOrbs_Step(u8 taskId)
} }
} }
static void sub_810FB60(struct Sprite *sprite) static void AnimRedx_Step(struct Sprite *sprite)
{ {
if (sprite->data[1] > sprite->data[0] - 10) if (sprite->data[1] > sprite->data[0] - 10)
sprite->invisible = sprite->data[1] & 1; sprite->invisible = sprite->data[1] & 1;
@ -856,7 +856,7 @@ static void AnimRedX(struct Sprite *sprite)
} }
sprite->data[0] = gBattleAnimArgs[1]; sprite->data[0] = gBattleAnimArgs[1];
sprite->callback = sub_810FB60; sprite->callback = AnimRedx_Step;
} }
void AnimTask_SkillSwap(u8 taskId) void AnimTask_SkillSwap(u8 taskId)

View File

@ -24,7 +24,7 @@ static void AnimRockScatter_Step(struct Sprite *sprite);
static void AnimParticleInVortex(struct Sprite *); static void AnimParticleInVortex(struct Sprite *);
static void AnimParticleInVortex_Step(struct Sprite *sprite); static void AnimParticleInVortex_Step(struct Sprite *sprite);
static void AnimTask_LoadSandstormBackground_Step(u8 taskId); static void AnimTask_LoadSandstormBackground_Step(u8 taskId);
static void sub_8111214(struct Task *task); static void CreateRolloutDirtSprite(struct Task *task);
static u8 GetRolloutCounter(void); static u8 GetRolloutCounter(void);
static const union AnimCmd sAnim_FlyingRock_0[] = static const union AnimCmd sAnim_FlyingRock_0[] =
@ -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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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,8 +470,8 @@ static void AnimTask_LoadSandstormBackground_Step(u8 taskId)
} }
break; break;
case 3: case 3:
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&animBg);
sub_80A6C68(animBg.bgId); ClearBattleAnimBg(animBg.bgId);
gTasks[taskId].data[12]++; gTasks[taskId].data[12]++;
break; break;
case 4: case 4:
@ -659,7 +659,7 @@ static void AnimTask_Rollout_Step(u8 taskId)
if (++task->data[9] >= task->data[10]) if (++task->data[9] >= task->data[10])
{ {
task->data[9] = 0; task->data[9] = 0;
sub_8111214(task); CreateRolloutDirtSprite(task);
task->data[13] += task->data[14]; task->data[13] += task->data[14];
PlaySE12WithPanning(SE_M_DIG, task->data[13]); PlaySE12WithPanning(SE_M_DIG, task->data[13]);
} }
@ -676,7 +676,7 @@ static void AnimTask_Rollout_Step(u8 taskId)
} }
} }
static void sub_8111214(struct Task *task) static void CreateRolloutDirtSprite(struct Task *task)
{ {
const struct SpriteTemplate *spriteTemplate; const struct SpriteTemplate *spriteTemplate;
int tileOffset; int tileOffset;

View File

@ -125,7 +125,7 @@ const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow =
.data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = 55129 .data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = 55129
}; };
static const struct OamData gUnknown_0831C6A8 = static const struct OamData sOamData_EnemyShadow =
{ {
.y = 0, .y = 0,
.affineMode = ST_OAM_AFFINE_OFF, .affineMode = ST_OAM_AFFINE_OFF,
@ -146,7 +146,7 @@ const struct SpriteTemplate gSpriteTemplate_EnemyShadow =
{ {
.tileTag = 55129, .tileTag = 55129,
.paletteTag = 55039, .paletteTag = 55039,
.oam = &gUnknown_0831C6A8, .oam = &sOamData_EnemyShadow,
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,

View File

@ -17,18 +17,16 @@ extern const u8 *const gBattleAnims_StatusConditions[];
extern const struct OamData gOamData_AffineOff_ObjNormal_8x8; extern const struct OamData gOamData_AffineOff_ObjNormal_8x8;
extern const struct OamData gOamData_AffineOff_ObjBlend_64x64; extern const struct OamData gOamData_AffineOff_ObjBlend_64x64;
// This file's functions. static void UnusedTask_80A9DB4(u8 taskId);
static void sub_80A9DB4(u8 taskId);
static void AnimTask_FrozenIceCube_Step1(u8 taskId); static void AnimTask_FrozenIceCube_Step1(u8 taskId);
static void AnimTask_FrozenIceCube_Step2(u8 taskId); static void AnimTask_FrozenIceCube_Step2(u8 taskId);
static void AnimTask_FrozenIceCube_Step3(u8 taskId); static void AnimTask_FrozenIceCube_Step3(u8 taskId);
static void AnimTask_FrozenIceCube_Step4(u8 taskId); static void AnimTask_FrozenIceCube_Step4(u8 taskId);
static void Task_DoStatusAnimation(u8 taskId); static void Task_DoStatusAnimation(u8 taskId);
static void sub_80A9E44(struct Sprite *sprite); static void AnimUnused_80A9E44(struct Sprite *sprite);
static void sub_80A9E78(struct Sprite *sprite); static void AnimUnused_80A9E44_Step(struct Sprite *sprite);
// const rom data static const union AnimCmd sAnim_Unused_853EDE4[] =
static const union AnimCmd sSpriteAnim_853EDE4[] =
{ {
ANIMCMD_FRAME(0, 3), ANIMCMD_FRAME(0, 3),
ANIMCMD_FRAME(4, 3), ANIMCMD_FRAME(4, 3),
@ -37,33 +35,33 @@ static const union AnimCmd sSpriteAnim_853EDE4[] =
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
static const union AnimCmd *const sSpriteAnimTable_853EDF8[] = static const union AnimCmd *const sAnims_Unused_853EDF8[] =
{ {
sSpriteAnim_853EDE4 sAnim_Unused_853EDE4
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_0853EDFC = const struct SpriteTemplate gUnusedSpriteTemplate_0853EDFC =
{ {
.tileTag = ANIM_TAG_ORB, .tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB, .paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16, .oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EDF8, .anims = sAnims_Unused_853EDF8,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80A8AEC, .callback = AnimUnused_80A8AEC,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_0853EE14 = const struct SpriteTemplate gUnusedSpriteTemplate_0853EE14 =
{ {
.tileTag = ANIM_TAG_ORB, .tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB, .paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineOff_ObjNormal_16x16, .oam = &gOamData_AffineOff_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EDF8, .anims = sAnims_Unused_853EDF8,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80A8A6C, .callback = AnimUnused_80A8A6C,
}; };
static const union AnimCmd sAnim_WeatherBallNormal[] = static const union AnimCmd sAnim_WeatherBallNormal[] =
@ -99,7 +97,7 @@ const struct SpriteTemplate gWeatherBallNormalDownSpriteTemplate =
.callback = AnimWeatherBallDown, .callback = AnimWeatherBallDown,
}; };
static const union AnimCmd sSpriteAnim_853EE68[] = static const union AnimCmd sAnim_SpinningSparkle[] =
{ {
ANIMCMD_FRAME(0, 3), ANIMCMD_FRAME(0, 3),
ANIMCMD_FRAME(16, 3), ANIMCMD_FRAME(16, 3),
@ -109,9 +107,9 @@ static const union AnimCmd sSpriteAnim_853EE68[] =
ANIMCMD_END ANIMCMD_END
}; };
static const union AnimCmd *const sSpriteAnimTable_853EE80[] = static const union AnimCmd *const sAnims_SpinningSparkle[] =
{ {
sSpriteAnim_853EE68 sAnim_SpinningSparkle
}; };
const struct SpriteTemplate gSpinningSparkleSpriteTemplate = const struct SpriteTemplate gSpinningSparkleSpriteTemplate =
@ -119,14 +117,14 @@ const struct SpriteTemplate gSpinningSparkleSpriteTemplate =
.tileTag = ANIM_TAG_SPARKLE_4, .tileTag = ANIM_TAG_SPARKLE_4,
.paletteTag = ANIM_TAG_SPARKLE_4, .paletteTag = ANIM_TAG_SPARKLE_4,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EE80, .anims = sAnims_SpinningSparkle,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimSpinningSparkle, .callback = AnimSpinningSparkle,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_0853EE9C = const struct SpriteTemplate gUnusedSpriteTemplate_0853EE9C =
{ {
.tileTag = ANIM_TAG_MONSTER_FOOT, .tileTag = ANIM_TAG_MONSTER_FOOT,
.paletteTag = ANIM_TAG_MONSTER_FOOT, .paletteTag = ANIM_TAG_MONSTER_FOOT,
@ -134,78 +132,79 @@ const struct SpriteTemplate gUnknown_0853EE9C =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80A8AEC, .callback = AnimUnused_80A8AEC,
}; };
static const union AnimCmd sSpriteAnim_853EEB4[] = static const union AnimCmd sAnim_Unused_853EEB4[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
static const union AnimCmd sSpriteAnim_853EEBC[] = static const union AnimCmd sAnim_Unused_853EEBC[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
static const union AnimCmd sSpriteAnim_853EEC4[] = static const union AnimCmd sAnim_Unused_853EEC4[] =
{ {
ANIMCMD_FRAME(0, 5), ANIMCMD_FRAME(0, 5),
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
static const union AnimCmd *const sSpriteAnimTable_853EECC[] = static const union AnimCmd *const sAnims_Unused_853EECC[] =
{ {
sSpriteAnim_853EEB4, sAnim_Unused_853EEB4,
sSpriteAnim_853EEBC, sAnim_Unused_853EEBC,
sSpriteAnim_853EEC4 sAnim_Unused_853EEC4,
}; };
// Unused // Unused
const struct SpriteTemplate gUnknown_0853EED8 = const struct SpriteTemplate gUnusedSpriteTemplate_0853EED8 =
{ {
.tileTag = ANIM_TAG_IMPACT, .tileTag = ANIM_TAG_IMPACT,
.paletteTag = ANIM_TAG_IMPACT, .paletteTag = ANIM_TAG_IMPACT,
.oam = &gOamData_AffineOff_ObjNormal_32x32, .oam = &gOamData_AffineOff_ObjNormal_32x32,
.anims = sSpriteAnimTable_853EECC, .anims = sAnims_Unused_853EECC,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80A8AEC, .callback = AnimUnused_80A8AEC,
}; };
static const union AnimCmd sSpriteAnim_853EEF0[] = static const union AnimCmd sAnim_Unused_853EEF0[] =
{ {
ANIMCMD_FRAME(0, 15), ANIMCMD_FRAME(0, 15),
ANIMCMD_JUMP(0) ANIMCMD_JUMP(0)
}; };
static const union AnimCmd *const sSpriteAnimTable_853EEF8[] = static const union AnimCmd *const sAnims_Unused_853EEF8[] =
{ {
sSpriteAnim_853EEF0 sAnim_Unused_853EEF0
}; };
static const union AffineAnimCmd sSpriteAffineAnim_853EEFC[] = static const union AffineAnimCmd sAffineAnim_Unused_853EEFC[] =
{ {
AFFINEANIMCMD_FRAME(96, 96, 0, 0), AFFINEANIMCMD_FRAME(96, 96, 0, 0),
AFFINEANIMCMD_FRAME(2, 2, 0, 1), AFFINEANIMCMD_FRAME(2, 2, 0, 1),
AFFINEANIMCMD_JUMP(1) AFFINEANIMCMD_JUMP(1)
}; };
static const union AffineAnimCmd *const sSpriteAffineAnimTable_853EEF8[] = static const union AffineAnimCmd *const sAffineAnims_Unused_853EEF8[] =
{ {
sSpriteAffineAnim_853EEFC sAffineAnim_Unused_853EEFC
}; };
const struct SpriteTemplate gUnknown_0853EF18 = // Unused
const struct SpriteTemplate gUnusedSpriteTemplate_0853EF18 =
{ {
.tileTag = ANIM_TAG_ORB, .tileTag = ANIM_TAG_ORB,
.paletteTag = ANIM_TAG_ORB, .paletteTag = ANIM_TAG_ORB,
.oam = &gOamData_AffineDouble_ObjNormal_16x16, .oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = sSpriteAnimTable_853EEF8, .anims = sAnims_Unused_853EEF8,
.images = NULL, .images = NULL,
.affineAnims = sSpriteAffineAnimTable_853EEF8, .affineAnims = sAffineAnims_Unused_853EEF8,
.callback = sub_80A8A6C, .callback = AnimUnused_80A8A6C,
}; };
static const struct Subsprite sFrozenIceCubeSubsprites[] = static const struct Subsprite sFrozenIceCubeSubsprites[] =
@ -260,7 +259,7 @@ static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate =
.callback = SpriteCallbackDummy, .callback = SpriteCallbackDummy,
}; };
static const struct SpriteTemplate gUnknown_0853EF60 = static const struct SpriteTemplate gUnusedSpriteTemplate_0853EF60 =
{ {
.tileTag = ANIM_TAG_CIRCLE_IMPACT, .tileTag = ANIM_TAG_CIRCLE_IMPACT,
.paletteTag = ANIM_TAG_CIRCLE_IMPACT, .paletteTag = ANIM_TAG_CIRCLE_IMPACT,
@ -268,14 +267,14 @@ static const struct SpriteTemplate gUnknown_0853EF60 =
.anims = gDummySpriteAnimTable, .anims = gDummySpriteAnimTable,
.images = NULL, .images = NULL,
.affineAnims = gDummySpriteAffineAnimTable, .affineAnims = gDummySpriteAffineAnimTable,
.callback = sub_80A9E44, .callback = AnimUnused_80A9E44,
}; };
// Unused // Unused
u8 sub_80A9C70(u8 battlerId, bool8 b) u8 Unused_80A9C70(u8 battlerId, bool8 b)
{ {
u8 battlerSpriteId = gBattlerSpriteIds[battlerId]; u8 battlerSpriteId = gBattlerSpriteIds[battlerId];
u8 taskId = CreateTask(sub_80A9DB4, 10); u8 taskId = CreateTask(UnusedTask_80A9DB4, 10);
u8 spriteId2; u8 spriteId2;
u8 i; u8 i;
@ -287,7 +286,7 @@ u8 sub_80A9C70(u8 battlerId, bool8 b)
gTasks[taskId].data[1] = RGB_RED; gTasks[taskId].data[1] = RGB_RED;
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
spriteId2 = CreateSprite(&gUnknown_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y + 32, 0); spriteId2 = CreateSprite(&gUnusedSpriteTemplate_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y + 32, 0);
gSprites[spriteId2].data[0] = i * 51; gSprites[spriteId2].data[0] = i * 51;
gSprites[spriteId2].data[1] = -256; gSprites[spriteId2].data[1] = -256;
gSprites[spriteId2].invisible = TRUE; gSprites[spriteId2].invisible = TRUE;
@ -300,7 +299,7 @@ u8 sub_80A9C70(u8 battlerId, bool8 b)
gTasks[taskId].data[1] = RGB_BLUE; gTasks[taskId].data[1] = RGB_BLUE;
for (i = 0; i < 10; i++) for (i = 0; i < 10; i++)
{ {
spriteId2 = CreateSprite(&gUnknown_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y - 32, 0); spriteId2 = CreateSprite(&gUnusedSpriteTemplate_0853EF60, gSprites[battlerSpriteId].pos1.x, gSprites[battlerSpriteId].pos1.y - 32, 0);
gSprites[spriteId2].data[0] = i * 51; gSprites[spriteId2].data[0] = i * 51;
gSprites[spriteId2].data[1] = 256; gSprites[spriteId2].data[1] = 256;
gSprites[spriteId2].invisible = TRUE; gSprites[spriteId2].invisible = TRUE;
@ -312,7 +311,7 @@ u8 sub_80A9C70(u8 battlerId, bool8 b)
return taskId; return taskId;
} }
static void sub_80A9DB4(u8 taskId) static void UnusedTask_80A9DB4(u8 taskId)
{ {
if (gTasks[taskId].data[2] == 2) if (gTasks[taskId].data[2] == 2)
{ {
@ -345,13 +344,13 @@ static void sub_80A9DB4(u8 taskId)
} }
} }
static void sub_80A9E44(struct Sprite *sprite) static void AnimUnused_80A9E44(struct Sprite *sprite)
{ {
if (sprite->data[6] == 0) if (sprite->data[6] == 0)
{ {
sprite->invisible = FALSE; sprite->invisible = FALSE;
sprite->callback = sub_80A9E78; sprite->callback = AnimUnused_80A9E44_Step;
sub_80A9E78(sprite); AnimUnused_80A9E44_Step(sprite);
} }
else else
{ {
@ -359,7 +358,7 @@ static void sub_80A9E44(struct Sprite *sprite)
} }
} }
static void sub_80A9E78(struct Sprite *sprite) static void AnimUnused_80A9E44_Step(struct Sprite *sprite)
{ {
sprite->pos2.x = Cos(sprite->data[0], 32); sprite->pos2.x = Cos(sprite->data[0], 32);
sprite->pos2.y = Sin(sprite->data[0], 8); sprite->pos2.y = Sin(sprite->data[0], 8);
@ -538,8 +537,8 @@ void AnimTask_StatsChange(u8 taskId)
gBattleAnimArgs[2] = 0; gBattleAnimArgs[2] = 0;
gBattleAnimArgs[3] = 0; gBattleAnimArgs[3] = 0;
gBattleAnimArgs[4] = sharply; gBattleAnimArgs[4] = sharply;
gTasks[taskId].func = sub_8116EB4; gTasks[taskId].func = InitStatsChangeAnimation;
sub_8116EB4(taskId); InitStatsChangeAnimation(taskId);
} }
#undef CASE #undef CASE

View File

@ -48,7 +48,7 @@ enum {
SHINY_STAR_DIAGONAL, SHINY_STAR_DIAGONAL,
}; };
static void sub_8170660(u8); static void AnimTask_UnusedLevelUpHealthBox_Step(u8);
static void AnimTask_FlashHealthboxOnLevelUp_Step(u8); static void AnimTask_FlashHealthboxOnLevelUp_Step(u8);
static void AnimTask_ThrowBall_Step(u8); static void AnimTask_ThrowBall_Step(u8);
static void SpriteCB_Ball_Throw(struct Sprite *); static void SpriteCB_Ball_Throw(struct Sprite *);
@ -429,9 +429,12 @@ static const struct SpriteTemplate sSafariRockSpriteTemplate =
extern const struct SpriteTemplate gWishStarSpriteTemplate; extern const struct SpriteTemplate gWishStarSpriteTemplate;
extern const struct SpriteTemplate gMiniTwinklingStarSpriteTemplate; extern const struct SpriteTemplate gMiniTwinklingStarSpriteTemplate;
void unref_sub_8170478(u8 taskId) // This is an unused function, but it seems likely that it was
// intended to be an additional effect during the level-up animation.
// It is an upward blue gradient effect on the mon's healthbox.
void AnimTask_UnusedLevelUpHealthBox(u8 taskId)
{ {
struct BattleAnimBgData unknownStruct; struct BattleAnimBgData animBgData;
u8 healthBoxSpriteId; u8 healthBoxSpriteId;
u8 battler; u8 battler;
u8 spriteId1, spriteId2, spriteId3, spriteId4; u8 spriteId1, spriteId2, spriteId3, spriteId4;
@ -464,20 +467,20 @@ void unref_sub_8170478(u8 taskId)
gSprites[spriteId3].callback = SpriteCallbackDummy; gSprites[spriteId3].callback = SpriteCallbackDummy;
gSprites[spriteId4].callback = SpriteCallbackDummy; gSprites[spriteId4].callback = SpriteCallbackDummy;
GetDefaultBattleAnimBgData(&unknownStruct); GetBattleAnimBg1Data(&animBgData);
AnimLoadCompressedBgTilemap(unknownStruct.bgId, gUnknown_08C2EA9C); AnimLoadCompressedBgTilemap(animBgData.bgId, UnusedLevelupAnimationTilemap);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C2EA50, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(animBgData.bgId, UnusedLevelupAnimationGfx, animBgData.tilesOffset);
LoadCompressedPalette(gCureBubblesPal, unknownStruct.paletteId << 4, 32); LoadCompressedPalette(gCureBubblesPal, animBgData.paletteId << 4, 32);
gBattle_BG1_X = -gSprites[spriteId3].pos1.x + 32; gBattle_BG1_X = -gSprites[spriteId3].pos1.x + 32;
gBattle_BG1_Y = -gSprites[spriteId3].pos1.y - 32; gBattle_BG1_Y = -gSprites[spriteId3].pos1.y - 32;
gTasks[taskId].data[1] = 640; gTasks[taskId].data[1] = 640;
gTasks[taskId].data[0] = spriteId3; gTasks[taskId].data[0] = spriteId3;
gTasks[taskId].data[2] = spriteId4; gTasks[taskId].data[2] = spriteId4;
gTasks[taskId].func = sub_8170660; gTasks[taskId].func = AnimTask_UnusedLevelUpHealthBox_Step;
} }
static void sub_8170660(u8 taskId) static void AnimTask_UnusedLevelUpHealthBox_Step(u8 taskId)
{ {
u8 spriteId1, spriteId2; u8 spriteId1, spriteId2;
u8 battler; u8 battler;
@ -511,7 +514,7 @@ static void sub_8170660(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
if (gTasks[taskId].data[12] == 0) if (gTasks[taskId].data[12] == 0)
{ {
sub_80A477C(0); ResetBattleAnimBg(0);
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
gBattle_WIN0V = 0; gBattle_WIN0V = 0;
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
@ -686,7 +689,7 @@ void AnimTask_SwitchOutBallEffect(u8 taskId)
priority = gSprites[spriteId].oam.priority; priority = gSprites[spriteId].oam.priority;
subpriority = gSprites[spriteId].subpriority; subpriority = gSprites[spriteId].subpriority;
gTasks[taskId].data[10] = AnimateBallOpenParticles(x, y + 32, priority, subpriority, ballId); gTasks[taskId].data[10] = AnimateBallOpenParticles(x, y + 32, priority, subpriority, ballId);
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
gTasks[taskId].data[11] = LaunchBallFadeMonTask(FALSE, gBattleAnimAttacker, selectedPalettes, ballId); gTasks[taskId].data[11] = LaunchBallFadeMonTask(FALSE, gBattleAnimAttacker, selectedPalettes, ballId);
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
break; break;

View File

@ -29,16 +29,16 @@ static void AnimTask_HardwarePaletteFade_Step(u8);
static void AnimTask_TraceMonBlended_Step(u8); static void AnimTask_TraceMonBlended_Step(u8);
static void AnimMonTrace(struct Sprite*); static void AnimMonTrace(struct Sprite*);
static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8); static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8);
static void sub_8116F04(u8); static void StatsChangeAnimation_Step1(u8);
static void sub_81170EC(u8); static void StatsChangeAnimation_Step2(u8);
static void sub_81172EC(u8); static void StatsChangeAnimation_Step3(u8);
static void AnimTask_Flash_Step(u8); static void AnimTask_Flash_Step(u8);
static void sub_81175C4(u32, u16); static void SetPalettesToColor(u32, u16);
static void AnimTask_UpdateSlidingBg(u8); static void AnimTask_UpdateSlidingBg(u8);
static void sub_8117A60(u8); static void UpdateMonScrollingBgMask(u8);
static void AnimTask_WaitAndRestoreVisibility(u8); static void AnimTask_WaitAndRestoreVisibility(u8);
const u16 gUnknown_08597418 = RGB(31, 31, 31); static const u16 wCurseLinesPalette[] = { RGB_WHITE };
// These belong in battle_intro.c, but putting them there causes 2 bytes of alignment padding // These belong in battle_intro.c, but putting them there causes 2 bytes of alignment padding
// between the two .rodata segments. Perhaps battle_intro.c actually belongs in this file, too. // between the two .rodata segments. Perhaps battle_intro.c actually belongs in this file, too.
@ -47,8 +47,8 @@ const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFS
void AnimTask_BlendBattleAnimPal(u8 taskId) void AnimTask_BlendBattleAnimPal(u8 taskId)
{ {
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]); u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
selectedPalettes |= sub_80A76C4((gBattleAnimArgs[0] >> 7) & 1, selectedPalettes |= GetBattleMonSpritePalettesMask((gBattleAnimArgs[0] >> 7) & 1,
(gBattleAnimArgs[0] >> 8) & 1, (gBattleAnimArgs[0] >> 8) & 1,
(gBattleAnimArgs[0] >> 9) & 1, (gBattleAnimArgs[0] >> 9) & 1,
(gBattleAnimArgs[0] >> 10) & 1); (gBattleAnimArgs[0] >> 10) & 1);
@ -62,7 +62,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
u8 animBattlers[2]; u8 animBattlers[2];
animBattlers[1] = 0xFF; animBattlers[1] = 0xFF;
selectedPalettes = UnpackSelectedBattleAnimPalettes(1); selectedPalettes = UnpackSelectedBattleBgPalettes(1);
switch (gBattleAnimArgs[0]) switch (gBattleAnimArgs[0])
{ {
case 2: case 2:
@ -105,7 +105,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
void AnimTask_SetCamouflageBlend(u8 taskId) void AnimTask_SetCamouflageBlend(u8 taskId)
{ {
u32 selectedPalettes = UnpackSelectedBattleAnimPalettes(gBattleAnimArgs[0]); u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
switch (gBattleTerrain) switch (gBattleTerrain)
{ {
case BATTLE_TERRAIN_GRASS: case BATTLE_TERRAIN_GRASS:
@ -278,7 +278,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
int spriteId, newSpriteId; int spriteId, newSpriteId;
u16 var0; u16 var0;
u16 bg1Cnt; u16 bg1Cnt;
struct BattleAnimBgData unknownStruct; struct BattleAnimBgData animBgData;
var0 = 0; var0 = 0;
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
@ -329,11 +329,11 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
} }
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER); spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
newSpriteId = sub_80A89C8(gBattleAnimAttacker, spriteId, species); newSpriteId = CreateInvisibleSpriteCopy(gBattleAnimAttacker, spriteId, species);
GetDefaultBattleAnimBgData(&unknownStruct); GetBattleAnimBg1Data(&animBgData);
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gUnknown_08C20684, 0); AnimLoadCompressedBgTilemapHandleContest(&animBgData, gBattleAnimMaskTilemap_Curse, 0);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gUnknown_08C20668, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(animBgData.bgId, gBattleAnimMaskImage_Curse, animBgData.tilesOffset);
LoadPalette(&gUnknown_08597418, unknownStruct.paletteId * 16 + 1, 2); LoadPalette(wCurseLinesPalette, animBgData.paletteId * 16 + 1, 2);
gBattle_BG1_X = -gSprites[spriteId].pos1.x + 32; gBattle_BG1_X = -gSprites[spriteId].pos1.x + 32;
gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32; gBattle_BG1_Y = -gSprites[spriteId].pos1.y + 32;
@ -344,7 +344,7 @@ void AnimTask_DrawFallingWhiteLinesOnAttacker(u8 taskId)
static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId) static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
{ {
struct BattleAnimBgData unknownStruct; struct BattleAnimBgData animBgData;
struct Sprite *sprite; struct Sprite *sprite;
u16 bg1Cnt; u16 bg1Cnt;
@ -356,7 +356,7 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
gBattle_BG1_Y += 64; gBattle_BG1_Y += 64;
if (++gTasks[taskId].data[11] == 4) if (++gTasks[taskId].data[11] == 4)
{ {
sub_80A477C(0); ResetBattleAnimBg(0);
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
gBattle_WIN0V = 0; gBattle_WIN0V = 0;
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR
@ -377,8 +377,8 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
sprite = &gSprites[gTasks[taskId].data[0]]; sprite = &gSprites[gTasks[taskId].data[0]];
DestroySprite(sprite); DestroySprite(sprite);
GetDefaultBattleAnimBgData(&unknownStruct); GetBattleAnimBg1Data(&animBgData);
sub_80A6C68(unknownStruct.bgId); ClearBattleAnimBg(animBgData.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++;
@ -388,7 +388,7 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
} }
} }
void sub_8116EB4(u8 taskId) void InitStatsChangeAnimation(u8 taskId)
{ {
u8 i; u8 i;
@ -396,10 +396,10 @@ void sub_8116EB4(u8 taskId)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
sAnimStatsChangeData->data[i] = gBattleAnimArgs[i]; sAnimStatsChangeData->data[i] = gBattleAnimArgs[i];
gTasks[taskId].func = sub_8116F04; gTasks[taskId].func = StatsChangeAnimation_Step1;
} }
static void sub_8116F04(u8 taskId) static void StatsChangeAnimation_Step1(u8 taskId)
{ {
if (sAnimStatsChangeData->data[2] == 0) if (sAnimStatsChangeData->data[2] == 0)
sAnimStatsChangeData->battler1 = gBattleAnimAttacker; sAnimStatsChangeData->battler1 = gBattleAnimAttacker;
@ -450,56 +450,56 @@ static void sub_8116F04(u8 taskId)
sAnimStatsChangeData->species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[sAnimStatsChangeData->battler1]], MON_DATA_SPECIES); sAnimStatsChangeData->species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[sAnimStatsChangeData->battler1]], MON_DATA_SPECIES);
} }
gTasks[taskId].func = sub_81170EC; gTasks[taskId].func = StatsChangeAnimation_Step2;
} }
static void sub_81170EC(u8 taskId) static void StatsChangeAnimation_Step2(u8 taskId)
{ {
struct BattleAnimBgData unknownStruct; struct BattleAnimBgData animBgData;
u8 spriteId, spriteId2; u8 spriteId, spriteId2;
u8 battlerSpriteId; u8 battlerSpriteId;
spriteId2 = 0; spriteId2 = 0;
battlerSpriteId = gBattlerSpriteIds[sAnimStatsChangeData->battler1]; battlerSpriteId = gBattlerSpriteIds[sAnimStatsChangeData->battler1];
spriteId = sub_80A89C8(sAnimStatsChangeData->battler1, battlerSpriteId, sAnimStatsChangeData->species); spriteId = CreateInvisibleSpriteCopy(sAnimStatsChangeData->battler1, battlerSpriteId, sAnimStatsChangeData->species);
if (sAnimStatsChangeData->data[3]) if (sAnimStatsChangeData->data[3])
{ {
battlerSpriteId = gBattlerSpriteIds[sAnimStatsChangeData->battler2]; battlerSpriteId = gBattlerSpriteIds[sAnimStatsChangeData->battler2];
spriteId2 = sub_80A89C8(sAnimStatsChangeData->battler2, battlerSpriteId, sAnimStatsChangeData->species); spriteId2 = CreateInvisibleSpriteCopy(sAnimStatsChangeData->battler2, battlerSpriteId, sAnimStatsChangeData->species);
} }
GetDefaultBattleAnimBgData(&unknownStruct); GetBattleAnimBg1Data(&animBgData);
if (sAnimStatsChangeData->data[0] == 0) if (sAnimStatsChangeData->data[0] == 0)
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gBattleStatMask1_Tilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&animBgData, gBattleStatMask1_Tilemap, 0);
else else
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, gBattleStatMask2_Tilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&animBgData, gBattleStatMask2_Tilemap, 0);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gBattleStatMask_Gfx, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(animBgData.bgId, gBattleStatMask_Gfx, animBgData.tilesOffset);
switch (sAnimStatsChangeData->data[1]) switch (sAnimStatsChangeData->data[1])
{ {
case 0: case 0:
LoadCompressedPalette(gBattleStatMask2_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask2_Pal, animBgData.paletteId * 16, 32);
break; break;
case 1: case 1:
LoadCompressedPalette(gBattleStatMask1_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask1_Pal, animBgData.paletteId * 16, 32);
break; break;
case 2: case 2:
LoadCompressedPalette(gBattleStatMask3_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask3_Pal, animBgData.paletteId * 16, 32);
break; break;
case 3: case 3:
LoadCompressedPalette(gBattleStatMask4_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask4_Pal, animBgData.paletteId * 16, 32);
break; break;
case 4: case 4:
LoadCompressedPalette(gBattleStatMask6_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask6_Pal, animBgData.paletteId * 16, 32);
break; break;
case 5: case 5:
LoadCompressedPalette(gBattleStatMask7_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask7_Pal, animBgData.paletteId * 16, 32);
break; break;
case 6: case 6:
LoadCompressedPalette(gBattleStatMask8_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask8_Pal, animBgData.paletteId * 16, 32);
break; break;
default: default:
LoadCompressedPalette(gBattleStatMask5_Pal, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(gBattleStatMask5_Pal, animBgData.paletteId * 16, 32);
break; break;
} }
@ -532,7 +532,7 @@ static void sub_81170EC(u8 taskId)
gTasks[taskId].data[3] = spriteId2; gTasks[taskId].data[3] = spriteId2;
gTasks[taskId].data[6] = sAnimStatsChangeData->higherPriority; gTasks[taskId].data[6] = sAnimStatsChangeData->higherPriority;
gTasks[taskId].data[7] = gBattlerSpriteIds[sAnimStatsChangeData->battler2]; gTasks[taskId].data[7] = gBattlerSpriteIds[sAnimStatsChangeData->battler2];
gTasks[taskId].func = sub_81172EC; gTasks[taskId].func = StatsChangeAnimation_Step3;
if (sAnimStatsChangeData->data[0] == 0) if (sAnimStatsChangeData->data[0] == 0)
PlaySE12WithPanning(SE_M_STAT_INCREASE, BattleAnimAdjustPanning2(-64)); PlaySE12WithPanning(SE_M_STAT_INCREASE, BattleAnimAdjustPanning2(-64));
@ -540,7 +540,7 @@ static void sub_81170EC(u8 taskId)
PlaySE12WithPanning(SE_M_STAT_DECREASE, BattleAnimAdjustPanning2(-64)); PlaySE12WithPanning(SE_M_STAT_DECREASE, BattleAnimAdjustPanning2(-64));
} }
static void sub_81172EC(u8 taskId) static void StatsChangeAnimation_Step3(u8 taskId)
{ {
gBattle_BG1_Y += gTasks[taskId].data[1]; gBattle_BG1_Y += gTasks[taskId].data[1];
@ -568,7 +568,7 @@ static void sub_81172EC(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
if (gTasks[taskId].data[12] == 0) if (gTasks[taskId].data[12] == 0)
{ {
sub_80A477C(0); ResetBattleAnimBg(0);
gTasks[taskId].data[15]++; gTasks[taskId].data[15]++;
} }
} }
@ -603,12 +603,12 @@ static void sub_81172EC(u8 taskId)
void AnimTask_Flash(u8 taskId) void AnimTask_Flash(u8 taskId)
{ {
u32 selectedPalettes = sub_80A76C4(1, 1, 1, 1); u32 selectedPalettes = GetBattleMonSpritePalettesMask(1, 1, 1, 1);
sub_81175C4(selectedPalettes, 0); SetPalettesToColor(selectedPalettes, RGB_BLACK);
gTasks[taskId].data[14] = selectedPalettes >> 16; gTasks[taskId].data[14] = selectedPalettes >> 16;
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0) & 0xFFFF; selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
sub_81175C4(selectedPalettes, 0xFFFF); SetPalettesToColor(selectedPalettes, RGB_WHITEALPHA);
gTasks[taskId].data[15] = selectedPalettes; gTasks[taskId].data[15] = selectedPalettes;
gTasks[taskId].data[0] = 0; gTasks[taskId].data[0] = 0;
@ -662,7 +662,7 @@ static void AnimTask_Flash_Step(u8 taskId)
} }
} }
static void sub_81175C4(u32 selectedPalettes, u16 color) static void SetPalettesToColor(u32 selectedPalettes, u16 color)
{ {
u16 i; u16 i;
@ -756,8 +756,6 @@ void AnimTask_GetTargetIsAttackerPartner(u8 taskId)
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
#define tInvisible gBattleAnimArgs[0];
// For hiding or subsequently revealing all other battlers // For hiding or subsequently revealing all other battlers
void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId) void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
{ {
@ -766,27 +764,25 @@ void AnimTask_SetAllNonAttackersInvisiblity(u8 taskId)
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
{ {
if (battler != gBattleAnimAttacker && IsBattlerSpriteVisible(battler)) if (battler != gBattleAnimAttacker && IsBattlerSpriteVisible(battler))
gSprites[gBattlerSpriteIds[battler]].invisible = tInvisible; gSprites[gBattlerSpriteIds[battler]].invisible = gBattleAnimArgs[0];
} }
DestroyAnimVisualTask(taskId); DestroyAnimVisualTask(taskId);
} }
#undef tInvisible void StartMonScrollingBgMask(u8 taskId, int unused, u16 scrollSpeed, u8 battler, bool8 includePartner, u8 numFadeSteps, u8 fadeStepDelay, u8 duration, const u32 *gfx, const u32 *tilemap, const u32 *palette)
void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5, u8 arg6, u8 arg7, const u32 *gfx, const u32 *tilemap, const u32 *palette)
{ {
u16 species; u16 species;
u8 spriteId, spriteId2; u8 spriteId, spriteId2;
u16 bg1Cnt; u16 bg1Cnt;
struct BattleAnimBgData unknownStruct; struct BattleAnimBgData animBgData;
u8 battler2; u8 battler2;
spriteId2 = 0; spriteId2 = 0;
battler2 = BATTLE_PARTNER(battler1); battler2 = BATTLE_PARTNER(battler);
if (IsContest() || (arg4 && !IsBattlerSpriteVisible(battler2))) if (IsContest() || (includePartner && !IsBattlerSpriteVisible(battler2)))
arg4 = 0; includePartner = FALSE;
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
gBattle_WIN0V = 0; gBattle_WIN0V = 0;
@ -814,34 +810,34 @@ void sub_8117854(u8 taskId, int unused, u16 arg2, u8 battler1, u8 arg4, u8 arg5,
} }
else else
{ {
if (GetBattlerSide(battler1) != B_SIDE_PLAYER) if (GetBattlerSide(battler) != B_SIDE_PLAYER)
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler1]], MON_DATA_SPECIES); species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES);
else else
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler1]], MON_DATA_SPECIES); species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battler]], MON_DATA_SPECIES);
} }
spriteId = sub_80A89C8(battler1, gBattlerSpriteIds[battler1], species); spriteId = CreateInvisibleSpriteCopy(battler, gBattlerSpriteIds[battler], species);
if (arg4) if (includePartner)
spriteId2 = sub_80A89C8(battler2, gBattlerSpriteIds[battler2], species); spriteId2 = CreateInvisibleSpriteCopy(battler2, gBattlerSpriteIds[battler2], species);
GetDefaultBattleAnimBgData(&unknownStruct); GetBattleAnimBg1Data(&animBgData);
AnimLoadCompressedBgTilemapHandleContest(&unknownStruct, tilemap, 0); AnimLoadCompressedBgTilemapHandleContest(&animBgData, tilemap, 0);
AnimLoadCompressedBgGfx(unknownStruct.bgId, gfx, unknownStruct.tilesOffset); AnimLoadCompressedBgGfx(animBgData.bgId, gfx, animBgData.tilesOffset);
LoadCompressedPalette(palette, unknownStruct.paletteId * 16, 32); LoadCompressedPalette(palette, animBgData.paletteId * 16, 32);
gBattle_BG1_X = 0; gBattle_BG1_X = 0;
gBattle_BG1_Y = 0; gBattle_BG1_Y = 0;
gTasks[taskId].data[1] = arg2; gTasks[taskId].data[1] = scrollSpeed;
gTasks[taskId].data[4] = arg5; gTasks[taskId].data[4] = numFadeSteps;
gTasks[taskId].data[5] = arg7; gTasks[taskId].data[5] = duration;
gTasks[taskId].data[6] = arg6; gTasks[taskId].data[6] = fadeStepDelay;
gTasks[taskId].data[0] = spriteId; gTasks[taskId].data[0] = spriteId;
gTasks[taskId].data[2] = arg4; gTasks[taskId].data[2] = includePartner;
gTasks[taskId].data[3] = spriteId2; gTasks[taskId].data[3] = spriteId2;
gTasks[taskId].func = sub_8117A60; gTasks[taskId].func = UpdateMonScrollingBgMask;
} }
static void sub_8117A60(u8 taskId) static void UpdateMonScrollingBgMask(u8 taskId)
{ {
gTasks[taskId].data[13] += gTasks[taskId].data[1] < 0 ? -gTasks[taskId].data[1] : gTasks[taskId].data[1]; gTasks[taskId].data[13] += gTasks[taskId].data[1] < 0 ? -gTasks[taskId].data[1] : gTasks[taskId].data[1];
if (gTasks[taskId].data[1] < 0) if (gTasks[taskId].data[1] < 0)
@ -874,7 +870,7 @@ static void sub_8117A60(u8 taskId)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12])); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
if (gTasks[taskId].data[12] == 0) if (gTasks[taskId].data[12] == 0)
{ {
sub_80A477C(0); ResetBattleAnimBg(0);
gBattle_WIN0H = 0; gBattle_WIN0H = 0;
gBattle_WIN0V = 0; gBattle_WIN0V = 0;
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR
@ -927,7 +923,7 @@ void AnimTask_CopyPalUnfadedToBackup(u8 taskId)
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
while ((selectedPalettes & 1) == 0) while ((selectedPalettes & 1) == 0)
{ {
selectedPalettes >>= 1; selectedPalettes >>= 1;
@ -954,7 +950,7 @@ void AnimTask_CopyPalUnfadedFromBackup(u8 taskId)
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
while ((selectedPalettes & 1) == 0) while ((selectedPalettes & 1) == 0)
{ {
selectedPalettes >>= 1; selectedPalettes >>= 1;
@ -981,7 +977,7 @@ void AnimTask_CopyPalFadedToUnfaded(u8 taskId)
if (gBattleAnimArgs[0] == 0) if (gBattleAnimArgs[0] == 0)
{ {
selectedPalettes = sub_80A75AC(1, 0, 0, 0, 0, 0, 0); selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
while ((selectedPalettes & 1) == 0) while ((selectedPalettes & 1) == 0)
{ {
selectedPalettes >>= 1; selectedPalettes >>= 1;

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);
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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];
GetDefaultBattleAnimBgData(&animBg); GetBattleAnimBg1Data(&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)
{ {
@ -923,8 +923,8 @@ static void AnimTask_CreateSurfWave_Step2(u8 taskId)
u16 *BGptrY = &gBattle_BG1_Y; u16 *BGptrY = &gBattle_BG1_Y;
if (gTasks[taskId].data[0] == 0) if (gTasks[taskId].data[0] == 0)
{ {
sub_80A6C68(1); ClearBattleAnimBg(1);
sub_80A6C68(2); ClearBattleAnimBg(2);
gTasks[taskId].data[0]++; gTasks[taskId].data[0]++;
} }
else else

View File

@ -154,15 +154,14 @@ static const u8 sBasePaletteGammaTypes[32] =
GAMMA_NORMAL, GAMMA_NORMAL,
}; };
const u16 gUnknown_083970E8[] = INCBIN_U16("graphics/weather/0.gbapal"); const u16 gFogPalette[] = INCBIN_U16("graphics/weather/fog.gbapal");
// code
void StartWeather(void) void StartWeather(void)
{ {
if (!FuncIsActiveTask(Task_WeatherMain)) if (!FuncIsActiveTask(Task_WeatherMain))
{ {
u8 index = AllocSpritePalette(0x1200); u8 index = AllocSpritePalette(0x1200);
CpuCopy32(gUnknown_083970E8, &gPlttBufferUnfaded[0x100 + index * 16], 32); CpuCopy32(gFogPalette, &gPlttBufferUnfaded[0x100 + index * 16], 32);
BuildGammaShiftTables(); BuildGammaShiftTables();
gWeatherPtr->altGammaSpritePalIndex = index; gWeatherPtr->altGammaSpritePalIndex = index;
gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(0x1201); gWeatherPtr->weatherPicSpritePalIndex = AllocSpritePalette(0x1201);

View File

@ -668,8 +668,8 @@ const u32 gBattleAnimSpritePal_FangAttack[] = INCBIN_U32("graphics/battle_anims/
const u32 gBattleAnimSpriteGfx_PurpleHandOutline[] = INCBIN_U32("graphics/battle_anims/sprites/purple_hand_outline.4bpp.lz"); const u32 gBattleAnimSpriteGfx_PurpleHandOutline[] = INCBIN_U32("graphics/battle_anims/sprites/purple_hand_outline.4bpp.lz");
const u32 gBattleAnimSpritePal_PurpleHandOutline[] = INCBIN_U32("graphics/battle_anims/sprites/purple_hand_outline.gbapal.lz"); const u32 gBattleAnimSpritePal_PurpleHandOutline[] = INCBIN_U32("graphics/battle_anims/sprites/purple_hand_outline.gbapal.lz");
const u32 gUnknown_08C20668[] = INCBIN_U32("graphics/battle_anims/masks/curse.4bpp.lz"); const u32 gBattleAnimMaskImage_Curse[] = INCBIN_U32("graphics/battle_anims/masks/curse.4bpp.lz");
const u32 gUnknown_08C20684[] = INCBIN_U32("graphics/battle_anims/masks/curse.bin.lz"); const u32 gBattleAnimMaskTilemap_Curse[] = INCBIN_U32("graphics/battle_anims/masks/curse.bin.lz");
const u32 gBattleAnimSpriteGfx_Pencil[] = INCBIN_U32("graphics/battle_anims/sprites/pencil.4bpp.lz"); const u32 gBattleAnimSpriteGfx_Pencil[] = INCBIN_U32("graphics/battle_anims/sprites/pencil.4bpp.lz");
const u32 gBattleAnimSpritePal_Pencil[] = INCBIN_U32("graphics/battle_anims/sprites/pencil.gbapal.lz"); const u32 gBattleAnimSpritePal_Pencil[] = INCBIN_U32("graphics/battle_anims/sprites/pencil.gbapal.lz");
@ -911,8 +911,8 @@ const u32 gBattleAnimSpriteGfx_TagHand[] = INCBIN_U32("graphics/battle_anims/spr
const u32 gBattleAnimSpriteGfx_NoiseLine[] = INCBIN_U32("graphics/battle_anims/sprites/noise_line.4bpp.lz"); const u32 gBattleAnimSpriteGfx_NoiseLine[] = INCBIN_U32("graphics/battle_anims/sprites/noise_line.4bpp.lz");
const u32 gUnknown_08C2EA50[] = INCBIN_U32("graphics/battle_anims/masks/unknown_C2EA50.4bpp.lz"); const u32 UnusedLevelupAnimationGfx[] = INCBIN_U32("graphics/battle_anims/masks/unused_level_up.4bpp.lz");
const u32 gUnknown_08C2EA9C[] = INCBIN_U32("graphics/battle_anims/masks/unknown_C2EA50.bin.lz"); const u32 UnusedLevelupAnimationTilemap[] = INCBIN_U32("graphics/battle_anims/masks/unused_level_up.bin.lz");
const u32 gBattleAnimSpriteGfx_SmallRedEye[] = INCBIN_U32("graphics/battle_anims/sprites/small_red_eye.4bpp.lz"); const u32 gBattleAnimSpriteGfx_SmallRedEye[] = INCBIN_U32("graphics/battle_anims/sprites/small_red_eye.4bpp.lz");
const u32 gBattleAnimSpritePal_SmallRedEye[] = INCBIN_U32("graphics/battle_anims/sprites/small_red_eye.gbapal.lz"); const u32 gBattleAnimSpritePal_SmallRedEye[] = INCBIN_U32("graphics/battle_anims/sprites/small_red_eye.gbapal.lz");