diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index dfcc80748..23416bde8 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1228,7 +1228,7 @@ Move_HIDDEN_POWER: createsprite gHiddenPowerOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 168 createsprite gHiddenPowerOrbSpriteTemplate, ANIM_ATTACKER, 2, 26, 210 delay 52 - setarg 7, -1 + setarg 7, 0xFFFF playsewithpan SE_W115, SOUND_PAN_ATTACKER createvisualtask AnimTask_ScaleMonAndRestore, 5, -7, -7, 11, ANIM_ATTACKER, 0 createsprite gHiddenPowerOrbScatterSpriteTemplate, ANIM_TARGET, 2, 0 @@ -2075,7 +2075,7 @@ Move_LOCK_ON: createsprite gLockOnMoveTargetSpriteTemplate, ANIM_ATTACKER, 40, 3 createsprite gLockOnMoveTargetSpriteTemplate, ANIM_ATTACKER, 40, 4 @ Also transitions to red target delay 120 - setarg 7, -1 @ Signal target to flash/disappear + setarg 7, 0xFFFF @ Signal target to flash/disappear waitforvisualfinish end @@ -2518,7 +2518,7 @@ HornDrillContinue: waitforvisualfinish restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end @@ -2628,7 +2628,7 @@ Move_FISSURE: delay 40 restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end @@ -3146,7 +3146,7 @@ MachPunchContinue: blendoff restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end MachPunchAgainstPlayer: @@ -3418,7 +3418,7 @@ ExtremeSpeedContinue: waitforvisualfinish restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein clearmonbg ANIM_TARGET blendoff @@ -4814,7 +4814,7 @@ Move_THUNDER: waitforvisualfinish restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end @@ -5403,7 +5403,7 @@ Move_AURORA_BEAM: call AuroraBeamCreateRings call AuroraBeamCreateRings call AuroraBeamCreateRings - setarg 7, -1 + setarg 7, 0xFFFF createsoundtask SoundTask_LoopSEAdjustPanning, SE_W062B, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 3, 6, 0, 10 createvisualtask AnimTask_ShakeMon2, 5, ANIM_TARGET, 2, 0, 40, 1 call AuroraBeamCreateRings @@ -5537,7 +5537,7 @@ BlizzardContinue: delay 20 restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein clearmonbg ANIM_DEF_PARTNER end @@ -6133,7 +6133,7 @@ MegahornContinue: blendoff restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end MegahornInContest: @@ -7604,7 +7604,7 @@ Move_MIMIC: delay 15 createsprite gMimicOrbSpriteTemplate, ANIM_TARGET, 2, -12, 24 delay 10 - setarg 7, -1 + setarg 7, 0xFFFF waitforvisualfinish playsewithpan SE_W036, SOUND_PAN_ATTACKER createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 2, 0, 11, RGB_WHITE @@ -7626,7 +7626,7 @@ Move_CONSTRICT: createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 3, 0, 6, 1 delay 20 playsewithpan SE_W020, SOUND_PAN_TARGET - setarg 7, -1 + setarg 7, 0xFFFF waitforvisualfinish end @@ -7692,7 +7692,7 @@ Move_SOFT_BOILED: delay 8 createsprite gThinRingExpandingSpriteTemplate, ANIM_ATTACKER, 3, 31, 16, 0, 1 delay 60 - setarg 7, -1 + setarg 7, 0xFFFF waitforvisualfinish clearmonbg ANIM_ATK_PARTNER call HealingEffect2 @@ -9070,7 +9070,7 @@ Move_COSMIC_POWER: waitforvisualfinish restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein waitforvisualfinish end @@ -9200,7 +9200,7 @@ SilverWindContinue: restorebg waitbgfadeout createvisualtask AnimTask_BlendBattleAnimPalExclude, 10, ANIM_TARGET, 0, 4, 0, RGB_BLACK - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end SilverWindOnPlayer: @@ -9628,7 +9628,7 @@ Move_SKY_UPPERCUT: blendoff restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein end @@ -9729,7 +9729,7 @@ Move_MAGICAL_LEAF: createsprite gBasicHitSplatSpriteTemplate, ANIM_TARGET, 4, 10, 4, ANIM_TARGET, 2 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 delay 20 - setarg 7, -1 + setarg 7, 0xFFFF waitforvisualfinish clearmonbg ANIM_DEF_PARTNER blendoff @@ -10164,7 +10164,7 @@ SetPsychicBackground: UnsetPsychicBackground: restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein return @@ -10185,7 +10185,7 @@ SetSkyBgContest: UnsetSkyBg: restorebg waitbgfadeout - setarg 7, -1 + setarg 7, 0xFFFF waitbgfadein return @@ -10366,7 +10366,7 @@ Status_BindWrap: delay 3 createvisualtask AnimTask_ShakeMon2, 2, ANIM_TARGET, 2, 0, 8, 1 delay 20 - setarg 7, -1 + setarg 7, 0xFFFF playsewithpan SE_W020, SOUND_PAN_TARGET waitforvisualfinish end diff --git a/include/battle_anim.h b/include/battle_anim.h index f10a25733..18727cc73 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -157,6 +157,8 @@ void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId); u8 GetBattlerSide(u8 battler); u8 GetBattlerPosition(u8 battler); u8 GetBattlerAtPosition(u8 position); +void sub_80A64EC(struct Sprite *sprite); +void sub_80A718C(struct Sprite *sprite); enum { @@ -191,11 +193,7 @@ void SetSpritePrimaryCoordsFromSecondaryCoords(struct Sprite *sprite); u8 GetBattlerSpriteDefault_Y(u8 battlerId); u8 GetSubstituteSpriteDefault_Y(u8 battlerId); -// battle_anim_80A64EC.c -void sub_80A64EC(struct Sprite *sprite); -void sub_80A718C(struct Sprite *sprite); - -// battle_anim_status_effects.s +// battle_anim_status_effects.c #define STAT_ANIM_PLUS1 15 #define STAT_ANIM_PLUS2 39 #define STAT_ANIM_MINUS1 22 @@ -206,7 +204,7 @@ void sub_80A718C(struct Sprite *sprite); #define STAT_ANIM_MULTIPLE_MINUS2 58 void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId); -// ground.c +// battle_anim_ground.c void AnimTask_HorizontalShake(u8 taskId); // battle_anim_special.c @@ -215,7 +213,7 @@ u8 ItemIdToBallId(u16 itemId); u8 AnimateBallOpenParticles(u8 x, u8 y, u8 priority, u8 subpriority, u8 ballId); u8 LaunchBallFadeMonTask(bool8 unFadeLater, u8 battlerId, u32 selectedPalettes, u8 ballId); -// battle_anim_utility_funcs.s +// battle_anim_utility_funcs.c void sub_8116EB4(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); @@ -224,13 +222,13 @@ void SetSpriteNextToMonHead(u8 battler, struct Sprite* sprite); void AnimMoveTwisterParticle(struct Sprite* sprite); void AnimParticleBurst(struct Sprite *); -// water.c +// battle_anim_water.c void AnimWaterPulseRing(struct Sprite *sprite); -// flying.c +// battle_anim_flying.c void DestroyAnimSpriteAfterTimer(struct Sprite *sprite); -// smokescreen.c +// battle_anim_smokescreen.c u8 SmokescreenImpact(s16 x, s16 y, u8 a3); u32 UnpackSelectedBattleAnimPalettes(s16); diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 6800da1c9..dfdd9f912 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -392,7 +392,7 @@ #define B_ANIM_STATUS_NIGHTMARE 0x8 #define B_ANIM_STATUS_WRAPPED 0x9 // does not actually exist -// Most tasks return a value to gBattleAnimArgs[7]. +// Tasks with return values often assign them to gBattleAnimArgs[7]. #define ARG_RET_ID 7 // Trapping Wrap-like moves end turn animation. diff --git a/ld_script.txt b/ld_script.txt index d841557c3..94b737c57 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -99,7 +99,7 @@ SECTIONS { src/daycare.o(.text); src/egg_hatch.o(.text); src/battle_interface.o(.text); - src/smokescreen.o(.text); + src/battle_anim_smokescreen.o(.text); src/pokeball.o(.text); src/load_save.o(.text); src/trade.o(.text); @@ -179,21 +179,21 @@ SECTIONS { src/item_use.o(.text); src/battle_anim_effects_1.o(.text); src/battle_anim_effects_2.o(.text); - src/water.o(.text); - src/fire.o(.text); - src/electric.o(.text); - src/ice.o(.text); - src/fight.o(.text); - src/poison.o(.text); - src/flying.o(.text); - src/psychic.o(.text); - src/bug.o(.text); - src/rock.o(.text); - src/ghost.o(.text); - src/dragon.o(.text); - src/dark.o(.text); - src/ground.o(.text); - src/normal.o(.text); + src/battle_anim_water.o(.text); + src/battle_anim_fire.o(.text); + src/battle_anim_electric.o(.text); + src/battle_anim_ice.o(.text); + src/battle_anim_fight.o(.text); + src/battle_anim_poison.o(.text); + src/battle_anim_flying.o(.text); + src/battle_anim_psychic.o(.text); + src/battle_anim_bug.o(.text); + src/battle_anim_rock.o(.text); + src/battle_anim_ghost.o(.text); + src/battle_anim_dragon.o(.text); + src/battle_anim_dark.o(.text); + src/battle_anim_ground.o(.text); + src/battle_anim_normal.o(.text); src/battle_anim_utility_funcs.o(.text); src/battle_intro.o(.text); src/bike.o(.text); @@ -470,7 +470,7 @@ SECTIONS { src/battle_util.o(.rodata); src/battle_script_commands.o(.rodata); src/battle_controller_player.o(.rodata); - src/smokescreen.o(.rodata); + src/battle_anim_smokescreen.o(.rodata); src/battle_controller_opponent.o(.rodata); src/battle_ai_switch_items.o(.rodata); src/battle_controller_link_opponent.o(.rodata); @@ -550,21 +550,21 @@ SECTIONS { src/item_use.o(.rodata); src/battle_anim_effects_1.o(.rodata); src/battle_anim_effects_2.o(.rodata); - src/water.o(.rodata); - src/fire.o(.rodata); - src/electric.o(.rodata); - src/ice.o(.rodata); - src/fight.o(.rodata); - src/poison.o(.rodata); - src/flying.o(.rodata); - src/psychic.o(.rodata); - src/bug.o(.rodata); - src/rock.o(.rodata); - src/ghost.o(.rodata); - src/dragon.o(.rodata); - src/dark.o(.rodata); - src/ground.o(.rodata); - src/normal.o(.rodata); + src/battle_anim_water.o(.rodata); + src/battle_anim_fire.o(.rodata); + src/battle_anim_electric.o(.rodata); + src/battle_anim_ice.o(.rodata); + src/battle_anim_fight.o(.rodata); + src/battle_anim_poison.o(.rodata); + src/battle_anim_flying.o(.rodata); + src/battle_anim_psychic.o(.rodata); + src/battle_anim_bug.o(.rodata); + src/battle_anim_rock.o(.rodata); + src/battle_anim_ghost.o(.rodata); + src/battle_anim_dragon.o(.rodata); + src/battle_anim_dark.o(.rodata); + src/battle_anim_ground.o(.rodata); + src/battle_anim_normal.o(.rodata); src/battle_anim_utility_funcs.o(.rodata); src/battle_intro.o(.rodata); src/bike.o(.rodata); diff --git a/src/bug.c b/src/battle_anim_bug.c similarity index 100% rename from src/bug.c rename to src/battle_anim_bug.c diff --git a/src/dark.c b/src/battle_anim_dark.c similarity index 100% rename from src/dark.c rename to src/battle_anim_dark.c diff --git a/src/dragon.c b/src/battle_anim_dragon.c similarity index 100% rename from src/dragon.c rename to src/battle_anim_dragon.c diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index ffcf24b9b..516c58e55 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -2761,7 +2761,7 @@ static void AnimConstrictBinding_Step1(struct Sprite* sprite) { u8 spriteId; - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { sprite->affineAnimPaused = 0; spriteId = GetAnimBattlerSpriteId(ANIM_TARGET); @@ -2835,7 +2835,7 @@ static void AnimTask_DuplicateAndShrinkToPos_Step1(u8 taskId) static void AnimTask_DuplicateAndShrinkToPos_Step2(u8 taskId) { - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { if (gTasks[taskId].data[0] == 0) { @@ -3655,7 +3655,7 @@ void AnimTask_CycleMagicalLeafPal(u8 taskId) break; } - if (gBattleAnimArgs[ARG_RET_ID] == -1) + if (gBattleAnimArgs[7] == -1) DestroyAnimVisualTask(taskId); } @@ -4355,7 +4355,7 @@ static void AnimLockOnTarget_Step4(struct Sprite* sprite) static void AnimLockOnTarget_Step5(struct Sprite* sprite) { - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { sprite->data[1] = 0; sprite->data[0] = 0; @@ -4847,7 +4847,7 @@ static void AnimConversion(struct Sprite* sprite) sprite->data[0]++; } - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) DestroyAnimSprite(sprite); } @@ -4855,7 +4855,7 @@ void AnimTask_ConversionAlphaBlend(u8 taskId) { if (gTasks[taskId].data[2] == 1) { - gBattleAnimArgs[ARG_RET_ID] = 0xFFFF; + gBattleAnimArgs[7] = 0xFFFF; gTasks[taskId].data[2]++; } else if (gTasks[taskId].data[2] == 2) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 206c2032f..cf85e697a 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -2761,7 +2761,7 @@ static void AnimSoftBoiledEgg_Step3_Callback2(struct Sprite *sprite) static void AnimSoftBoiledEgg_Step4(struct Sprite *sprite) { - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { sprite->invisible = TRUE; if (sprite->data[7] == 0) @@ -3444,7 +3444,7 @@ static void AnimOrbitFast_Step(struct Sprite *sprite) break; } - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) DestroyAnimSprite(sprite); } diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index c414deb84..fd68bbd37 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1392,7 +1392,7 @@ static void SetPsychicBackground_Step(u8 taskId) gTasks[taskId].data[5] = 0; } - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) DestroyTask(taskId); } @@ -1423,7 +1423,7 @@ static void FadeScreenToWhite_Step(u8 taskId) gTasks[taskId].data[5] = 0; } - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) DestroyTask(taskId); } @@ -5092,7 +5092,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) if (x < GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X)) { gTasks[taskId].data[14]++; - gBattleAnimArgs[ARG_RET_ID] = 0xFFFF; + gBattleAnimArgs[7] = 0xFFFF; } } else @@ -5100,7 +5100,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId) if (x > GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X)) { gTasks[taskId].data[14]++; - gBattleAnimArgs[ARG_RET_ID] = 0xFFFF; + gBattleAnimArgs[7] = 0xFFFF; } } } @@ -5150,7 +5150,7 @@ static void sub_815FE80(struct Sprite *sprite) switch (sprite->data[7]) { case 0: - if (gBattleAnimArgs[ARG_RET_ID] == -1) + if (gBattleAnimArgs[7] == -1) { PlaySE12WithPanning(SE_W233, BattleAnimAdjustPanning(63)); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 16; diff --git a/src/electric.c b/src/battle_anim_electric.c similarity index 99% rename from src/electric.c rename to src/battle_anim_electric.c index 63511c91f..c153dbc10 100644 --- a/src/electric.c +++ b/src/battle_anim_electric.c @@ -629,7 +629,7 @@ static void AnimSparkElectricityFlashing(struct Sprite *sprite) u8 battler; sprite->data[0] = gBattleAnimArgs[3]; - if (gBattleAnimArgs[ARG_RET_ID] & 0x8000) + if (gBattleAnimArgs[7] & 0x8000) battler = gBattleAnimTarget; else battler = gBattleAnimAttacker; @@ -640,7 +640,7 @@ static void AnimSparkElectricityFlashing(struct Sprite *sprite) sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_X_2) + gBattleAnimArgs[0]; sprite->pos1.y = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[1]; - sprite->data[4] = gBattleAnimArgs[ARG_RET_ID] & 0x7FFF; + sprite->data[4] = gBattleAnimArgs[7] & 0x7FFF; sprite->data[5] = gBattleAnimArgs[2]; sprite->data[6] = gBattleAnimArgs[5]; sprite->data[7] = gBattleAnimArgs[4]; diff --git a/src/fight.c b/src/battle_anim_fight.c similarity index 99% rename from src/fight.c rename to src/battle_anim_fight.c index 9bb4a49d3..5211860e0 100644 --- a/src/fight.c +++ b/src/battle_anim_fight.c @@ -428,7 +428,7 @@ static void unc_080B08A0(struct Sprite *sprite) static void AnimSlideHandOrFootToTarget(struct Sprite *sprite) { - if (gBattleAnimArgs[ARG_RET_ID] == 1 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) + if (gBattleAnimArgs[7] == 1 && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) { gBattleAnimArgs[1] = -gBattleAnimArgs[1]; gBattleAnimArgs[3] = -gBattleAnimArgs[3]; @@ -1033,7 +1033,7 @@ void AnimTask_MoveSkyUppercutBg(u8 taskId) task->data[9] &= 0xFF; task->data[10] &= 0xFF; - if (gBattleAnimArgs[ARG_RET_ID] == -1) + if (gBattleAnimArgs[7] == -1) { gBattle_BG3_X = 0; gBattle_BG3_Y = 0; diff --git a/src/fire.c b/src/battle_anim_fire.c similarity index 100% rename from src/fire.c rename to src/battle_anim_fire.c diff --git a/src/flying.c b/src/battle_anim_flying.c similarity index 99% rename from src/flying.c rename to src/battle_anim_flying.c index e7babf9d7..5179c1364 100644 --- a/src/flying.c +++ b/src/battle_anim_flying.c @@ -574,7 +574,7 @@ static void AnimFallingFeather(struct Sprite *sprite) struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data; - if (gBattleAnimArgs[ARG_RET_ID] & 0x100) + if (gBattleAnimArgs[7] & 0x100) battler = gBattleAnimAttacker; else battler = gBattleAnimTarget; diff --git a/src/ghost.c b/src/battle_anim_ghost.c similarity index 100% rename from src/ghost.c rename to src/battle_anim_ghost.c diff --git a/src/ground.c b/src/battle_anim_ground.c similarity index 99% rename from src/ground.c rename to src/battle_anim_ground.c index 6ec17742a..875ecbd75 100644 --- a/src/ground.c +++ b/src/battle_anim_ground.c @@ -758,7 +758,7 @@ static void sub_81156D0(u8 taskId) { struct Task *task = &gTasks[taskId]; - if (gBattleAnimArgs[ARG_RET_ID] == task->data[3]) + if (gBattleAnimArgs[7] == task->data[3]) { gBattle_BG3_X = 0; gBattle_BG3_Y = 0; diff --git a/src/ice.c b/src/battle_anim_ice.c similarity index 99% rename from src/ice.c rename to src/battle_anim_ice.c index e2b0c5287..24ddf3b32 100644 --- a/src/ice.c +++ b/src/battle_anim_ice.c @@ -789,7 +789,7 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite) sprite->data[1] = sprite->pos1.x; sprite->data[3] = sprite->pos1.y; - if (!gBattleAnimArgs[ARG_RET_ID]) + if (!gBattleAnimArgs[7]) { sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2); sprite->data[4] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET); @@ -1204,7 +1204,7 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite) sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET); - if (gBattleAnimArgs[ARG_RET_ID]) + if (gBattleAnimArgs[7]) { sprite->data[1] = sprite->pos1.x + gBattleAnimArgs[1]; sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[3]; diff --git a/src/normal.c b/src/battle_anim_normal.c similarity index 100% rename from src/normal.c rename to src/battle_anim_normal.c diff --git a/src/poison.c b/src/battle_anim_poison.c similarity index 100% rename from src/poison.c rename to src/battle_anim_poison.c diff --git a/src/psychic.c b/src/battle_anim_psychic.c similarity index 100% rename from src/psychic.c rename to src/battle_anim_psychic.c diff --git a/src/rock.c b/src/battle_anim_rock.c similarity index 99% rename from src/rock.c rename to src/battle_anim_rock.c index ced3e5ba8..1f22d2976 100644 --- a/src/rock.c +++ b/src/battle_anim_rock.c @@ -866,7 +866,7 @@ void AnimTask_SeismicTossBgAccelerateDownAtEnd(u8 taskId) gTasks[taskId].data[1] &= 0xFF; gBattle_BG3_Y = gTasks[taskId].data[2] + Cos(4, gTasks[taskId].data[1]); - if (gBattleAnimArgs[ARG_RET_ID] == 0xFFF) + if (gBattleAnimArgs[7] == 0xFFF) { gBattle_BG3_Y = 0; sub_80A6DAC(TRUE); diff --git a/src/smokescreen.c b/src/battle_anim_smokescreen.c similarity index 77% rename from src/smokescreen.c rename to src/battle_anim_smokescreen.c index 7d83251bc..a8c043e67 100644 --- a/src/smokescreen.c +++ b/src/battle_anim_smokescreen.c @@ -41,17 +41,17 @@ const u8 gUnknown_0831C604[] = [NATURE_QUIRKY] = 0, }; -static const struct CompressedSpriteSheet gSmokescreenImpactSpriteSheet = +static const struct CompressedSpriteSheet sSmokescreenImpactSpriteSheet = { .data = gSmokescreenImpactTiles, .size = 0x180, .tag = 55019 }; -static const struct CompressedSpritePalette gSmokescreenlImpactSpritePalette = +static const struct CompressedSpritePalette sSmokescreenImpactSpritePalette = { .data = gSmokescreenImpactPalette, .tag = 55019 }; -static const struct OamData gUnknown_0831C630 = +static const struct OamData sOamData_SmokescreenImpact = { .y = 0, .affineMode = ST_OAM_AFFINE_OFF, @@ -68,7 +68,7 @@ static const struct OamData gUnknown_0831C630 = .affineParam = 0 }; -static const union AnimCmd gUnknown_0831C638[] = +static const union AnimCmd sAnim_SmokescreenImpact_0[] = { ANIMCMD_FRAME(0, 4), ANIMCMD_FRAME(4, 4), @@ -76,7 +76,7 @@ static const union AnimCmd gUnknown_0831C638[] = ANIMCMD_END }; -static const union AnimCmd gUnknown_0831C648[] = +static const union AnimCmd sAnim_SmokescreenImpact_1[] = { ANIMCMD_FRAME(0, 4, .hFlip = TRUE), ANIMCMD_FRAME(4, 4, .hFlip = TRUE), @@ -84,7 +84,7 @@ static const union AnimCmd gUnknown_0831C648[] = ANIMCMD_END }; -static const union AnimCmd gUnknown_0831C658[] = +static const union AnimCmd sAnim_SmokescreenImpact_2[] = { ANIMCMD_FRAME(0, 4, .vFlip = TRUE), ANIMCMD_FRAME(4, 4, .vFlip = TRUE), @@ -92,7 +92,7 @@ static const union AnimCmd gUnknown_0831C658[] = ANIMCMD_END }; -static const union AnimCmd gUnknown_0831C668[] = +static const union AnimCmd sAnim_SmokescreenImpact_3[] = { ANIMCMD_FRAME(0, 4, .hFlip = TRUE, .vFlip = TRUE), ANIMCMD_FRAME(4, 4, .hFlip = TRUE, .vFlip = TRUE), @@ -100,20 +100,20 @@ static const union AnimCmd gUnknown_0831C668[] = ANIMCMD_END }; -static const union AnimCmd *const gUnknown_0831C678[] = +static const union AnimCmd *const sAnims_SmokescreenImpact[] = { - gUnknown_0831C638, - gUnknown_0831C648, - gUnknown_0831C658, - gUnknown_0831C668, + sAnim_SmokescreenImpact_0, + sAnim_SmokescreenImpact_1, + sAnim_SmokescreenImpact_2, + sAnim_SmokescreenImpact_3, }; -static const struct SpriteTemplate gSmokescreenImpactSpriteTemplate = +static const struct SpriteTemplate sSmokescreenImpactSpriteTemplate = { .tileTag = 55019, .paletteTag = 55019, - .oam = &gUnknown_0831C630, - .anims = gUnknown_0831C678, + .oam = &sOamData_SmokescreenImpact, + .anims = sAnims_SmokescreenImpact, .images = NULL, .affineAnims = gDummySpriteAffineAnimTable, .callback = SpriteCB_DestroySprite @@ -158,34 +158,34 @@ u8 SmokescreenImpact(s16 x, s16 y, u8 a3) u8 spriteId1, spriteId2, spriteId3, spriteId4; struct Sprite *mainSprite; - if (GetSpriteTileStartByTag(gSmokescreenImpactSpriteSheet.tag) == 0xFFFF) + if (GetSpriteTileStartByTag(sSmokescreenImpactSpriteSheet.tag) == 0xFFFF) { - LoadCompressedSpriteSheetUsingHeap(&gSmokescreenImpactSpriteSheet); - LoadCompressedSpritePaletteUsingHeap(&gSmokescreenlImpactSpritePalette); + LoadCompressedSpriteSheetUsingHeap(&sSmokescreenImpactSpriteSheet); + LoadCompressedSpritePaletteUsingHeap(&sSmokescreenImpactSpritePalette); } mainSpriteId = CreateInvisibleSpriteWithCallback(SmokescreenImpact_Callback); mainSprite = &gSprites[mainSpriteId]; mainSprite->data[1] = a3; - spriteId1 = CreateSprite(&gSmokescreenImpactSpriteTemplate, x - 16, y - 16, 2); + spriteId1 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y - 16, 2); gSprites[spriteId1].data[0] = mainSpriteId; mainSprite->data[0]++; AnimateSprite(&gSprites[spriteId1]); - spriteId2 = CreateSprite(&gSmokescreenImpactSpriteTemplate, x, y - 16, 2); + spriteId2 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y - 16, 2); gSprites[spriteId2].data[0] = mainSpriteId; mainSprite->data[0]++; StartSpriteAnim(&gSprites[spriteId2], 1); AnimateSprite(&gSprites[spriteId2]); - spriteId3 = CreateSprite(&gSmokescreenImpactSpriteTemplate, x - 16, y, 2); + spriteId3 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y, 2); gSprites[spriteId3].data[0] = mainSpriteId; mainSprite->data[0]++; StartSpriteAnim(&gSprites[spriteId3], 2); AnimateSprite(&gSprites[spriteId3]); - spriteId4 = CreateSprite(&gSmokescreenImpactSpriteTemplate, x, y, 2); + spriteId4 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y, 2); gSprites[spriteId4].data[0] = mainSpriteId; mainSprite->data[0]++; StartSpriteAnim(&gSprites[spriteId4], 3); @@ -198,8 +198,8 @@ static void SmokescreenImpact_Callback(struct Sprite *sprite) { if (!sprite->data[0]) { - FreeSpriteTilesByTag(gSmokescreenImpactSpriteSheet.tag); - FreeSpritePaletteByTag(gSmokescreenlImpactSpritePalette.tag); + FreeSpriteTilesByTag(sSmokescreenImpactSpriteSheet.tag); + FreeSpritePaletteByTag(sSmokescreenImpactSpritePalette.tag); if (!sprite->data[1]) DestroySprite(sprite); else diff --git a/src/battle_anim_utility_funcs.c b/src/battle_anim_utility_funcs.c index 5d93a7cd1..dcef7d483 100644 --- a/src/battle_anim_utility_funcs.c +++ b/src/battle_anim_utility_funcs.c @@ -729,7 +729,7 @@ static void AnimTask_UpdateSlidingBg(u8 taskId) gTasks[taskId].data[10] &= 0xFF; gTasks[taskId].data[11] &= 0xFF; - if (gBattleAnimArgs[ARG_RET_ID] == gTasks[taskId].data[3]) + if (gBattleAnimArgs[7] == gTasks[taskId].data[3]) { gBattle_BG3_X = 0; gBattle_BG3_Y = 0; @@ -1058,7 +1058,7 @@ void AnimTask_SetAttackerInvisibleWaitForSignal(u8 taskId) static void AnimTask_WaitAndRestoreVisibility(u8 taskId) { - if (gBattleAnimArgs[ARG_RET_ID] == 0x1000) + if (gBattleAnimArgs[7] == 0x1000) { gBattleSpritesDataPtr->battlerData[gBattleAnimAttacker].invisible = (u8)gTasks[taskId].data[0] & 1; DestroyTask(taskId); diff --git a/src/water.c b/src/battle_anim_water.c similarity index 99% rename from src/water.c rename to src/battle_anim_water.c index 5d3e9505b..5810b6bdc 100644 --- a/src/water.c +++ b/src/battle_anim_water.c @@ -607,7 +607,7 @@ static void AnimAuroraBeamRings(struct Sprite *sprite) static void AnimAuroraBeamRings_Step(struct Sprite *sprite) { - if ((u16)gBattleAnimArgs[ARG_RET_ID] == 0xFFFF) + if ((u16)gBattleAnimArgs[7] == 0xFFFF) { StartSpriteAnim(sprite, 1); sprite->affineAnimPaused = FALSE; @@ -731,8 +731,8 @@ static void AnimToTargetInSinWave(struct Sprite *sprite) InitAnimLinearTranslation(sprite); sprite->data[5] = 0xD200 / sprite->data[0]; sprite->data[7] = gBattleAnimArgs[3]; - retArg = gBattleAnimArgs[ARG_RET_ID]; - if (gBattleAnimArgs[ARG_RET_ID] > 127) + retArg = gBattleAnimArgs[7]; + if (gBattleAnimArgs[7] > 127) { sprite->data[6] = (retArg - 127) * 256; sprite->data[7] = -sprite->data[7]; @@ -764,13 +764,13 @@ static void AnimToTargetInSinWave_Step(struct Sprite *sprite) void AnimTask_StartSinAnimTimer(u8 taskId) { gTasks[taskId].data[0] = gBattleAnimArgs[0]; - gBattleAnimArgs[ARG_RET_ID] = 0; + gBattleAnimArgs[7] = 0; gTasks[taskId].func = AnimTask_RunSinAnimTimer; } static void AnimTask_RunSinAnimTimer(u8 taskId) { - gBattleAnimArgs[ARG_RET_ID] = (gBattleAnimArgs[ARG_RET_ID] + 3) & 0xFF; + gBattleAnimArgs[7] = (gBattleAnimArgs[7] + 3) & 0xFF; if (--gTasks[taskId].data[0] == 0) DestroyAnimVisualTask(taskId); } diff --git a/sym_ewram.txt b/sym_ewram.txt index eca090dbd..5e6eef5ef 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -79,7 +79,7 @@ .include "src/safari_zone.o" .include "src/item_use.o" .include "src/battle_anim_effects_1.o" - .include "src/dragon.o" + .include "src/battle_anim_dragon.o" .include "src/battle_anim_utility_funcs.o" .include "src/battle_intro.o" .include "src/easy_chat.o"