mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Merge pull request #1534 from GriffinRichards/doc-btrans
Document battle transition
This commit is contained in:
commit
0ba22ca112
@ -50,7 +50,7 @@ gFieldEffectScriptPointers::
|
||||
.4byte gFieldEffectScript_HotSpringsWater @ FLDEFF_HOT_SPRINGS_WATER
|
||||
.4byte gFieldEffectScript_UseWaterfall @ FLDEFF_USE_WATERFALL
|
||||
.4byte gFieldEffectScript_UseDive @ FLDEFF_USE_DIVE
|
||||
.4byte gFieldEffectScript_Pokeball @ FLDEFF_POKEBALL
|
||||
.4byte gFieldEffectScript_PokeballTrail @ FLDEFF_POKEBALL_TRAIL
|
||||
.4byte gFieldEffectScript_HeartIcon @ FLDEFF_HEART_ICON
|
||||
.4byte gFieldEffectScript_Nop47 @ FLDEFF_NOP_47
|
||||
.4byte gFieldEffectScript_Nop48 @ FLDEFF_NOP_48
|
||||
@ -254,9 +254,9 @@ gFieldEffectScript_UseDive::
|
||||
field_eff_callnative FldEff_UseDive
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_Pokeball::
|
||||
gFieldEffectScript_PokeballTrail::
|
||||
field_eff_loadpal gSpritePalette_Pokeball
|
||||
field_eff_callnative FldEff_Pokeball
|
||||
field_eff_callnative FldEff_PokeballTrail
|
||||
field_eff_end
|
||||
|
||||
gFieldEffectScript_HeartIcon::
|
||||
|
18
gflib/bg.c
18
gflib/bg.c
@ -950,7 +950,7 @@ void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u
|
||||
CopyRectToBgTilemapBufferRect(bg, src, 0, 0, rectWidth, rectHeight, destX, destY, rectWidth, rectHeight, palette, 0, 0);
|
||||
}
|
||||
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 unused, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, s16 palette1, s16 tileOffset)
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2)
|
||||
{
|
||||
u16 screenWidth, screenHeight, screenSize;
|
||||
u16 var;
|
||||
@ -966,28 +966,28 @@ void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8
|
||||
{
|
||||
case BG_TYPE_NORMAL:
|
||||
srcPtr = src + ((srcY * srcWidth) + srcX) * 2;
|
||||
for (i = destX; i < (destX + rectWidth); i++)
|
||||
for (i = destY; i < (destY + rectHeight); i++)
|
||||
{
|
||||
for (j = srcHeight; j < (srcHeight + destY); j++)
|
||||
for (j = destX; j < (destX + rectWidth); j++)
|
||||
{
|
||||
u16 index = GetTileMapIndexFromCoords(j, i, screenSize, screenWidth, screenHeight);
|
||||
CopyTileMapEntry(srcPtr, sGpuBgConfigs2[bg].tilemap + (index * 2), rectHeight, palette1, tileOffset);
|
||||
CopyTileMapEntry(srcPtr, sGpuBgConfigs2[bg].tilemap + (index * 2), palette1, tileOffset, palette2);
|
||||
srcPtr += 2;
|
||||
}
|
||||
srcPtr += (srcWidth - destY) * 2;
|
||||
srcPtr += (srcWidth - rectWidth) * 2;
|
||||
}
|
||||
break;
|
||||
case BG_TYPE_AFFINE:
|
||||
srcPtr = src + ((srcY * srcWidth) + srcX);
|
||||
var = GetBgMetricAffineMode(bg, 0x1);
|
||||
for (i = destX; i < (destX + rectWidth); i++)
|
||||
for (i = destY; i < (destY + rectHeight); i++)
|
||||
{
|
||||
for (j = srcHeight; j < (srcHeight + destY); j++)
|
||||
for (j = destX; j < (destX + rectWidth); j++)
|
||||
{
|
||||
*(u8*)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8*)(srcPtr) + palette1;
|
||||
*(u8*)(sGpuBgConfigs2[bg].tilemap + ((var * i) + j)) = *(u8*)(srcPtr) + tileOffset;
|
||||
srcPtr++;
|
||||
}
|
||||
srcPtr += (srcWidth - destY);
|
||||
srcPtr += (srcWidth - rectWidth);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ void CopyToBgTilemapBuffer(u8 bg, const void *src, u16 mode, u16 destOffset);
|
||||
void CopyBgTilemapBufferToVram(u8 bg);
|
||||
void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height);
|
||||
void CopyToBgTilemapBufferRect_ChangePalette(u8 bg, const void *src, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette);
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 unused, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, s16 palette1, s16 tileOffset);
|
||||
void CopyRectToBgTilemapBufferRect(u8 bg, const void *src, u8 srcX, u8 srcY, u8 srcWidth, u8 srcHeight, u8 destX, u8 destY, u8 rectWidth, u8 rectHeight, u8 palette1, s16 tileOffset, s16 palette2);
|
||||
void FillBgTilemapBufferRect_Palette0(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height);
|
||||
void FillBgTilemapBufferRect(u8 bg, u16 tileNum, u8 x, u8 y, u8 width, u8 height, u8 palette);
|
||||
void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 width, u8 height, u8 paletteSlot, s16 tileNumDelta);
|
||||
|
@ -1,12 +1,11 @@
|
||||
#ifndef GUARD_BATTLE_TRANSITION_H
|
||||
#define GUARD_BATTLE_TRANSITION_H
|
||||
|
||||
void TestBattleTransition(u8 transitionId);
|
||||
void BattleTransition_StartOnField(u8 transitionId);
|
||||
void BattleTransition_Start(u8 transitionId);
|
||||
bool8 IsBattleTransitionDone(void);
|
||||
bool8 FldEff_Pokeball(void);
|
||||
void TransitionPhase1_Task_RunFuncs(u8 taskId);
|
||||
bool8 FldEff_PokeballTrail(void);
|
||||
void Task_BattleTransition_Intro(u8 taskId);
|
||||
void GetBg0TilesDst(u16 **tilemap, u16 **tileset);
|
||||
|
||||
extern const struct SpritePalette gSpritePalette_Pokeball;
|
||||
@ -26,13 +25,13 @@ enum {
|
||||
B_TRANSITION_SHUFFLE,
|
||||
B_TRANSITION_BIG_POKEBALL,
|
||||
B_TRANSITION_POKEBALLS_TRAIL,
|
||||
B_TRANSITION_CLOCKWISE_BLACKFADE,
|
||||
B_TRANSITION_CLOCKWISE_WIPE,
|
||||
B_TRANSITION_RIPPLE,
|
||||
B_TRANSITION_WAVE,
|
||||
B_TRANSITION_SLICE,
|
||||
B_TRANSITION_WHITEFADE,
|
||||
B_TRANSITION_WHITE_BARS_FADE,
|
||||
B_TRANSITION_GRID_SQUARES,
|
||||
B_TRANSITION_SHARDS,
|
||||
B_TRANSITION_ANGLED_WIPES,
|
||||
B_TRANSITION_SIDNEY,
|
||||
B_TRANSITION_PHOEBE,
|
||||
B_TRANSITION_GLACIA,
|
||||
@ -47,8 +46,8 @@ enum {
|
||||
B_TRANSITION_GROUDON,
|
||||
B_TRANSITION_RAYQUAZA,
|
||||
B_TRANSITION_SHRED_SPLIT,
|
||||
B_TRANSITION_BLACKHOLE1,
|
||||
B_TRANSITION_BLACKHOLE2,
|
||||
B_TRANSITION_BLACKHOLE,
|
||||
B_TRANSITION_BLACKHOLE_PULSATE,
|
||||
B_TRANSITION_RECTANGULAR_SPIRAL,
|
||||
B_TRANSITION_FRONTIER_LOGO_WIGGLE,
|
||||
B_TRANSITION_FRONTIER_LOGO_WAVE,
|
||||
|
@ -1,13 +1,13 @@
|
||||
#ifndef GUARD_BATTLE_TRANSITION_FRONTIER_H
|
||||
#define GUARD_BATTLE_TRANSITION_FRONTIER_H
|
||||
|
||||
void Phase2Task_FrontierCirclesMeet(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesCross(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesAsymmetricSpiral(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesSymmetricSpiral(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesMeetInSeq(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesCrossInSeq(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId);
|
||||
void Phase2Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId);
|
||||
void Task_FrontierCirclesMeet(u8 taskId);
|
||||
void Task_FrontierCirclesCross(u8 taskId);
|
||||
void Task_FrontierCirclesAsymmetricSpiral(u8 taskId);
|
||||
void Task_FrontierCirclesSymmetricSpiral(u8 taskId);
|
||||
void Task_FrontierCirclesMeetInSeq(u8 taskId);
|
||||
void Task_FrontierCirclesCrossInSeq(u8 taskId);
|
||||
void Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId);
|
||||
void Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId);
|
||||
|
||||
#endif // GUARD_BATTLE_TRANSITION_FRONTIER_H
|
||||
|
@ -46,7 +46,7 @@
|
||||
#define FLDEFF_HOT_SPRINGS_WATER 42
|
||||
#define FLDEFF_USE_WATERFALL 43
|
||||
#define FLDEFF_USE_DIVE 44
|
||||
#define FLDEFF_POKEBALL 45
|
||||
#define FLDEFF_POKEBALL_TRAIL 45
|
||||
#define FLDEFF_HEART_ICON 46
|
||||
#define FLDEFF_NOP_47 47
|
||||
#define FLDEFF_NOP_48 48
|
||||
@ -113,7 +113,7 @@
|
||||
#define FLDEFF_PAL_TAG_GENERAL_1 0x1005
|
||||
#define FLDEFF_PAL_TAG_POKEBALL_GLOW 0x1007
|
||||
#define FLDEFF_PAL_TAG_SECRET_POWER_PLANT 0x1008
|
||||
#define FLDEFF_PAL_TAG_POKEBALL 0x1009
|
||||
#define FLDEFF_PAL_TAG_POKEBALL_TRAIL 0x1009
|
||||
#define FLDEFF_PAL_TAG_ASH 0x100D
|
||||
#define FLDEFF_PAL_TAG_SAND_PILLAR 0x100E
|
||||
#define FLDEFF_PAL_TAG_SMALL_SPARKLE 0x100F
|
||||
|
@ -49,8 +49,8 @@ struct PaletteFadeControl
|
||||
extern struct PaletteFadeControl gPaletteFade;
|
||||
extern u32 gPlttBufferTransferPending;
|
||||
extern u8 gPaletteDecompressionBuffer[];
|
||||
extern u16 gPlttBufferUnfaded[];
|
||||
extern u16 gPlttBufferFaded[];
|
||||
extern u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE];
|
||||
extern u16 gPlttBufferFaded[PLTT_BUFFER_SIZE];
|
||||
|
||||
void LoadCompressedPalette(const u32 *, u16, u16);
|
||||
void LoadPalette(const void *, u16, u16);
|
||||
|
@ -47,8 +47,14 @@
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/trainer_hill.h"
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
TRANSITION_TYPE_NORMAL,
|
||||
TRANSITION_TYPE_CAVE,
|
||||
TRANSITION_TYPE_FLASH,
|
||||
TRANSITION_TYPE_WATER,
|
||||
};
|
||||
|
||||
enum {
|
||||
TRAINER_PARAM_LOAD_VAL_8BIT,
|
||||
TRAINER_PARAM_LOAD_VAL_16BIT,
|
||||
TRAINER_PARAM_LOAD_VAL_32BIT,
|
||||
@ -85,7 +91,6 @@ static void HandleRematchVarsOnBattleEnd(void);
|
||||
static const u8 *GetIntroSpeechOfApproachingTrainer(void);
|
||||
static const u8 *GetTrainerCantBattleSpeech(void);
|
||||
|
||||
// ewram vars
|
||||
EWRAM_DATA static u16 sTrainerBattleMode = 0;
|
||||
EWRAM_DATA u16 gTrainerBattleOpponent_A = 0;
|
||||
EWRAM_DATA u16 gTrainerBattleOpponent_B = 0;
|
||||
@ -103,24 +108,22 @@ EWRAM_DATA static u8 *sTrainerBBattleScriptRetAddr = NULL;
|
||||
EWRAM_DATA static bool8 sShouldCheckTrainerBScript = FALSE;
|
||||
EWRAM_DATA static u8 sNoOfPossibleTrainerRetScripts = 0;
|
||||
|
||||
// const rom data
|
||||
|
||||
// The first transition is used if the enemy pokemon are lower level than our pokemon.
|
||||
// Otherwise, the second transition is used.
|
||||
static const u8 sBattleTransitionTable_Wild[][2] =
|
||||
{
|
||||
{B_TRANSITION_SLICE, B_TRANSITION_WHITEFADE}, // Normal
|
||||
{B_TRANSITION_CLOCKWISE_BLACKFADE, B_TRANSITION_GRID_SQUARES}, // Cave
|
||||
{B_TRANSITION_BLUR, B_TRANSITION_GRID_SQUARES}, // Cave with flash used
|
||||
{B_TRANSITION_WAVE, B_TRANSITION_RIPPLE}, // Water
|
||||
[TRANSITION_TYPE_NORMAL] = {B_TRANSITION_SLICE, B_TRANSITION_WHITE_BARS_FADE},
|
||||
[TRANSITION_TYPE_CAVE] = {B_TRANSITION_CLOCKWISE_WIPE, B_TRANSITION_GRID_SQUARES},
|
||||
[TRANSITION_TYPE_FLASH] = {B_TRANSITION_BLUR, B_TRANSITION_GRID_SQUARES},
|
||||
[TRANSITION_TYPE_WATER] = {B_TRANSITION_WAVE, B_TRANSITION_RIPPLE},
|
||||
};
|
||||
|
||||
static const u8 sBattleTransitionTable_Trainer[][2] =
|
||||
{
|
||||
{B_TRANSITION_POKEBALLS_TRAIL, B_TRANSITION_SHARDS}, // Normal
|
||||
{B_TRANSITION_SHUFFLE, B_TRANSITION_BIG_POKEBALL}, // Cave
|
||||
{B_TRANSITION_BLUR, B_TRANSITION_GRID_SQUARES}, // Cave with flash used
|
||||
{B_TRANSITION_SWIRL, B_TRANSITION_RIPPLE}, // Water
|
||||
[TRANSITION_TYPE_NORMAL] = {B_TRANSITION_POKEBALLS_TRAIL, B_TRANSITION_ANGLED_WIPES},
|
||||
[TRANSITION_TYPE_CAVE] = {B_TRANSITION_SHUFFLE, B_TRANSITION_BIG_POKEBALL},
|
||||
[TRANSITION_TYPE_FLASH] = {B_TRANSITION_BLUR, B_TRANSITION_GRID_SQUARES},
|
||||
[TRANSITION_TYPE_WATER] = {B_TRANSITION_SWIRL, B_TRANSITION_RIPPLE},
|
||||
};
|
||||
|
||||
// Battle Frontier (excluding Pyramid and Dome, which have their own tables below)
|
||||
@ -552,7 +555,7 @@ void StartGroudonKyogreBattle(void)
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_KYOGRE_GROUDON;
|
||||
|
||||
if (gGameVersion == VERSION_RUBY)
|
||||
CreateBattleStartTask(B_TRANSITION_SHARDS, MUS_VS_KYOGRE_GROUDON); // GROUDON
|
||||
CreateBattleStartTask(B_TRANSITION_ANGLED_WIPES, MUS_VS_KYOGRE_GROUDON); // GROUDON
|
||||
else
|
||||
CreateBattleStartTask(B_TRANSITION_RIPPLE, MUS_VS_KYOGRE_GROUDON); // KYOGRE
|
||||
|
||||
@ -697,20 +700,20 @@ static u8 GetBattleTransitionTypeByMap(void)
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||
if (Overworld_GetFlashLevel())
|
||||
return B_TRANSITION_SHUFFLE;
|
||||
return TRANSITION_TYPE_FLASH;
|
||||
if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
|
||||
{
|
||||
switch (gMapHeader.mapType)
|
||||
{
|
||||
case MAP_TYPE_UNDERGROUND:
|
||||
return B_TRANSITION_SWIRL;
|
||||
return TRANSITION_TYPE_CAVE;
|
||||
case MAP_TYPE_UNDERWATER:
|
||||
return B_TRANSITION_BIG_POKEBALL;
|
||||
return TRANSITION_TYPE_WATER;
|
||||
default:
|
||||
return B_TRANSITION_BLUR;
|
||||
return TRANSITION_TYPE_NORMAL;
|
||||
}
|
||||
}
|
||||
return B_TRANSITION_BIG_POKEBALL;
|
||||
return TRANSITION_TYPE_WATER;
|
||||
}
|
||||
|
||||
static u16 GetSumOfPlayerPartyLevel(u8 numMons)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@
|
||||
|
||||
typedef bool8 (*TransitionStateFunc)(struct Task *task);
|
||||
|
||||
// this file's functions
|
||||
static void SpriteCB_LogoCircleSlide(struct Sprite *sprite);
|
||||
static void SpriteCB_LogoCircleSpiral(struct Sprite *sprite);
|
||||
static bool8 WaitForLogoCirclesAnim(struct Task *task);
|
||||
@ -46,7 +45,6 @@ static bool8 CirclesSymmetricSpiralInSeq_End(struct Task *task);
|
||||
|
||||
#define PALTAG_LOGO_CIRCLES 0x2E90
|
||||
|
||||
// const rom data
|
||||
static const u32 sLogoCenter_Gfx[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_center.4bpp.lz");
|
||||
static const u32 sLogoCenter_Tilemap[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_center.bin");
|
||||
static const u32 sLogoCircles_Gfx[] = INCBIN_U32("graphics/battle_transitions/frontier_logo_circles.4bpp.lz");
|
||||
@ -121,7 +119,7 @@ static const struct SpriteTemplate sSpriteTemplate_LogoCircles =
|
||||
.callback = SpriteCallbackDummy,
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesMeet_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesMeet_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesMeet_CreateSprites,
|
||||
@ -130,7 +128,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesMeet_Funcs[] =
|
||||
CirclesMeet_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesCross_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesCross_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesCross_CreateSprites,
|
||||
@ -139,7 +137,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesCross_Funcs[] =
|
||||
CirclesCross_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiral_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesAsymmetricSpiral_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesAsymmetricSpiral_CreateSprites,
|
||||
@ -148,7 +146,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiral_Funcs[]
|
||||
CirclesAsymmetricSpiral_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiral_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesSymmetricSpiral_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesSymmetricSpiral_CreateSprites,
|
||||
@ -157,7 +155,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiral_Funcs[]
|
||||
CirclesSymmetricSpiral_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesMeetInSeq_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesMeetInSeq_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesMeetInSeq_CreateSprites,
|
||||
@ -166,7 +164,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesMeetInSeq_Funcs[] =
|
||||
CirclesMeetInSeq_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesCrossInSeq_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesCrossInSeq_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesCrossInSeq_CreateSprites,
|
||||
@ -175,7 +173,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesCrossInSeq_Funcs[] =
|
||||
CirclesCrossInSeq_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiralInSeq_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesAsymmetricSpiralInSeq_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesAsymmetricSpiralInSeq_CreateSprites,
|
||||
@ -184,7 +182,7 @@ static const TransitionStateFunc sPhase2_FrontierCirclesAsymmetricSpiralInSeq_Fu
|
||||
CirclesAsymmetricSpiralInSeq_End
|
||||
};
|
||||
|
||||
static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiralInSeq_Funcs[] =
|
||||
static const TransitionStateFunc sFrontierCirclesSymmetricSpiralInSeq_Funcs[] =
|
||||
{
|
||||
Circles_Init,
|
||||
CirclesSymmetricSpiralInSeq_CreateSprites,
|
||||
@ -193,45 +191,72 @@ static const TransitionStateFunc sPhase2_FrontierCirclesSymmetricSpiralInSeq_Fun
|
||||
CirclesSymmetricSpiralInSeq_End
|
||||
};
|
||||
|
||||
// code
|
||||
// Task data
|
||||
#define tState data[0]
|
||||
#define tTimer data[1]
|
||||
#define tBlend data[2]
|
||||
#define tFadeTimer data[3]
|
||||
#define tCircle1SpriteId data[4]
|
||||
#define tCircle2SpriteId data[5]
|
||||
#define tCircle3SpriteId data[6]
|
||||
|
||||
#define sTargetX data[0]
|
||||
#define sTargetY data[1]
|
||||
|
||||
// Sprite data for CreateSlidingLogoCircleSprite
|
||||
#define sSpeedX data[2]
|
||||
#define sSpeedY data[3]
|
||||
#define sTimerX data[4]
|
||||
#define sTimerY data[5]
|
||||
#define sDelayX data[6]
|
||||
#define sDelayY data[7]
|
||||
|
||||
// Sprite data for CreateSpiralingLogoCircleSprite
|
||||
#define sAngle data[2]
|
||||
#define sRotateSpeed data[3]
|
||||
#define sRadius data[4]
|
||||
#define sTargetRadius data[5]
|
||||
#define sRadiusDelta data[6]
|
||||
|
||||
|
||||
static void LoadLogoGfx(void)
|
||||
{
|
||||
u16 *dst1, *dst2;
|
||||
u16 *tilemap, *tileset;
|
||||
|
||||
GetBg0TilesDst(&dst1, &dst2);
|
||||
LZ77UnCompVram(sLogoCenter_Gfx, dst2);
|
||||
LZ77UnCompVram(sLogoCenter_Tilemap, dst1);
|
||||
LoadPalette(sLogo_Pal, 0xF0, 0x20);
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sLogoCenter_Gfx, tileset);
|
||||
LZ77UnCompVram(sLogoCenter_Tilemap, tilemap);
|
||||
LoadPalette(sLogo_Pal, 0xF0, sizeof(sLogo_Pal));
|
||||
LoadCompressedSpriteSheet(&sSpriteSheet_LogoCircles);
|
||||
LoadSpritePalette(&sSpritePalette_LogoCircles);
|
||||
}
|
||||
|
||||
static u8 CreateSlidingLogoCircleSprite(s16 x, s16 y, u8 arg2, u8 arg3, s8 arg4, s8 arg5, u8 spriteAnimNum)
|
||||
static u8 CreateSlidingLogoCircleSprite(s16 x, s16 y, u8 delayX, u8 delayY, s8 speedX, s8 speedY, u8 spriteAnimNum)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&sSpriteTemplate_LogoCircles, x, y, 0);
|
||||
|
||||
switch (spriteAnimNum)
|
||||
{
|
||||
case 0:
|
||||
gSprites[spriteId].data[0] = 120;
|
||||
gSprites[spriteId].data[1] = 45;
|
||||
gSprites[spriteId].sTargetX = 120;
|
||||
gSprites[spriteId].sTargetY = 45;
|
||||
break;
|
||||
case 1:
|
||||
gSprites[spriteId].data[0] = 89;
|
||||
gSprites[spriteId].data[1] = 97;
|
||||
gSprites[spriteId].sTargetX = 89;
|
||||
gSprites[spriteId].sTargetY = 97;
|
||||
break;
|
||||
case 2:
|
||||
gSprites[spriteId].data[0] = 151;
|
||||
gSprites[spriteId].data[1] = 97;
|
||||
gSprites[spriteId].sTargetX = 151;
|
||||
gSprites[spriteId].sTargetY = 97;
|
||||
break;
|
||||
}
|
||||
|
||||
gSprites[spriteId].data[2] = arg4;
|
||||
gSprites[spriteId].data[3] = arg5;
|
||||
gSprites[spriteId].data[6] = arg2;
|
||||
gSprites[spriteId].data[7] = arg3;
|
||||
gSprites[spriteId].data[4] = 0;
|
||||
gSprites[spriteId].data[5] = 0;
|
||||
gSprites[spriteId].sSpeedX = speedX;
|
||||
gSprites[spriteId].sSpeedY = speedY;
|
||||
gSprites[spriteId].sDelayX = delayX;
|
||||
gSprites[spriteId].sDelayY = delayY;
|
||||
gSprites[spriteId].sTimerX = 0;
|
||||
gSprites[spriteId].sTimerY = 0;
|
||||
|
||||
StartSpriteAnim(&gSprites[spriteId], spriteAnimNum);
|
||||
gSprites[spriteId].callback = SpriteCB_LogoCircleSlide;
|
||||
@ -243,59 +268,60 @@ static void SpriteCB_LogoCircleSlide(struct Sprite *sprite)
|
||||
{
|
||||
s16 *data = sprite->data;
|
||||
|
||||
if (sprite->x == data[0] && sprite->y == data[1])
|
||||
if (sprite->x == sTargetX && sprite->y == sTargetY)
|
||||
{
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data[4] == data[6])
|
||||
if (sTimerX == sDelayX)
|
||||
{
|
||||
sprite->x += data[2];
|
||||
data[4] = 0;
|
||||
sprite->x += sSpeedX;
|
||||
sTimerX = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data[4]++;
|
||||
sTimerX++;
|
||||
}
|
||||
|
||||
if (data[5] == data[7])
|
||||
if (sTimerY == sDelayY)
|
||||
{
|
||||
sprite->y += data[3];
|
||||
data[5] = 0;
|
||||
sprite->y += sSpeedY;
|
||||
sTimerY = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
data[5]++;
|
||||
sTimerY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static u8 CreateSpiralingLogoCircleSprite(s16 x, s16 y, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, u8 spriteAnimNum)
|
||||
static u8 CreateSpiralingLogoCircleSprite(s16 x, s16 y, s16 angle, s16 rotateSpeed, s16 radiusStart, s16 radiusEnd, s16 radiusDelta, u8 spriteAnimNum)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&sSpriteTemplate_LogoCircles, x, y, 0);
|
||||
|
||||
// Target coords are set but irrelevant
|
||||
switch (spriteAnimNum)
|
||||
{
|
||||
case 0:
|
||||
gSprites[spriteId].data[0] = 120;
|
||||
gSprites[spriteId].data[1] = 45;
|
||||
gSprites[spriteId].sTargetX = 120;
|
||||
gSprites[spriteId].sTargetY = 45;
|
||||
break;
|
||||
case 1:
|
||||
gSprites[spriteId].data[0] = 89;
|
||||
gSprites[spriteId].data[1] = 97;
|
||||
gSprites[spriteId].sTargetX = 89;
|
||||
gSprites[spriteId].sTargetY = 97;
|
||||
break;
|
||||
case 2:
|
||||
gSprites[spriteId].data[0] = 151;
|
||||
gSprites[spriteId].data[1] = 97;
|
||||
gSprites[spriteId].sTargetX = 151;
|
||||
gSprites[spriteId].sTargetY = 97;
|
||||
break;
|
||||
}
|
||||
|
||||
gSprites[spriteId].data[2] = arg2;
|
||||
gSprites[spriteId].data[3] = arg3;
|
||||
gSprites[spriteId].data[4] = arg4;
|
||||
gSprites[spriteId].data[5] = arg5;
|
||||
gSprites[spriteId].data[6] = arg6;
|
||||
gSprites[spriteId].sAngle = angle;
|
||||
gSprites[spriteId].sRotateSpeed = rotateSpeed;
|
||||
gSprites[spriteId].sRadius = radiusStart;
|
||||
gSprites[spriteId].sTargetRadius = radiusEnd;
|
||||
gSprites[spriteId].sRadiusDelta = radiusDelta;
|
||||
|
||||
StartSpriteAnim(&gSprites[spriteId], spriteAnimNum);
|
||||
gSprites[spriteId].callback = SpriteCB_LogoCircleSpiral;
|
||||
@ -305,34 +331,32 @@ static u8 CreateSpiralingLogoCircleSprite(s16 x, s16 y, s16 arg2, s16 arg3, s16
|
||||
|
||||
static void SpriteCB_LogoCircleSpiral(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x2 = (Sin2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096
|
||||
sprite->y2 = (Cos2(sprite->data[2]) * sprite->data[4]) >> 12; // div by 4096
|
||||
sprite->x2 = (Sin2(sprite->sAngle) * sprite->sRadius) >> 12; // div by 4096
|
||||
sprite->y2 = (Cos2(sprite->sAngle) * sprite->sRadius) >> 12; // div by 4096
|
||||
|
||||
sprite->data[2] = (sprite->data[2] + sprite->data[3]) % 360;
|
||||
sprite->sAngle = (sprite->sAngle + sprite->sRotateSpeed) % 360;
|
||||
|
||||
if (sprite->data[4] != sprite->data[5])
|
||||
sprite->data[4] += sprite->data[6];
|
||||
if (sprite->sRadius != sprite->sTargetRadius)
|
||||
sprite->sRadius += sprite->sRadiusDelta;
|
||||
else
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
|
||||
#define tState data[0]
|
||||
|
||||
static void DestroyLogoCirclesGfx(struct Task *task)
|
||||
{
|
||||
FreeSpriteTilesByTag(PALTAG_LOGO_CIRCLES);
|
||||
FreeSpritePaletteByTag(PALTAG_LOGO_CIRCLES);
|
||||
|
||||
DestroySprite(&gSprites[task->data[4]]);
|
||||
DestroySprite(&gSprites[task->data[5]]);
|
||||
DestroySprite(&gSprites[task->data[6]]);
|
||||
DestroySprite(&gSprites[task->tCircle1SpriteId]);
|
||||
DestroySprite(&gSprites[task->tCircle2SpriteId]);
|
||||
DestroySprite(&gSprites[task->tCircle3SpriteId]);
|
||||
}
|
||||
|
||||
static bool8 IsLogoCirclesAnimFinished(struct Task *task)
|
||||
{
|
||||
if (gSprites[task->data[4]].callback == SpriteCallbackDummy
|
||||
&& gSprites[task->data[5]].callback == SpriteCallbackDummy
|
||||
&& gSprites[task->data[6]].callback == SpriteCallbackDummy)
|
||||
if (gSprites[task->tCircle1SpriteId].callback == SpriteCallbackDummy
|
||||
&& gSprites[task->tCircle2SpriteId].callback == SpriteCallbackDummy
|
||||
&& gSprites[task->tCircle3SpriteId].callback == SpriteCallbackDummy)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@ -340,13 +364,13 @@ static bool8 IsLogoCirclesAnimFinished(struct Task *task)
|
||||
|
||||
static bool8 Circles_Init(struct Task *task)
|
||||
{
|
||||
if (task->data[1] == 0)
|
||||
if (task->tTimer == 0)
|
||||
{
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON);
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_WIN1_ON);
|
||||
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON);
|
||||
|
||||
task->data[1]++;
|
||||
task->tTimer++;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
@ -358,7 +382,7 @@ static bool8 Circles_Init(struct Task *task)
|
||||
ChangeBgY(0, 0, 0);
|
||||
ChangeBgY(0, 0x500, 2);
|
||||
|
||||
task->data[1] = 0;
|
||||
task->tTimer = 0;
|
||||
task->tState++;
|
||||
return TRUE;
|
||||
}
|
||||
@ -366,27 +390,27 @@ static bool8 Circles_Init(struct Task *task)
|
||||
|
||||
static bool8 FadeInCenterLogoCircle(struct Task *task)
|
||||
{
|
||||
if (task->data[2] == 0)
|
||||
if (task->tBlend == 0)
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG0_ON);
|
||||
|
||||
if (task->data[2] == 16)
|
||||
if (task->tBlend == 16)
|
||||
{
|
||||
if (task->data[3] == 31)
|
||||
if (task->tFadeTimer == 31)
|
||||
{
|
||||
BeginNormalPaletteFade(PALETTES_ALL, -1, 0, 0x10, RGB_BLACK);
|
||||
task->tState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[3]++;
|
||||
task->tFadeTimer++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 blnd;
|
||||
|
||||
task->data[2]++;
|
||||
blnd = task->data[2];
|
||||
task->tBlend++;
|
||||
blnd = task->tBlend;
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(blnd, 16 - blnd));
|
||||
}
|
||||
|
||||
@ -401,16 +425,16 @@ static bool8 WaitForLogoCirclesAnim(struct Task *task)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesMeet(u8 taskId)
|
||||
void Task_FrontierCirclesMeet(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesMeet_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesMeet_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesMeet_CreateSprites(struct Task *task)
|
||||
{
|
||||
task->data[4] = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 2, 0);
|
||||
task->data[5] = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 2, -2, 1);
|
||||
task->data[6] = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -2, -2, 2);
|
||||
task->tCircle1SpriteId = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 2, 0);
|
||||
task->tCircle2SpriteId = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 2, -2, 1);
|
||||
task->tCircle3SpriteId = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -2, -2, 2);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -421,22 +445,22 @@ static bool8 CirclesMeet_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesMeet));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesMeet));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesCross(u8 taskId)
|
||||
void Task_FrontierCirclesCross(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesCross_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesCross_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesCross_CreateSprites(struct Task *task)
|
||||
{
|
||||
task->data[4] = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -4, 0);
|
||||
task->data[5] = CreateSlidingLogoCircleSprite(241, 59, 0, 1, -4, 2, 1);
|
||||
task->data[6] = CreateSlidingLogoCircleSprite(-1, 59, 0, 1, 4, 2, 2);
|
||||
task->tCircle1SpriteId = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -4, 0);
|
||||
task->tCircle2SpriteId = CreateSlidingLogoCircleSprite(241, 59, 0, 1, -4, 2, 1);
|
||||
task->tCircle3SpriteId = CreateSlidingLogoCircleSprite(-1, 59, 0, 1, 4, 2, 2);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -447,22 +471,22 @@ static bool8 CirclesCross_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesCross));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesCross));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesAsymmetricSpiral(u8 taskId)
|
||||
void Task_FrontierCirclesAsymmetricSpiral(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesAsymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesAsymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesAsymmetricSpiral_CreateSprites(struct Task *task)
|
||||
{
|
||||
task->data[4] = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0);
|
||||
task->data[5] = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1);
|
||||
task->data[6] = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2);
|
||||
task->tCircle1SpriteId = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0);
|
||||
task->tCircle2SpriteId = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1);
|
||||
task->tCircle3SpriteId = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -473,22 +497,22 @@ static bool8 CirclesAsymmetricSpiral_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesAsymmetricSpiral));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesAsymmetricSpiral));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesSymmetricSpiral(u8 taskId)
|
||||
void Task_FrontierCirclesSymmetricSpiral(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesSymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesSymmetricSpiral_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesSymmetricSpiral_CreateSprites(struct Task *task)
|
||||
{
|
||||
task->data[4] = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0);
|
||||
task->data[5] = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1);
|
||||
task->data[6] = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2);
|
||||
task->tCircle1SpriteId = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0);
|
||||
task->tCircle2SpriteId = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1);
|
||||
task->tCircle3SpriteId = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -499,34 +523,34 @@ static bool8 CirclesSymmetricSpiral_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesSymmetricSpiral));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesSymmetricSpiral));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesMeetInSeq(u8 taskId)
|
||||
void Task_FrontierCirclesMeetInSeq(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesMeetInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesMeetInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesMeetInSeq_CreateSprites(struct Task *task)
|
||||
{
|
||||
if (task->data[1] == 0)
|
||||
if (task->tTimer == 0)
|
||||
{
|
||||
task->data[4] = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 4, 0);
|
||||
task->tCircle1SpriteId = CreateSlidingLogoCircleSprite(120, -51, 0, 0, 0, 4, 0);
|
||||
}
|
||||
else if (task->data[1] == 16)
|
||||
else if (task->tTimer == 16)
|
||||
{
|
||||
task->data[5] = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 4, -4, 1);
|
||||
task->tCircle2SpriteId = CreateSlidingLogoCircleSprite(-7, 193, 0, 0, 4, -4, 1);
|
||||
}
|
||||
else if (task->data[1] == 32)
|
||||
else if (task->tTimer == 32)
|
||||
{
|
||||
task->data[6] = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -4, -4, 2);
|
||||
task->tCircle3SpriteId = CreateSlidingLogoCircleSprite(247, 193, 0, 0, -4, -4, 2);
|
||||
task->tState++;
|
||||
}
|
||||
|
||||
task->data[1]++;
|
||||
task->tTimer++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -535,34 +559,34 @@ static bool8 CirclesMeetInSeq_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesMeetInSeq));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesMeetInSeq));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesCrossInSeq(u8 taskId)
|
||||
void Task_FrontierCirclesCrossInSeq(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesCrossInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesCrossInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesCrossInSeq_CreateSprites(struct Task *task)
|
||||
{
|
||||
if (task->data[1] == 0)
|
||||
if (task->tTimer == 0)
|
||||
{
|
||||
task->data[4] = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -8, 0);
|
||||
task->tCircle1SpriteId = CreateSlidingLogoCircleSprite(120, 197, 0, 0, 0, -8, 0);
|
||||
}
|
||||
else if (task->data[1] == 16)
|
||||
else if (task->tTimer == 16)
|
||||
{
|
||||
task->data[5] = CreateSlidingLogoCircleSprite(241, 78, 0, 0, -8, 1, 1);
|
||||
task->tCircle2SpriteId = CreateSlidingLogoCircleSprite(241, 78, 0, 0, -8, 1, 1);
|
||||
}
|
||||
else if (task->data[1] == 32)
|
||||
else if (task->tTimer == 32)
|
||||
{
|
||||
task->data[6] = CreateSlidingLogoCircleSprite(-1, 78, 0, 0, 8, 1, 2);
|
||||
task->tCircle3SpriteId = CreateSlidingLogoCircleSprite(-1, 78, 0, 0, 8, 1, 2);
|
||||
task->tState++;
|
||||
}
|
||||
|
||||
task->data[1]++;
|
||||
task->tTimer++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -571,34 +595,34 @@ static bool8 CirclesCrossInSeq_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesCrossInSeq));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesCrossInSeq));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId)
|
||||
void Task_FrontierCirclesAsymmetricSpiralInSeq(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesAsymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesAsymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesAsymmetricSpiralInSeq_CreateSprites(struct Task *task)
|
||||
{
|
||||
if (task->data[1] == 0)
|
||||
if (task->tTimer == 0)
|
||||
{
|
||||
task->data[4] = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0);
|
||||
task->tCircle1SpriteId = CreateSpiralingLogoCircleSprite(120, 45, 12, 4, 128, 0, -4, 0);
|
||||
}
|
||||
else if (task->data[1] == 16)
|
||||
else if (task->tTimer == 16)
|
||||
{
|
||||
task->data[5] = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1);
|
||||
task->tCircle2SpriteId = CreateSpiralingLogoCircleSprite(89, 97, 252, 4, 128, 0, -4, 1);
|
||||
}
|
||||
else if (task->data[1] == 32)
|
||||
else if (task->tTimer == 32)
|
||||
{
|
||||
task->data[6] = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2);
|
||||
task->tCircle3SpriteId = CreateSpiralingLogoCircleSprite(151, 97, 132, 4, 128, 0, -4, 2);
|
||||
task->tState++;
|
||||
}
|
||||
|
||||
task->data[1]++;
|
||||
task->tTimer++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -607,34 +631,34 @@ static bool8 CirclesAsymmetricSpiralInSeq_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesAsymmetricSpiralInSeq));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesAsymmetricSpiralInSeq));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void Phase2Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId)
|
||||
void Task_FrontierCirclesSymmetricSpiralInSeq(u8 taskId)
|
||||
{
|
||||
while (sPhase2_FrontierCirclesSymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
while (sFrontierCirclesSymmetricSpiralInSeq_Funcs[gTasks[taskId].tState](&gTasks[taskId]));
|
||||
}
|
||||
|
||||
static bool8 CirclesSymmetricSpiralInSeq_CreateSprites(struct Task *task)
|
||||
{
|
||||
if (task->data[1] == 0)
|
||||
if (task->tTimer == 0)
|
||||
{
|
||||
task->data[4] = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0);
|
||||
task->tCircle1SpriteId = CreateSpiralingLogoCircleSprite(120, 80, 284, 8, 131, 35, -3, 0);
|
||||
}
|
||||
else if (task->data[1] == 16)
|
||||
else if (task->tTimer == 16)
|
||||
{
|
||||
task->data[5] = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1);
|
||||
task->tCircle2SpriteId = CreateSpiralingLogoCircleSprite(120, 80, 44, 8, 131, 35, -3, 1);
|
||||
}
|
||||
else if (task->data[1] == 32)
|
||||
else if (task->tTimer == 32)
|
||||
{
|
||||
task->data[6] = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2);
|
||||
task->tCircle3SpriteId = CreateSpiralingLogoCircleSprite(121, 80, 164, 8, 131, 35, -3, 2);
|
||||
task->tState++;
|
||||
}
|
||||
|
||||
task->data[1]++;
|
||||
task->tTimer++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -643,7 +667,7 @@ static bool8 CirclesSymmetricSpiralInSeq_End(struct Task *task)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
DestroyLogoCirclesGfx(task);
|
||||
DestroyTask(FindTaskIdByFunc(Phase2Task_FrontierCirclesSymmetricSpiralInSeq));
|
||||
DestroyTask(FindTaskIdByFunc(Task_FrontierCirclesSymmetricSpiralInSeq));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
@ -2792,7 +2792,7 @@ static void SwitchSelectedMons(u8 taskId)
|
||||
// returns FALSE if the slot has slid fully offscreen / back onscreen
|
||||
static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newWidth)
|
||||
{
|
||||
if ((x + width) < 0)
|
||||
if (x + width < 0)
|
||||
return FALSE;
|
||||
if (x > 31)
|
||||
return FALSE;
|
||||
@ -2807,7 +2807,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW
|
||||
{
|
||||
*leftMove = 0;
|
||||
*newX = x;
|
||||
if ((x + width) > 31)
|
||||
if (x + width > 31)
|
||||
*newWidth = 32 - x;
|
||||
else
|
||||
*newWidth = width;
|
||||
@ -2818,14 +2818,13 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW
|
||||
|
||||
static void MoveAndBufferPartySlot(const void *rectSrc, s16 x, s16 y, s16 width, s16 height, s16 dir)
|
||||
{
|
||||
// The use of the dimension parameters here is a mess
|
||||
u8 leftMove, newX, newWidth; // leftMove is used as a srcX, newX is used as both x and srcHeight, newWidth is used as both width and destY
|
||||
u8 srcX, newX, newWidth;
|
||||
|
||||
if (TryMovePartySlot(x, width, &leftMove, &newX, &newWidth))
|
||||
if (TryMovePartySlot(x, width, &srcX, &newX, &newWidth))
|
||||
{
|
||||
FillBgTilemapBufferRect_Palette0(0, 0, newX, y, newWidth, height);
|
||||
if (TryMovePartySlot(x + dir, width, &leftMove, &newX, &newWidth))
|
||||
CopyRectToBgTilemapBufferRect(0, rectSrc, leftMove, 0, width, height, newX, y, newWidth, height, 17, 0, 0);
|
||||
if (TryMovePartySlot(x + dir, width, &srcX, &newX, &newWidth))
|
||||
CopyRectToBgTilemapBufferRect(0, rectSrc, srcX, 0, width, height, newX, y, newWidth, height, 17, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5437,16 +5437,16 @@ static bool32 WaitForWallpaperGfxLoad(void)
|
||||
|
||||
static void DrawWallpaper(const void *tilemap, s8 direction, u8 offset)
|
||||
{
|
||||
s16 var = offset * 256;
|
||||
s16 var2 = (offset * 2) + 3;
|
||||
s16 tileOffset = offset * 256;
|
||||
s16 paletteNum = (offset * 2) + 3;
|
||||
s16 x = ((sStorage->bg2_X / 8 + 10) + (direction * 24)) & 0x3F;
|
||||
|
||||
CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, var, var2);
|
||||
CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 20, 18, x, 2, 20, 18, 17, tileOffset, paletteNum);
|
||||
|
||||
if (direction == 0)
|
||||
return;
|
||||
if (direction > 0)
|
||||
x += 0x14;
|
||||
x += 20;
|
||||
else
|
||||
x -= 4;
|
||||
|
||||
|
@ -1169,7 +1169,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer)
|
||||
{
|
||||
CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % 4], gPlttBufferUnfaded + 0x80, 32);
|
||||
BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF);
|
||||
if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) != TASK_NONE)
|
||||
if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) != TASK_NONE)
|
||||
{
|
||||
sSecondaryTilesetAnimCallback = TilesetAnim_BattleDome2;
|
||||
sSecondaryTilesetAnimCounterMax = 32;
|
||||
@ -1179,7 +1179,7 @@ static void BlendAnimPalette_BattleDome_FloorLights(u16 timer)
|
||||
static void BlendAnimPalette_BattleDome_FloorLightsNoBlend(u16 timer)
|
||||
{
|
||||
CpuCopy16(gTilesetAnims_BattleDomeFloorLightPals[timer % 4], gPlttBufferUnfaded + 0x80, 32);
|
||||
if ((u8)FindTaskIdByFunc(TransitionPhase1_Task_RunFuncs) == TASK_NONE)
|
||||
if ((u8)FindTaskIdByFunc(Task_BattleTransition_Intro) == TASK_NONE)
|
||||
{
|
||||
BlendPalette(0x80, 16, gPaletteFade.y, gPaletteFade.blendColor & 0x7FFF);
|
||||
if (!--sSecondaryTilesetAnimCounterMax)
|
||||
|
Loading…
Reference in New Issue
Block a user