From 886551f655ee0651b47ad81e55404059f3e2673b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 29 Oct 2021 18:43:27 -0400 Subject: [PATCH] Clean up battle transition doc --- src/battle_transition.c | 350 ++++++++++++++++++++-------------------- 1 file changed, 173 insertions(+), 177 deletions(-) diff --git a/src/battle_transition.c b/src/battle_transition.c index 6aa3883024..1e421b5e47 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -87,48 +87,48 @@ struct RectangularSpiralLine typedef bool8 (*TransitionStateFunc)(struct Task *task); typedef bool8 (*TransitionSpriteCallback)(struct Sprite *sprite); -static bool8 Transition_StartIntro(struct Task *task); -static bool8 Transition_WaitForIntro(struct Task *task); -static bool8 Transition_StartMain(struct Task *task); -static bool8 Transition_WaitForMain(struct Task *task); +static bool8 Transition_StartIntro(struct Task *); +static bool8 Transition_WaitForIntro(struct Task *); +static bool8 Transition_StartMain(struct Task *); +static bool8 Transition_WaitForMain(struct Task *); -static void LaunchBattleTransitionTask(u8 transitionId); -static void Task_BattleTransition(u8 taskId); -static void Task_Intro(u8 taskId); -static void Task_Blur(u8 taskId); -static void Task_Swirl(u8 taskId); -static void Task_Shuffle(u8 taskId); -static void Task_BigPokeball(u8 taskId); -static void Task_PokeballsTrail(u8 taskId); -static void Task_ClockwiseWipe(u8 taskId); -static void Task_Ripple(u8 taskId); -static void Task_Wave(u8 taskId); -static void Task_Slice(u8 taskId); -static void Task_WhiteBarsFade(u8 taskId); -static void Task_GridSquares(u8 taskId); -static void Task_AngledWipes(u8 taskId); -static void Task_Sidney(u8 taskId); -static void Task_Phoebe(u8 taskId); -static void Task_Glacia(u8 taskId); -static void Task_Drake(u8 taskId); -static void Task_Champion(u8 taskId); -static void Task_Aqua(u8 taskId); -static void Task_Magma(u8 taskId); -static void Task_Regice(u8 taskId); -static void Task_Registeel(u8 taskId); -static void Task_Regirock(u8 taskId); -static void Task_Kyogre(u8 taskId); -static void Task_Groudon(u8 taskId); -static void Task_Rayquaza(u8 taskId); -static void Task_ShredSplit(u8 taskId); -static void Task_Blackhole(u8 taskId); -static void Task_BlackholePulsate(u8 taskId); -static void Task_RectangularSpiral(u8 taskId); -static void Task_FrontierLogoWiggle(u8 taskId); -static void Task_FrontierLogoWave(u8 taskId); -static void Task_FrontierSquares(u8 taskId); -static void Task_FrontierSquaresScroll(u8 taskId); -static void Task_FrontierSquaresSpiral(u8 taskId); +static void LaunchBattleTransitionTask(u8); +static void Task_BattleTransition(u8); +static void Task_Intro(u8); +static void Task_Blur(u8); +static void Task_Swirl(u8); +static void Task_Shuffle(u8); +static void Task_BigPokeball(u8); +static void Task_PokeballsTrail(u8); +static void Task_ClockwiseWipe(u8); +static void Task_Ripple(u8); +static void Task_Wave(u8); +static void Task_Slice(u8); +static void Task_WhiteBarsFade(u8); +static void Task_GridSquares(u8); +static void Task_AngledWipes(u8); +static void Task_Sidney(u8); +static void Task_Phoebe(u8); +static void Task_Glacia(u8); +static void Task_Drake(u8); +static void Task_Champion(u8); +static void Task_Aqua(u8); +static void Task_Magma(u8); +static void Task_Regice(u8); +static void Task_Registeel(u8); +static void Task_Regirock(u8); +static void Task_Kyogre(u8); +static void Task_Groudon(u8); +static void Task_Rayquaza(u8); +static void Task_ShredSplit(u8); +static void Task_Blackhole(u8); +static void Task_BlackholePulsate(u8); +static void Task_RectangularSpiral(u8); +static void Task_FrontierLogoWiggle(u8); +static void Task_FrontierLogoWave(u8); +static void Task_FrontierSquares(u8); +static void Task_FrontierSquaresScroll(u8); +static void Task_FrontierSquaresSpiral(u8); static void VBlankCB_BattleTransition(void); static void VBlankCB_Swirl(void); static void HBlankCB_Swirl(void); @@ -149,144 +149,144 @@ static void VBlankCB_WhiteBarsFade_Blend(void); static void HBlankCB_WhiteBarsFade(void); static void VBlankCB_AngledWipes(void); static void VBlankCB_Rayquaza(void); -static bool8 Blur_Init(struct Task *task); -static bool8 Blur_Main(struct Task *task); -static bool8 Blur_End(struct Task *task); -static bool8 Swirl_Init(struct Task *task); -static bool8 Swirl_End(struct Task *task); -static bool8 Shuffle_Init(struct Task *task); -static bool8 Shuffle_End(struct Task *task); -static bool8 Aqua_Init(struct Task *task); -static bool8 Aqua_SetGfx(struct Task *task); -static bool8 Magma_Init(struct Task *task); -static bool8 Magma_SetGfx(struct Task *task); -static bool8 FramesCountdown(struct Task *task); -static bool8 Regi_Init(struct Task *task); -static bool8 Regice_SetGfx(struct Task *task); -static bool8 Registeel_SetGfx(struct Task *task); -static bool8 Regirock_SetGfx(struct Task *task); -static bool8 WeatherTrio_BgFadeBlack(struct Task *task); -static bool8 WeatherTrio_WaitFade(struct Task *task); -static bool8 Kyogre_Init(struct Task *task); -static bool8 Kyogre_PaletteFlash(struct Task *task); -static bool8 Kyogre_PaletteBrighten(struct Task *task); -static bool8 Groudon_Init(struct Task *task); -static bool8 Groudon_PaletteFlash(struct Task *task); -static bool8 Groudon_PaletteBrighten(struct Task *task); -static bool8 WeatherDuo_FadeOut(struct Task *task); -static bool8 WeatherDuo_End(struct Task *task); -static bool8 BigPokeball_Init(struct Task *task); -static bool8 BigPokeball_SetGfx(struct Task *task); -static bool8 PatternWeave_Blend1(struct Task *task); -static bool8 PatternWeave_Blend2(struct Task *task); -static bool8 PatternWeave_FinishAppear(struct Task *task); -static bool8 PatternWeave_CircularMask(struct Task *task); -static bool8 PokeballsTrail_Init(struct Task *task); -static bool8 PokeballsTrail_Main(struct Task *task); -static bool8 PokeballsTrail_End(struct Task *task); -static bool8 ClockwiseWipe_Init(struct Task *task); -static bool8 ClockwiseWipe_TopRight(struct Task *task); -static bool8 ClockwiseWipe_Right(struct Task *task); -static bool8 ClockwiseWipe_Bottom(struct Task *task); -static bool8 ClockwiseWipe_Left(struct Task *task); -static bool8 ClockwiseWipe_TopLeft(struct Task *task); -static bool8 ClockwiseWipe_End(struct Task *task); -static bool8 Ripple_Init(struct Task *task); -static bool8 Ripple_Main(struct Task *task); -static bool8 Wave_Init(struct Task *task); -static bool8 Wave_Main(struct Task *task); -static bool8 Wave_End(struct Task *task); -static bool8 Slice_Init(struct Task *task); -static bool8 Slice_Main(struct Task *task); -static bool8 Slice_End(struct Task *task); -static bool8 WhiteBarsFade_Init(struct Task *task); -static bool8 WhiteBarsFade_StartBars(struct Task *task); -static bool8 WhiteBarsFade_WaitBars(struct Task *task); -static bool8 WhiteBarsFade_BlendToBlack(struct Task *task); -static bool8 WhiteBarsFade_End(struct Task *task); -static bool8 GridSquares_Init(struct Task *task); -static bool8 GridSquares_Main(struct Task *task); -static bool8 GridSquares_End(struct Task *task); -static bool8 AngledWipes_Init(struct Task *task); -static bool8 AngledWipes_SetWipeData(struct Task *task); -static bool8 AngledWipes_DoWipe(struct Task *task); -static bool8 AngledWipes_TryEnd(struct Task *task); -static bool8 AngledWipes_StartNext(struct Task *task); -static bool8 ShredSplit_Init(struct Task *task); -static bool8 ShredSplit_Main(struct Task *task); -static bool8 ShredSplit_BrokenCheck(struct Task *task); -static bool8 ShredSplit_End(struct Task *task); -static bool8 Blackhole_Init(struct Task *task); -static bool8 Blackhole_Vibrate(struct Task *task); -static bool8 Blackhole_GrowEnd(struct Task *task); -static bool8 BlackholePulsate_Main(struct Task *task); -static bool8 RectangularSpiral_Init(struct Task *task); -static bool8 RectangularSpiral_Main(struct Task *task); -static bool8 RectangularSpiral_End(struct Task *task); -static bool8 FrontierLogoWiggle_Init(struct Task *task); -static bool8 FrontierLogoWiggle_SetGfx(struct Task *task); -static bool8 FrontierLogoWave_Init(struct Task *task); -static bool8 FrontierLogoWave_SetGfx(struct Task *task); -static bool8 FrontierLogoWave_InitScanline(struct Task *task); -static bool8 FrontierLogoWave_Main(struct Task *task); -static bool8 Rayquaza_Init(struct Task *task); -static bool8 Rayquaza_SetGfx(struct Task *task); -static bool8 Rayquaza_PaletteFlash(struct Task *task); -static bool8 Rayquaza_FadeToBlack(struct Task *task); -static bool8 Rayquaza_WaitFade(struct Task *task); -static bool8 Rayquaza_SetBlack(struct Task *task); -static bool8 Rayquaza_TriRing(struct Task *task); -static bool8 FrontierSquares_Init(struct Task *task); -static bool8 FrontierSquares_Draw(struct Task *task); -static bool8 FrontierSquares_Shrink(struct Task *task); -static bool8 FrontierSquares_End(struct Task *task); -static bool8 FrontierSquaresSpiral_Init(struct Task *task); -static bool8 FrontierSquaresSpiral_Outward(struct Task *task); -static bool8 FrontierSquaresSpiral_SetBlack(struct Task *task); -static bool8 FrontierSquaresSpiral_Inward(struct Task *task); -static bool8 FrontierSquaresScroll_Init(struct Task *task); -static bool8 FrontierSquaresScroll_Draw(struct Task *task); -static bool8 FrontierSquaresScroll_SetBlack(struct Task *task); -static bool8 FrontierSquaresScroll_Erase(struct Task *task); -static bool8 FrontierSquaresScroll_End(struct Task *task); -static bool8 Mugshot_Init(struct Task *task); -static bool8 Mugshot_SetGfx(struct Task *task); -static bool8 Mugshot_ShowBanner(struct Task *task); -static bool8 Mugshot_StartOpponentSlide(struct Task *task); -static bool8 Mugshot_WaitStartPlayerSlide(struct Task *task); -static bool8 Mugshot_WaitPlayerSlide(struct Task *task); -static bool8 Mugshot_GradualWhiteFade(struct Task *task); -static bool8 Mugshot_InitFadeWhiteToBlack(struct Task *task); -static bool8 Mugshot_FadeToBlack(struct Task *task); -static bool8 Mugshot_End(struct Task *task); -static void DoMugshotTransition(u8 taskId); -static void Mugshots_CreateTrainerPics(struct Task *task); +static bool8 Blur_Init(struct Task *); +static bool8 Blur_Main(struct Task *); +static bool8 Blur_End(struct Task *); +static bool8 Swirl_Init(struct Task *); +static bool8 Swirl_End(struct Task *); +static bool8 Shuffle_Init(struct Task *); +static bool8 Shuffle_End(struct Task *); +static bool8 Aqua_Init(struct Task *); +static bool8 Aqua_SetGfx(struct Task *); +static bool8 Magma_Init(struct Task *); +static bool8 Magma_SetGfx(struct Task *); +static bool8 FramesCountdown(struct Task *); +static bool8 Regi_Init(struct Task *); +static bool8 Regice_SetGfx(struct Task *); +static bool8 Registeel_SetGfx(struct Task *); +static bool8 Regirock_SetGfx(struct Task *); +static bool8 WeatherTrio_BgFadeBlack(struct Task *); +static bool8 WeatherTrio_WaitFade(struct Task *); +static bool8 Kyogre_Init(struct Task *); +static bool8 Kyogre_PaletteFlash(struct Task *); +static bool8 Kyogre_PaletteBrighten(struct Task *); +static bool8 Groudon_Init(struct Task *); +static bool8 Groudon_PaletteFlash(struct Task *); +static bool8 Groudon_PaletteBrighten(struct Task *); +static bool8 WeatherDuo_FadeOut(struct Task *); +static bool8 WeatherDuo_End(struct Task *); +static bool8 BigPokeball_Init(struct Task *); +static bool8 BigPokeball_SetGfx(struct Task *); +static bool8 PatternWeave_Blend1(struct Task *); +static bool8 PatternWeave_Blend2(struct Task *); +static bool8 PatternWeave_FinishAppear(struct Task *); +static bool8 PatternWeave_CircularMask(struct Task *); +static bool8 PokeballsTrail_Init(struct Task *); +static bool8 PokeballsTrail_Main(struct Task *); +static bool8 PokeballsTrail_End(struct Task *); +static bool8 ClockwiseWipe_Init(struct Task *); +static bool8 ClockwiseWipe_TopRight(struct Task *); +static bool8 ClockwiseWipe_Right(struct Task *); +static bool8 ClockwiseWipe_Bottom(struct Task *); +static bool8 ClockwiseWipe_Left(struct Task *); +static bool8 ClockwiseWipe_TopLeft(struct Task *); +static bool8 ClockwiseWipe_End(struct Task *); +static bool8 Ripple_Init(struct Task *); +static bool8 Ripple_Main(struct Task *); +static bool8 Wave_Init(struct Task *); +static bool8 Wave_Main(struct Task *); +static bool8 Wave_End(struct Task *); +static bool8 Slice_Init(struct Task *); +static bool8 Slice_Main(struct Task *); +static bool8 Slice_End(struct Task *); +static bool8 WhiteBarsFade_Init(struct Task *); +static bool8 WhiteBarsFade_StartBars(struct Task *); +static bool8 WhiteBarsFade_WaitBars(struct Task *); +static bool8 WhiteBarsFade_BlendToBlack(struct Task *); +static bool8 WhiteBarsFade_End(struct Task *); +static bool8 GridSquares_Init(struct Task *); +static bool8 GridSquares_Main(struct Task *); +static bool8 GridSquares_End(struct Task *); +static bool8 AngledWipes_Init(struct Task *); +static bool8 AngledWipes_SetWipeData(struct Task *); +static bool8 AngledWipes_DoWipe(struct Task *); +static bool8 AngledWipes_TryEnd(struct Task *); +static bool8 AngledWipes_StartNext(struct Task *); +static bool8 ShredSplit_Init(struct Task *); +static bool8 ShredSplit_Main(struct Task *); +static bool8 ShredSplit_BrokenCheck(struct Task *); +static bool8 ShredSplit_End(struct Task *); +static bool8 Blackhole_Init(struct Task *); +static bool8 Blackhole_Vibrate(struct Task *); +static bool8 Blackhole_GrowEnd(struct Task *); +static bool8 BlackholePulsate_Main(struct Task *); +static bool8 RectangularSpiral_Init(struct Task *); +static bool8 RectangularSpiral_Main(struct Task *); +static bool8 RectangularSpiral_End(struct Task *); +static bool8 FrontierLogoWiggle_Init(struct Task *); +static bool8 FrontierLogoWiggle_SetGfx(struct Task *); +static bool8 FrontierLogoWave_Init(struct Task *); +static bool8 FrontierLogoWave_SetGfx(struct Task *); +static bool8 FrontierLogoWave_InitScanline(struct Task *); +static bool8 FrontierLogoWave_Main(struct Task *); +static bool8 Rayquaza_Init(struct Task *); +static bool8 Rayquaza_SetGfx(struct Task *); +static bool8 Rayquaza_PaletteFlash(struct Task *); +static bool8 Rayquaza_FadeToBlack(struct Task *); +static bool8 Rayquaza_WaitFade(struct Task *); +static bool8 Rayquaza_SetBlack(struct Task *); +static bool8 Rayquaza_TriRing(struct Task *); +static bool8 FrontierSquares_Init(struct Task *); +static bool8 FrontierSquares_Draw(struct Task *); +static bool8 FrontierSquares_Shrink(struct Task *); +static bool8 FrontierSquares_End(struct Task *); +static bool8 FrontierSquaresSpiral_Init(struct Task *); +static bool8 FrontierSquaresSpiral_Outward(struct Task *); +static bool8 FrontierSquaresSpiral_SetBlack(struct Task *); +static bool8 FrontierSquaresSpiral_Inward(struct Task *); +static bool8 FrontierSquaresScroll_Init(struct Task *); +static bool8 FrontierSquaresScroll_Draw(struct Task *); +static bool8 FrontierSquaresScroll_SetBlack(struct Task *); +static bool8 FrontierSquaresScroll_Erase(struct Task *); +static bool8 FrontierSquaresScroll_End(struct Task *); +static bool8 Mugshot_Init(struct Task *); +static bool8 Mugshot_SetGfx(struct Task *); +static bool8 Mugshot_ShowBanner(struct Task *); +static bool8 Mugshot_StartOpponentSlide(struct Task *); +static bool8 Mugshot_WaitStartPlayerSlide(struct Task *); +static bool8 Mugshot_WaitPlayerSlide(struct Task *); +static bool8 Mugshot_GradualWhiteFade(struct Task *); +static bool8 Mugshot_InitFadeWhiteToBlack(struct Task *); +static bool8 Mugshot_FadeToBlack(struct Task *); +static bool8 Mugshot_End(struct Task *); +static void DoMugshotTransition(u8); +static void Mugshots_CreateTrainerPics(struct Task *); static void VBlankCB_Mugshots(void); static void VBlankCB_MugshotsFadeOut(void); static void HBlankCB_Mugshots(void); static void InitTransitionData(void); static void FadeScreenBlack(void); -static void CreateIntroTask(s16 a0, s16 a1, s16 a2, s16 a3, s16 a4); -static void SetCircularMask(u16 *a0, s16 a1, s16 a2, s16 a3); -static void SetSinWave(s16 *array, s16 sinAdd, s16 index, s16 indexIncrementer, s16 amplitude, s16 arrSize); -static void GetBg0TilemapDst(u16 **tileset); -static void InitBlackWipe(s16 *a0, s16 a1, s16 a2, s16 a3, s16 a4, s16 a5, s16 a6); -static bool8 UpdateBlackWipe(s16 *a0, bool8 a1, bool8 a2); -static void SetTrainerPicSlideDirection(s16 spriteId, s16 arrId); -static void IncrementTrainerPicState(s16 spriteId); -static s16 IsTrainerPicSlideDone(s16 spriteId); -static bool8 TransitionIntro_FadeToGray(struct Task *task); -static bool8 TransitionIntro_FadeFromGray(struct Task *task); +static void CreateIntroTask(s16, s16, s16, s16, s16); +static void SetCircularMask(u16 *, s16, s16, s16); +static void SetSinWave(s16 *, s16, s16, s16, s16, s16); +static void GetBg0TilemapDst(u16 **); +static void InitBlackWipe(s16 *, s16, s16, s16, s16, s16, s16); +static bool8 UpdateBlackWipe(s16 *, bool8, bool8); +static void SetTrainerPicSlideDirection(s16, s16); +static void IncrementTrainerPicState(s16); +static s16 IsTrainerPicSlideDone(s16); +static bool8 TransitionIntro_FadeToGray(struct Task *); +static bool8 TransitionIntro_FadeFromGray(struct Task *); static bool8 IsIntroTaskDone(void); -static bool16 UpdateRectangularSpiralLine(const s16 * const *arg0, struct RectangularSpiralLine *arg1); -static void SpriteCB_FldEffPokeballTrail(struct Sprite *sprite); -static void SpriteCB_MugshotTrainerPic(struct Sprite *sprite); -static void SpriteCB_WhiteBarFade(struct Sprite *sprite); -static bool8 MugshotTrainerPic_Pause(struct Sprite *sprite); -static bool8 MugshotTrainerPic_Init(struct Sprite *sprite); -static bool8 MugshotTrainerPic_Slide(struct Sprite *sprite); -static bool8 MugshotTrainerPic_SlideSlow(struct Sprite *sprite); -static bool8 MugshotTrainerPic_SlideOffscreen(struct Sprite *sprite); +static bool16 UpdateRectangularSpiralLine(const s16 * const *, struct RectangularSpiralLine *); +static void SpriteCB_FldEffPokeballTrail(struct Sprite *); +static void SpriteCB_MugshotTrainerPic(struct Sprite *); +static void SpriteCB_WhiteBarFade(struct Sprite *); +static bool8 MugshotTrainerPic_Pause(struct Sprite *); +static bool8 MugshotTrainerPic_Init(struct Sprite *); +static bool8 MugshotTrainerPic_Slide(struct Sprite *); +static bool8 MugshotTrainerPic_SlideSlow(struct Sprite *); +static bool8 MugshotTrainerPic_SlideOffscreen(struct Sprite *); static s16 sDebug_RectangularSpiralData; static u8 sTestingTransitionId; @@ -959,10 +959,6 @@ static const TransitionStateFunc sFrontierSquaresScroll_Funcs[] = FrontierSquaresScroll_End }; -// Dimensions for the 2 non-scrolling frontier square transitions. -// SQUARE_SIZE is the same in the scrolling version but it uses -// more because it needs to show more than can be shown at a single -// time n-screen. #define SQUARE_SIZE 4 #define MARGIN_SIZE 1 // Squares do not fit evenly across the width, so there is a margin on either side. #define NUM_SQUARES_PER_ROW ((DISPLAY_WIDTH - (MARGIN_SIZE * 8 * 2)) / (SQUARE_SIZE * 8))