summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/battle_anim_effects_3.c2
-rw-r--r--src/battle_anim_mons.c6
-rw-r--r--src/battle_anim_rock.c30
-rwxr-xr-xsrc/battle_anim_throw.c2
-rw-r--r--src/battle_gfx_sfx_util.c8
-rw-r--r--src/credits.c1970
-rw-r--r--src/data.c36
-rw-r--r--src/data/credits.h787
-rw-r--r--src/data/graphics/intro_scene.h73
-rw-r--r--src/decompress.c2
-rw-r--r--src/hall_of_fame.c6
-rw-r--r--src/intro.c2719
-rw-r--r--src/intro_credits_graphics.c793
-rw-r--r--src/menu_specialized.c2
-rw-r--r--src/mystery_gift.c8
-rwxr-xr-xsrc/pokemon_jump.c4
-rw-r--r--src/pokemon_storage_system.c6
-rw-r--r--src/pokenav_conditions_1.c2
-rw-r--r--src/pokenav_conditions_2.c2
-rw-r--r--src/title_screen.c8
-rw-r--r--src/trade.c6
-rw-r--r--src/use_pokeblock.c2
-rw-r--r--src/wireless_communication_status_screen.c4
23 files changed, 3460 insertions, 3018 deletions
diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c
index 81ba475f9..0c56c6bca 100755
--- a/src/battle_anim_effects_3.c
+++ b/src/battle_anim_effects_3.c
@@ -2292,7 +2292,7 @@ void AnimTask_TransformMon(u8 taskId)
src = gMonSpritesGfxPtr->sprites.ptr[position] + (gBattleMonForms[gBattleAnimAttacker] << 11);
dest = animBg.bgTiles;
- CpuCopy32(src, dest, 0x800);
+ CpuCopy32(src, dest, MON_PIC_SIZE);
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
if (IsContest())
{
diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c
index 688009519..6fd8cd621 100644
--- a/src/battle_anim_mons.c
+++ b/src/battle_anim_mons.c
@@ -107,8 +107,8 @@ static const struct SpriteTemplate sSpriteTemplate_MoveEffectMons[] =
static const struct SpriteSheet sSpriteSheet_MoveEffectMons[] =
{
- { gMiscBlank_Gfx, 0x800, TAG_MOVE_EFFECT_MON_1, },
- { gMiscBlank_Gfx, 0x800, TAG_MOVE_EFFECT_MON_2, },
+ { gMiscBlank_Gfx, MON_PIC_SIZE, TAG_MOVE_EFFECT_MON_1, },
+ { gMiscBlank_Gfx, MON_PIC_SIZE, TAG_MOVE_EFFECT_MON_2, },
};
u8 GetBattlerSpriteCoord(u8 battlerId, u8 coordType)
@@ -2068,7 +2068,7 @@ u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16
FALSE);
}
- RequestDma3Copy(gMonSpritesGfxPtr->buffer, (void *)(OBJ_VRAM0 + (sheet * 0x20)), 0x800, 1);
+ RequestDma3Copy(gMonSpritesGfxPtr->buffer, (void *)(OBJ_VRAM0 + (sheet * 0x20)), MON_PIC_SIZE, 1);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
if (!isBackpic)
diff --git a/src/battle_anim_rock.c b/src/battle_anim_rock.c
index 245fb43a2..c2db62063 100644
--- a/src/battle_anim_rock.c
+++ b/src/battle_anim_rock.c
@@ -142,37 +142,37 @@ static const struct SubspriteTable sFlyingSandSubspriteTable[] =
{ARRAY_COUNT(sFlyingSandSubsprites), sFlyingSandSubsprites},
};
-static const union AnimCmd sAnim_BasicRock_0[] =
+static const union AnimCmd sAnim_Rock_Biggest[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
-static const union AnimCmd sAnim_BasicRock_1[] =
+static const union AnimCmd sAnim_Rock_Bigger[] =
{
ANIMCMD_FRAME(16, 1),
ANIMCMD_END,
};
-static const union AnimCmd sAnim_WeatherBallRockDown_0[] =
+static const union AnimCmd sAnim_Rock_Big[] =
{
ANIMCMD_FRAME(32, 1),
ANIMCMD_END,
};
-static const union AnimCmd sAnim_WeatherBallRockDown_1[] =
+static const union AnimCmd sAnim_Rock_Small[] =
{
ANIMCMD_FRAME(48, 1),
ANIMCMD_END,
};
-static const union AnimCmd sAnim_TwisterRock_0[] =
+static const union AnimCmd sAnim_Rock_Smaller[] =
{
ANIMCMD_FRAME(64, 1),
ANIMCMD_END,
};
-static const union AnimCmd sAnim_TwisterRock_1[] =
+static const union AnimCmd sAnim_Rock_Smallest[] =
{
ANIMCMD_FRAME(80, 1),
ANIMCMD_END,
@@ -180,16 +180,12 @@ static const union AnimCmd sAnim_TwisterRock_1[] =
static const union AnimCmd *const sAnims_BasicRock[] =
{
- sAnim_BasicRock_0,
- sAnim_BasicRock_1,
- sAnim_WeatherBallRockDown_0,
- sAnim_WeatherBallRockDown_1,
-};
-
-static const union AnimCmd *const sAnims_TwisterRock[] =
-{
- sAnim_TwisterRock_0,
- sAnim_TwisterRock_1,
+ sAnim_Rock_Biggest,
+ sAnim_Rock_Bigger,
+ sAnim_Rock_Big,
+ sAnim_Rock_Small,
+ sAnim_Rock_Smaller,
+ sAnim_Rock_Smallest,
};
const struct SpriteTemplate gAncientPowerRockSpriteTemplate =
@@ -281,7 +277,7 @@ const struct SpriteTemplate gTwisterRockSpriteTemplate =
.tileTag = ANIM_TAG_ROCKS,
.paletteTag = ANIM_TAG_ROCKS,
.oam = &gOamData_AffineOff_ObjNormal_32x32,
- .anims = sAnims_TwisterRock,
+ .anims = &sAnims_BasicRock[4],
.images = NULL,
.affineAnims = sAffineAnims_BasicRock,
.callback = AnimMoveTwisterParticle,
diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c
index 5b355c4bd..d36f6c3f9 100755
--- a/src/battle_anim_throw.c
+++ b/src/battle_anim_throw.c
@@ -2182,7 +2182,7 @@ void AnimTask_SubstituteFadeToInvisible(u8 taskId)
break;
case 2:
spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
- RequestDma3Fill(0, (void *)OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * TILE_SIZE_4BPP, 0x800, 1);
+ RequestDma3Fill(0, (void *)OBJ_VRAM0 + gSprites[spriteId].oam.tileNum * TILE_SIZE_4BPP, MON_PIC_SIZE, 1);
ClearBehindSubstituteBit(gBattleAnimAttacker);
DestroyAnimVisualTask(taskId);
break;
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index d9e1cdc2f..ba0cab814 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -967,7 +967,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
src = gMonSpritesGfxPtr->sprites.ptr[position];
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
- DmaCopy32(3, src, dst, 0x800);
+ DmaCopy32(3, src, dst, MON_PIC_SIZE);
paletteOffset = 0x100 + battlerAtk * 16;
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
@@ -1014,7 +1014,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
for (i = 1; i < 4; i++)
{
- Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][0x800 * i], 0x800);
+ Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][MON_PIC_SIZE * i], MON_PIC_SIZE);
}
palOffset = (battlerId * 16) + 0x100;
@@ -1259,8 +1259,8 @@ void AllocateMonSpritesGfx(void)
for (j = 0; j < 4; j++)
{
- gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * 0x800);
- gMonSpritesGfxPtr->field_74[i][j].size = 0x800;
+ gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
+ gMonSpritesGfxPtr->field_74[i][j].size = MON_PIC_SIZE;
}
gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->field_74[i];
diff --git a/src/credits.c b/src/credits.c
index 84b802005..f6871aeec 100644
--- a/src/credits.c
+++ b/src/credits.c
@@ -23,111 +23,44 @@
#include "event_data.h"
#include "random.h"
-enum
-{
- PAGE_TITLE,
- PAGE_DIRECTOR,
- PAGE_ART_DIRECTOR,
- PAGE_WORLD_DIRECTOR,
- PAGE_LEAD_PROGRAMMER,
- PAGE_PROGRAMMERS_1,
- PAGE_PROGRAMMERS_2,
- PAGE_PROGRAMMERS_3,
- PAGE_PROGRAMMERS_4,
- PAGE_GRAPHIC_DESIGNERS_1,
- PAGE_GRAPHIC_DESIGNERS_2,
- PAGE_GRAPHIC_DESIGNERS_3,
- PAGE_MUSIC_COMPOSITION,
- PAGE_SOUND_EFFECTS,
- PAGE_GAME_DESIGNERS_1,
- PAGE_GAME_DESIGNERS_2,
- PAGE_GAME_DESIGNERS_3,
- PAGE_SCENARIO_PLOT,
- PAGE_SCENARIO,
- PAGE_SCRIPT_DESIGNERS,
- PAGE_MAP_DESIGNERS,
- PAGE_BATTLE_FRONTIER_DATA,
- PAGE_PARAMETRIC_DESIGNERS,
- PAGE_POKEDEX_TEXT,
- PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_1,
- PAGE_PKMN_DESIGNERS_1,
- PAGE_PKMN_DESIGNERS_2,
- PAGE_PKMN_DESIGNERS_3,
- PAGE_PKMN_DESIGNERS_4,
- PAGE_SUPPORT_PROGRAMMERS,
- PAGE_NCL_PRODUCT_TESTING,
- PAGE_PACKAGE_AND_MANUAL,
- PAGE_SPECIAL_THANKS_1,
- PAGE_SPECIAL_THANKS_2,
- PAGE_SPECIAL_THANKS_3,
- PAGE_SPECIAL_THANKS_4,
- PAGE_INFORMATION_SUPERVISORS,
- PAGE_ARTWORK_1,
- PAGE_ARTWORK_2,
- PAGE_ARTWORK_3,
- PAGE_COORDINATORS,
- PAGE_ENGLISH_VERSION,
- PAGE_TRANSLATOR,
- PAGE_TEXT_EDITOR,
- PAGE_NCL_COORDINATOR,
- PAGE_PROGRAMMERS_5,
- PAGE_GRAPHIC_DESIGNER,
- PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_2,
- PAGE_NOA_TESTING,
- PAGE_BRAILLE_CODE_CHECK_1,
- PAGE_BRAILLE_CODE_CHECK_2,
- PAGE_SPECIAL_THANKS_5,
- PAGE_TASK_MANAGERS,
- PAGE_PRODUCERS,
- PAGE_EXECUTIVE_DIRECTOR,
- PAGE_EXECUTIVE_PRODUCERS_1,
- PAGE_EXECUTIVE_PRODUCERS_2,
- PAGE_COUNT
-};
-
#define COLOR_DARK_GREEN RGB(7, 11, 6)
#define COLOR_LIGHT_GREEN RGB(13, 20, 12)
-enum
-{
- TDA_0 = 0,
- TDA_TASK_C_ID = 1,
- TDA_TASK_E_ID = 2,
- TDA_TASK_D_ID = 3,
- TDA_4 = 4,
- TDA_PLAYER_CYCLIST = 5,
- TDA_RIVAL_CYCLIST = 6,
- TDA_7 = 7, // Has something to do with the bike scene
- TDA_11 = 11, // Gets set depending on whether the bike or the grass scene should be shown
- TDA_12 = 12,
- TDA_13 = 13,
- TDA_14 = 14,
- TDA_TASK_B_ID = 15,
-
- // Appears to be responsible for text
- TDB_0 = 0,
- TDB_TASK_A_ID = 1,
- TDB_CURRENT_PAGE = 2,
- TDB_3 = 3,
-
- TDC_0 = 0,
- TDC_1 = 1,
- TDC_2 = 2,
- TDC_3 = 3,
- TDC_4 = 4,
- TDC_5 = 5,
-
- TDD_STATE = 0,
- TDD_TASK_A_ID = 1,
- TDD_2 = 2,
- TDD_3 = 3,
-
- TDE_0 = 0,
- TDE_1 = 1,
- TDE_TASK_A_ID = 2,
+#define TAG_MON_BG 1001
+
+// Positions for the Pokémon images
+enum {
+ POS_LEFT,
+ POS_CENTER,
+ POS_RIGHT,
};
+enum {
+ MODE_NONE,
+ MODE_BIKE_SCENE,
+ MODE_SHOW_MONS,
+};
+
+#define tState data[0]
+
+// Task data for the main Credits tasks
+#define tTaskId_BgScenery data[0] // ID for Task_BicycleBgAnimation (created by CreateBicycleBgAnimationTask)
+#define tTaskId_BikeScene data[1] // ID for Task_BikeScene
+#define tTaskId_SceneryPal data[2] // ID for Task_CycleSceneryPalette
+#define tTaskId_ShowMons data[3] // ID for Task_ShowMons
+#define tEndCredits data[4]
+#define tPlayerSpriteId data[5]
+#define tRivalSpriteId data[6]
+#define tSceneNum data[7]
+// data[8]-[10] are unused
+#define tNextMode data[11]
+#define tTheEndDelay data[12]
+#define tCurrentMode data[13]
+#define tPrintedPage data[14]
+#define tTaskId_UpdatePage data[15]
+
#define NUM_MON_SLIDES 71
+
struct CreditsData
{
u16 monToShow[NUM_MON_SLIDES]; // List of Pokemon species ids that will show during the credits
@@ -137,35 +70,55 @@ struct CreditsData
u16 numMonToShow; //number of pokemon to show, always NUM_MON_SLIDES after determine function
u16 caughtMonIds[NATIONAL_DEX_COUNT]; //temporary location to hold a condensed array of all caught pokemon
u16 numCaughtMon; //count of filled spaces in caughtMonIds
- u16 unk39C[7]; // unused padding?
+ u16 unused[7];
};
struct CreditsEntry
{
- u8 var_0;
+ u8 unk; // Never read
bool8 isTitle;
const u8 *text;
};
-static EWRAM_DATA s16 gUnknown_0203BCE0 = 0;
-static EWRAM_DATA u16 gUnknown_0203BCE2 = 0; // TASK A
+static EWRAM_DATA s16 sUnkVar = 0; // Never read, only set to 0
+static EWRAM_DATA u16 sSavedTaskId = 0;
EWRAM_DATA bool8 gHasHallOfFameRecords = 0;
-static EWRAM_DATA u8 gUnknown_0203BCE5 = 0;
+static EWRAM_DATA bool8 sUsedSpeedUp = 0; // Never read
static EWRAM_DATA struct CreditsData *sCreditsData = {0};
-static const u16 gUnknown_085E56F0[][16] =
-{
- INCBIN_U16("graphics/credits/credits_1.gbapal"),
- INCBIN_U16("graphics/credits/credits_2.gbapal"),
- INCBIN_U16("graphics/credits/credits_3.gbapal"),
- INCBIN_U16("graphics/credits/credits_4.gbapal"),
-};
-
-static const u32 gCreditsCopyrightEnd_Gfx[] = INCBIN_U32("graphics/credits/the_end_copyright.4bpp.lz");
-
-static void sub_81772B8(struct Sprite *sprite);
+static const u16 sCredits_Pal[] = INCBIN_U16("graphics/credits/credits.gbapal");
+static const u32 sCreditsCopyrightEnd_Gfx[] = INCBIN_U32("graphics/credits/the_end_copyright.4bpp.lz");
+
+static void SpriteCB_CreditsMonBg(struct Sprite *);
+static void Task_WaitPaletteFade(u8);
+static void Task_CreditsMain(u8);
+static void Task_ReadyBikeScene(u8);
+static void Task_SetBikeScene(u8);
+static void Task_LoadShowMons(u8);
+static void Task_ReadyShowMons(u8);
+static void Task_CreditsTheEnd1(u8);
+static void Task_CreditsTheEnd2(u8);
+static void Task_CreditsTheEnd3(u8);
+static void Task_CreditsTheEnd4(u8);
+static void Task_CreditsTheEnd5(u8);
+static void Task_CreditsTheEnd6(u8);
+static void Task_CreditsSoftReset(u8);
+static void ResetGpuAndVram(void);
+static void Task_UpdatePage(u8);
+static u8 CheckChangeScene(u8, u8);
+static void Task_ShowMons(u8);
+static void Task_CycleSceneryPalette(u8);
+static void Task_BikeScene(u8);
+static bool8 LoadBikeScene(u8 data, u8);
+static void ResetCreditsTasks(u8);
+static void LoadTheEndScreen(u16, u16, u16);
+static void DrawTheEnd(u16, u16);
+static void SpriteCB_Player(struct Sprite *);
+static void SpriteCB_Rival(struct Sprite *);
+static u8 CreateCreditsMonSprite(u16, s16, s16, u16);
+static void DeterminePokemonToShow(void);
-static const u8 sTheEnd_LetterTMap[] =
+static const u8 sTheEnd_LetterMap_T[] =
{
0, 1, 0,
0xFF, 1, 0xFF,
@@ -174,7 +127,7 @@ static const u8 sTheEnd_LetterTMap[] =
0xFF, 1, 0xFF,
};
-static const u8 sTheEnd_LetterHMap[] =
+static const u8 sTheEnd_LetterMap_H[] =
{
1, 0xFF, 1,
1, 0xFF, 1,
@@ -183,7 +136,7 @@ static const u8 sTheEnd_LetterHMap[] =
1, 0xFF, 1,
};
-static const u8 sTheEnd_LetterEMap[] =
+static const u8 sTheEnd_LetterMap_E[] =
{
1, 0, 0,
1, 0xFF, 0xFF,
@@ -192,7 +145,7 @@ static const u8 sTheEnd_LetterEMap[] =
1, 0x80, 0x80,
};
-static const u8 sTheEnd_LetterNMap[] =
+static const u8 sTheEnd_LetterMap_N[] =
{
1, 3, 1,
1, 4, 1,
@@ -201,7 +154,7 @@ static const u8 sTheEnd_LetterNMap[] =
1, 0xC3, 1,
};
-static const u8 sTheEnd_LetterDMap[] =
+static const u8 sTheEnd_LetterMap_D[] =
{
1, 6, 7,
1, 8, 9,
@@ -210,729 +163,7 @@ static const u8 sTheEnd_LetterDMap[] =
1, 0x86, 0x87,
};
-static const u8 gCreditsText_EmptyString[] = _("");
-static const u8 gCreditsText_PkmnEmeraldVersion[] = _("POKéMON EMERALD VERSION");
-static const u8 gCreditsText_Credits[] = _("Credits");
-static const u8 gCreditsText_ExecutiveDirector[] = _("Executive Director");
-static const u8 gCreditsText_Director[] = _("Director");
-static const u8 gCreditsText_ArtDirector[] = _("Art Director");
-static const u8 gCreditsText_BattleDirector[] = _("Battle Director");
-static const u8 gCreditsText_MainProgrammer[] = _("Main Programmer");
-static const u8 gCreditsText_BattleSystemPgrms[] = _("Battle System Programmers");
-static const u8 gCreditsText_FieldSystemPgrms[] = _("Field System Programmer");
-static const u8 gCreditsText_Programmers[] = _("Programmers");
-static const u8 gCreditsText_MainGraphicDesigner[] = _("Main Graphic Designer");
-static const u8 gCreditsText_GraphicDesigners[] = _("Graphic Designers");
-static const u8 gCreditsText_PkmnDesigners[] = _("POKéMON Designers");
-static const u8 gCreditsText_MusicComposition[] = _("Music Composition");
-static const u8 gCreditsText_SoundEffectsAndPkmnVoices[] = _("Sound Effects & POKéMON Voices");
-static const u8 gCreditsText_GameDesigners[] = _("Game Designers");
-static const u8 gCreditsText_ScenarioPlot[] = _("Scenario Plot");
-static const u8 gCreditsText_Scenario[] = _("Scenario");
-static const u8 gCreditsText_ScriptDesigners[] = _("Script Designers");
-static const u8 gCreditsText_MapDesigners[] = _("Map Designers");
-static const u8 gCreditsText_MapDataDesigners[] = _("Map Data Designers");
-static const u8 gCreditsText_ParametricDesigners[] = _("Parametric Designers");
-static const u8 gCreditsText_PokedexText[] = _("POKéDEX Text");
-static const u8 gCreditsText_EnvAndToolPgrms[] = _("Environment & Tool Programmers");
-static const u8 gCreditsText_NCLProductTesting[] = _("NCL Product Testing");
-static const u8 gCreditsText_SpecialThanks[] = _("Special Thanks");
-static const u8 gCreditsText_Coordinators[] = _("Coordinators");
-static const u8 gCreditsText_Producers[] = _("Producers");
-static const u8 gCreditsText_ExecProducers[] = _("Executive Producers");
-static const u8 gCreditsText_InfoSupervisors[] = _("Information Supervisors");
-static const u8 gCreditsText_TaskManagers[] = _("Task Managers");
-static const u8 gCreditsText_BrailleCodeCheck[] = _("Braille Code Check");
-static const u8 gCreditsText_WorldDirector[] = _("World Director");
-static const u8 gCreditsText_BattleFrontierData[] = _("Battle Frontier Data");
-static const u8 gCreditsText_SupportProgrammers[] = _("Support Programmers");
-static const u8 gCreditsText_Artwork[] = _("Artwork");
-static const u8 gCreditsText_LeadProgrammer[] = _("Lead Programmer");
-static const u8 gCreditsText_LeadGraphicArtist[] = _("Lead Graphic Artist");
-static const u8 gCreditsText_SatoshiTajiri[] = _("Satoshi Tajiri");
-static const u8 gCreditsText_JunichiMasuda[] = _("Junichi Masuda");
-static const u8 gCreditsText_KenSugimori[] = _("Ken Sugimori");
-static const u8 gCreditsText_ShigekiMorimoto[] = _("Shigeki Morimoto");
-static const u8 gCreditsText_TetsuyaWatanabe[] = _("Tetsuya Watanabe");
-static const u8 gCreditsText_HisashiSogabe[] = _("Hisashi Sogabe");
-static const u8 gCreditsText_SosukeTamada[] = _("Sosuke Tamada");
-static const u8 gCreditsText_AkitoMori[] = _("Akito Mori");
-static const u8 gCreditsText_KeitaKagaya[] = _("Keita Kagaya");
-static const u8 gCreditsText_YoshinoriMatsuda[] = _("Yoshinori Matsuda");
-static const u8 gCreditsText_HiroyukiNakamura[] = _("Hiroyuki Nakamura");
-static const u8 gCreditsText_MasaoTaya[] = _("Masao Taya");
-static const u8 gCreditsText_SatoshiNohara[] = _("Satoshi Nohara");
-static const u8 gCreditsText_TomomichiOhta[] = _("Tomomichi Ohta");
-static const u8 gCreditsText_MiyukiIwasawa[] = _("Miyuki Iwasawa");
-static const u8 gCreditsText_TakenoriOhta[] = _("Takenori Ohta");
-static const u8 gCreditsText_HironobuYoshida[] = _("Hironobu Yoshida");
-static const u8 gCreditsText_MotofumiFujiwara[] = _("Motofumi Fujiwara");
-static const u8 gCreditsText_SatoshiOhta[] = _("Satoshi Ohta");
-static const u8 gCreditsText_AsukaIwashita[] = _("Asuka Iwashita");
-static const u8 gCreditsText_AimiTomita[] = _("Aimi Tomita");
-static const u8 gCreditsText_TakaoUnno[] = _("Takao Unno");
-static const u8 gCreditsText_KanakoEo[] = _("Kanako Eo");
-static const u8 gCreditsText_JunOkutani[] = _("Jun Okutani");
-static const u8 gCreditsText_AtsukoNishida[] = _("Atsuko Nishida");
-static const u8 gCreditsText_MuneoSaito[] = _("Muneo Saito");
-static const u8 gCreditsText_RenaYoshikawa[] = _("Rena Yoshikawa");
-static const u8 gCreditsText_GoIchinose[] = _("Go Ichinose");
-static const u8 gCreditsText_MorikazuAoki[] = _("Morikazu Aoki");
-static const u8 gCreditsText_KojiNishino[] = _("Koji Nishino");
-static const u8 gCreditsText_KenjiMatsushima[] = _("Kenji Matsushima");
-static const u8 gCreditsText_TetsujiOhta[] = _("Tetsuji Ohta");
-static const u8 gCreditsText_HitomiSato[] = _("Hitomi Sato");
-static const u8 gCreditsText_TakeshiKawachimaru[] = _("Takeshi Kawachimaru");
-static const u8 gCreditsText_TeruyukiShimoyamada[] = _("Teruyuki Shimoyamada");
-static const u8 gCreditsText_ShigeruOhmori[] = _("Shigeru Ohmori");
-static const u8 gCreditsText_TadashiTakahashi[] = _("Tadashi Takahashi");
-static const u8 gCreditsText_ToshinobuMatsumiya[] = _("Toshinobu Matsumiya");
-static const u8 gCreditsText_AkihitoTomisawa[] = _("Akihito Tomisawa");
-static const u8 gCreditsText_HirokiEnomoto[] = _("Hiroki Enomoto");
-static const u8 gCreditsText_KazuyukiTerada[] = _("Kazuyuki Terada");
-static const u8 gCreditsText_YuriSakurai[] = _("Yuri Sakurai");
-static const u8 gCreditsText_HiromiSagawa[] = _("Hiromi Sagawa");
-static const u8 gCreditsText_KenjiTominaga[] = _("Kenji Tominaga");
-static const u8 gCreditsText_YoshioTajiri[] = _("Yoshio Tajiri");
-static const u8 gCreditsText_TeikoSasaki[] = _("Teiko Sasaki");
-static const u8 gCreditsText_SachikoHamano[] = _("Sachiko Hamano");
-static const u8 gCreditsText_ChieMatsumiya[] = _("Chie Matsumiya");
-static const u8 gCreditsText_AkikoShinozaki[] = _("Akiko Shinozaki");
-static const u8 gCreditsText_AstukoFujii[] = _("Astuko Fujii");
-static const u8 gCreditsText_NozomuSaito[] = _("Nozomu Saito");
-static const u8 gCreditsText_KenkichiToyama[] = _("Kenkichi Toyama");
-static const u8 gCreditsText_SuguruNakatsui[] = _("Suguru Nakatsui");
-static const u8 gCreditsText_YumiFunasaka[] = _("Yumi Funasaka");
-static const u8 gCreditsText_NaokoYanase[] = _("Naoko Yanase");
-static const u8 gCreditsText_NCLSuperMarioClub[] = _("NCL Super Mario Club");
-static const u8 gCreditsText_AtsushiTada[] = _("Atsushi Tada");
-static const u8 gCreditsText_TakahiroOhnishi[] = _("Takahiro Ohnishi");
-static const u8 gCreditsText_NorihideOkamura[] = _("Norihide Okamura");
-static const u8 gCreditsText_HiroNakamura[] = _("Hiro Nakamura");
-static const u8 gCreditsText_HiroyukiUesugi[] = _("Hiroyuki Uesugi");
-static const u8 gCreditsText_TerukiMurakawa[] = _("Teruki Murakawa");
-static const u8 gCreditsText_AkiraKinashi[] = _("Akira Kinashi");
-static const u8 gCreditsText_MichikoTakizawa[] = _("Michiko Takizawa");
-static const u8 gCreditsText_MakikoTakada[] = _("Makiko Takada");
-static const u8 gCreditsText_TakanaoKondo[] = _("Takanao Kondo");
-static const u8 gCreditsText_AiMashima[] = _("Ai Mashima");
-static const u8 gCreditsText_GakujiNomoto[] = _("Gakuji Nomoto");
-static const u8 gCreditsText_TakehiroIzushi[] = _("Takehiro Izushi");
-static const u8 gCreditsText_HitoshiYamagami[] = _("Hitoshi Yamagami");
-static const u8 gCreditsText_KyokoWatanabe[] = _("Kyoko Watanabe");
-static const u8 gCreditsText_TakaoNakano[] = _("Takao Nakano");
-static const u8 gCreditsText_HiroyukiJinnai[] = _("Hiroyuki Jinnai");
-static const u8 gCreditsText_HiroakiTsuru[] = _("Hiroaki Tsuru");
-static const u8 gCreditsText_TsunekazIshihara[] = _("Tsunekaz Ishihara");
-static const u8 gCreditsText_SatoruIwata[] = _("Satoru Iwata");
-static const u8 gCreditsText_KazuyaSuyama[] = _("Kazuya Suyama");
-static const u8 gCreditsText_SatoshiMitsuhara[] = _("Satoshi Mitsuhara");
-static const u8 gCreditsText_JapanBrailleLibrary[] = _("Japan Braille Library");
-static const u8 gCreditsText_TomotakaKomura[] = _("Tomotaka Komura");
-static const u8 gCreditsText_MikikoOhhashi[] = _("Mikiko Ohhashi");
-static const u8 gCreditsText_DaisukeHoshino[] = _("Daisuke Hoshino");
-static const u8 gCreditsText_KenjiroIto[] = _("Kenjiro Ito");
-static const u8 gCreditsText_RuiKawaguchi[] = _("Rui Kawaguchi");
-static const u8 gCreditsText_ShunsukeKohori[] = _("Shunsuke Kohori");
-static const u8 gCreditsText_SachikoNakamichi[] = _("Sachiko Nakamichi");
-static const u8 gCreditsText_FujikoNomura[] = _("Fujiko Nomura");
-static const u8 gCreditsText_KazukiYoshihara[] = _("Kazuki Yoshihara");
-static const u8 gCreditsText_RetsujiNomoto[] = _("Retsuji Nomoto");
-static const u8 gCreditsText_AzusaTajima[] = _("Azusa Tajima");
-static const u8 gCreditsText_ShusakuEgami[] = _("Shusaku Egami");
-static const u8 gCreditsText_PackageAndManual[] = _("Package & Manual Illustration");
-static const u8 gCreditsText_EnglishVersion[] = _("English Version Coordinators");
-static const u8 gCreditsText_Translator[] = _("Translator");
-static const u8 gCreditsText_TextEditor[] = _("Text Editor");
-static const u8 gCreditsText_NCLCoordinator[] = _("NCL Coordinator");
-static const u8 gCreditsText_GraphicDesigner[] = _("Graphic Designer");
-static const u8 gCreditsText_NOAProductTesting[] = _("NOA Product Testing");
-static const u8 gCreditsText_HideyukiNakajima[] = _("Hideyuki Nakajima");
-static const u8 gCreditsText_HidenoriSaeki[] = _("Hidenori Saeki");
-static const u8 gCreditsText_YokoWatanabe[] = _("Yoko Watanabe");
-static const u8 gCreditsText_SakaeKimura[] = _("Sakae Kimura");
-static const u8 gCreditsText_ChiakiShinkai[] = _("Chiaki Shinkai");
-static const u8 gCreditsText_SethMcMahill[] = _("Seth McMahill");
-static const u8 gCreditsText_NobOgasawara[] = _("Nob Ogasawara");
-static const u8 gCreditsText_TeresaLillygren[] = _("Teresa Lillygren");
-static const u8 gCreditsText_KimikoNakamichi[] = _("Kimiko Nakamichi");
-static const u8 gCreditsText_SouichiYamamoto[] = _("Souichi Yamamoto");
-static const u8 gCreditsText_YuichiroIto[] = _("Yuichiro Ito");
-static const u8 gCreditsText_ThomasHertzog[] = _("Thomas Hertzog");
-static const u8 gCreditsText_MikaKurosawa[] = _("Mika Kurosawa");
-static const u8 gCreditsText_NationalFederationBlind[] = _("National Federation of the Blind");
-static const u8 gCreditsText_PatriciaAMaurer[] = _("Patricia A. Maurer");
-static const u8 gCreditsText_EuropeanBlindUnion[] = _("European Blind Union");
-static const u8 gCreditsText_AustralianBrailleAuthority[] = _("Australian Braille Authority");
-static const u8 gCreditsText_RoyalNewZealandFederationBlind[] = _("Royal New Zealand Federation for the Blind");
-static const u8 gCreditsText_MotoyasuTojima[] = _("Motoyasu Tojima");
-static const u8 gCreditsText_NicolaPrattBarlow[] = _("Nicola Pratt-Barlow");
-static const u8 gCreditsText_ShellieDow[] = _("Shellie Dow");
-static const u8 gCreditsText_ErikJohnson[] = _("Erik Johnson");
-static const struct CreditsEntry gCreditsEntry_EmptyString[] = {0, FALSE, gCreditsText_EmptyString};
-static const struct CreditsEntry gCreditsEntry_PkmnEmeraldVersion[] = {7, TRUE, gCreditsText_PkmnEmeraldVersion};
-static const struct CreditsEntry gCreditsEntry_Credits[] = {11, TRUE, gCreditsText_Credits};
-static const struct CreditsEntry gCreditsEntry_ExecutiveDirector[] = {8, TRUE, gCreditsText_ExecutiveDirector};
-static const struct CreditsEntry gCreditsEntry_Director[] = {12, TRUE, gCreditsText_Director};
-static const struct CreditsEntry gCreditsEntry_ArtDirector[] = {10, TRUE, gCreditsText_ArtDirector};
-static const struct CreditsEntry gCreditsEntry_BattleDirector[] = {10, TRUE, gCreditsText_BattleDirector};
-static const struct CreditsEntry gCreditsEntry_MainProgrammer[] = {10, TRUE, gCreditsText_MainProgrammer};
-static const struct CreditsEntry gCreditsEntry_BattleSystemPgrms[] = {8, TRUE, gCreditsText_BattleSystemPgrms};
-static const struct CreditsEntry gCreditsEntry_FieldSystemPgrms[] = {7, TRUE, gCreditsText_FieldSystemPgrms};
-static const struct CreditsEntry gCreditsEntry_Programmers[] = {12, TRUE, gCreditsText_Programmers};
-static const struct CreditsEntry gCreditsEntry_MainGraphicDesigner[] = {7, TRUE, gCreditsText_MainGraphicDesigner};
-static const struct CreditsEntry gCreditsEntry_GraphicDesigners[] = {9, TRUE, gCreditsText_GraphicDesigners};
-static const struct CreditsEntry gCreditsEntry_PkmnDesigners[] = {10, TRUE, gCreditsText_PkmnDesigners};
-static const struct CreditsEntry gCreditsEntry_MusicComposition[] = {13, TRUE, gCreditsText_MusicComposition};
-static const struct CreditsEntry gCreditsEntry_SoundEffectsAndPkmnVoices[] = {4, TRUE, gCreditsText_SoundEffectsAndPkmnVoices};
-static const struct CreditsEntry gCreditsEntry_GameDesigners[] = {11, TRUE, gCreditsText_GameDesigners};
-static const struct CreditsEntry gCreditsEntry_ScenarioPlot[] = {11, TRUE, gCreditsText_ScenarioPlot};
-static const struct CreditsEntry gCreditsEntry_Scenario[] = {13, TRUE, gCreditsText_Scenario};
-static const struct CreditsEntry gCreditsEntry_ScriptDesigners[] = {10, TRUE, gCreditsText_ScriptDesigners};
-static const struct CreditsEntry gCreditsEntry_MapDesigners[] = {11, TRUE, gCreditsText_MapDesigners};
-static const struct CreditsEntry gCreditsEntry_MapDataDesigners[] = {9, TRUE, gCreditsText_MapDataDesigners};
-static const struct CreditsEntry gCreditsEntry_ParametricDesigners[] = {9, TRUE, gCreditsText_ParametricDesigners};
-static const struct CreditsEntry gCreditsEntry_PokedexText[] = {11, TRUE, gCreditsText_PokedexText};
-static const struct CreditsEntry gCreditsEntry_EnvAndToolPgrms[] = {6, TRUE, gCreditsText_EnvAndToolPgrms};
-static const struct CreditsEntry gCreditsEntry_NCLProductTesting[] = {11, TRUE, gCreditsText_NCLProductTesting};
-static const struct CreditsEntry gCreditsEntry_SpecialThanks[] = {10, TRUE, gCreditsText_SpecialThanks};
-static const struct CreditsEntry gCreditsEntry_Coordinators[] = {11, TRUE, gCreditsText_Coordinators};
-static const struct CreditsEntry gCreditsEntry_Producers[] = {11, TRUE, gCreditsText_Producers};
-static const struct CreditsEntry gCreditsEntry_ExecProducers[] = {7, TRUE, gCreditsText_ExecProducers};
-static const struct CreditsEntry gCreditsEntry_InfoSupervisors[] = {10, TRUE, gCreditsText_InfoSupervisors};
-static const struct CreditsEntry gCreditsEntry_TaskManagers[] = {8, TRUE, gCreditsText_TaskManagers};
-static const struct CreditsEntry gCreditsEntry_BrailleCodeCheck[] = {10, TRUE, gCreditsText_BrailleCodeCheck};
-static const struct CreditsEntry gCreditsEntry_WorldDirector[] = {10, TRUE, gCreditsText_WorldDirector};
-static const struct CreditsEntry gCreditsEntry_BattleFrontierData[] = {8, TRUE, gCreditsText_BattleFrontierData};
-static const struct CreditsEntry gCreditsEntry_SupportProgrammers[] = {10, TRUE, gCreditsText_SupportProgrammers};
-static const struct CreditsEntry gCreditsEntry_Artwork[] = {12, TRUE, gCreditsText_Artwork};
-static const struct CreditsEntry gCreditsEntry_LeadProgrammer[] = {10, TRUE, gCreditsText_LeadProgrammer};
-static const struct CreditsEntry gCreditsEntry_LeadGraphicArtist[] = {9, TRUE, gCreditsText_LeadGraphicArtist};
-static const struct CreditsEntry gCreditsEntry_SatoshiTajiri[] = {11, FALSE, gCreditsText_SatoshiTajiri};
-static const struct CreditsEntry gCreditsEntry_JunichiMasuda[] = {11, FALSE, gCreditsText_JunichiMasuda};
-static const struct CreditsEntry gCreditsEntry_KenSugimori[] = {11, FALSE, gCreditsText_KenSugimori};
-static const struct CreditsEntry gCreditsEntry_ShigekiMorimoto[] = {11, FALSE, gCreditsText_ShigekiMorimoto};
-static const struct CreditsEntry gCreditsEntry_TetsuyaWatanabe[] = {11, FALSE, gCreditsText_TetsuyaWatanabe};
-static const struct CreditsEntry gCreditsEntry_HisashiSogabe[] = {11, FALSE, gCreditsText_HisashiSogabe};
-static const struct CreditsEntry gCreditsEntry_SosukeTamada[] = {11, FALSE, gCreditsText_SosukeTamada};
-static const struct CreditsEntry gCreditsEntry_AkitoMori[] = {11, FALSE, gCreditsText_AkitoMori};
-static const struct CreditsEntry gCreditsEntry_KeitaKagaya[] = {11, FALSE, gCreditsText_KeitaKagaya};
-static const struct CreditsEntry gCreditsEntry_YoshinoriMatsuda[] = {11, FALSE, gCreditsText_YoshinoriMatsuda};
-static const struct CreditsEntry gCreditsEntry_HiroyukiNakamura[] = {11, FALSE, gCreditsText_HiroyukiNakamura};
-static const struct CreditsEntry gCreditsEntry_MasaoTaya[] = {11, FALSE, gCreditsText_MasaoTaya};
-static const struct CreditsEntry gCreditsEntry_SatoshiNohara[] = {11, FALSE, gCreditsText_SatoshiNohara};
-static const struct CreditsEntry gCreditsEntry_TomomichiOhta[] = {11, FALSE, gCreditsText_TomomichiOhta};
-static const struct CreditsEntry gCreditsEntry_MiyukiIwasawa[] = {11, FALSE, gCreditsText_MiyukiIwasawa};
-static const struct CreditsEntry gCreditsEntry_TakenoriOhta[] = {11, FALSE, gCreditsText_TakenoriOhta};
-static const struct CreditsEntry gCreditsEntry_HironobuYoshida[] = {11, FALSE, gCreditsText_HironobuYoshida};
-static const struct CreditsEntry gCreditsEntry_MotofumiFujiwara[] = {11, FALSE, gCreditsText_MotofumiFujiwara};
-static const struct CreditsEntry gCreditsEntry_SatoshiOhta[] = {11, FALSE, gCreditsText_SatoshiOhta};
-static const struct CreditsEntry gCreditsEntry_AsukaIwashita[] = {11, FALSE, gCreditsText_AsukaIwashita};
-static const struct CreditsEntry gCreditsEntry_AimiTomita[] = {11, FALSE, gCreditsText_AimiTomita};
-static const struct CreditsEntry gCreditsEntry_TakaoUnno[] = {11, FALSE, gCreditsText_TakaoUnno};
-static const struct CreditsEntry gCreditsEntry_KanakoEo[] = {11, FALSE, gCreditsText_KanakoEo};
-static const struct CreditsEntry gCreditsEntry_JunOkutani[] = {11, FALSE, gCreditsText_JunOkutani};
-static const struct CreditsEntry gCreditsEntry_AtsukoNishida[] = {11, FALSE, gCreditsText_AtsukoNishida};
-static const struct CreditsEntry gCreditsEntry_MuneoSaito[] = {11, FALSE, gCreditsText_MuneoSaito};
-static const struct CreditsEntry gCreditsEntry_RenaYoshikawa[] = {11, FALSE, gCreditsText_RenaYoshikawa};
-static const struct CreditsEntry gCreditsEntry_GoIchinose[] = {11, FALSE, gCreditsText_GoIchinose};
-static const struct CreditsEntry gCreditsEntry_MorikazuAoki[] = {11, FALSE, gCreditsText_MorikazuAoki};
-static const struct CreditsEntry gCreditsEntry_KojiNishino[] = {11, FALSE, gCreditsText_KojiNishino};
-static const struct CreditsEntry gCreditsEntry_KenjiMatsushima[] = {11, FALSE, gCreditsText_KenjiMatsushima};
-static const struct CreditsEntry gCreditsEntry_TetsujiOhta[] = {11, FALSE, gCreditsText_TetsujiOhta};
-static const struct CreditsEntry gCreditsEntry_HitomiSato[] = {11, FALSE, gCreditsText_HitomiSato};
-static const struct CreditsEntry gCreditsEntry_TakeshiKawachimaru[] = {11, FALSE, gCreditsText_TakeshiKawachimaru};
-static const struct CreditsEntry gCreditsEntry_TeruyukiShimoyamada[] = {11, FALSE, gCreditsText_TeruyukiShimoyamada};
-static const struct CreditsEntry gCreditsEntry_ShigeruOhmori[] = {11, FALSE, gCreditsText_ShigeruOhmori};
-static const struct CreditsEntry gCreditsEntry_TadashiTakahashi[] = {11, FALSE, gCreditsText_TadashiTakahashi};
-static const struct CreditsEntry gCreditsEntry_ToshinobuMatsumiya[] = {11, FALSE, gCreditsText_ToshinobuMatsumiya};
-static const struct CreditsEntry gCreditsEntry_AkihitoTomisawa[] = {11, FALSE, gCreditsText_AkihitoTomisawa};
-static const struct CreditsEntry gCreditsEntry_HirokiEnomoto[] = {11, FALSE, gCreditsText_HirokiEnomoto};
-static const struct CreditsEntry gCreditsEntry_KazuyukiTerada[] = {11, FALSE, gCreditsText_KazuyukiTerada};
-static const struct CreditsEntry gCreditsEntry_YuriSakurai[] = {11, FALSE, gCreditsText_YuriSakurai};
-static const struct CreditsEntry gCreditsEntry_HiromiSagawa[] = {11, FALSE, gCreditsText_HiromiSagawa};
-static const struct CreditsEntry gCreditsEntry_KenjiTominaga[] = {11, FALSE, gCreditsText_KenjiTominaga};
-static const struct CreditsEntry gCreditsEntry_YoshioTajiri[] = {11, FALSE, gCreditsText_YoshioTajiri};
-static const struct CreditsEntry gCreditsEntry_TeikoSasaki[] = {11, FALSE, gCreditsText_TeikoSasaki};
-static const struct CreditsEntry gCreditsEntry_SachikoHamano[] = {11, FALSE, gCreditsText_SachikoHamano};
-static const struct CreditsEntry gCreditsEntry_ChieMatsumiya[] = {11, FALSE, gCreditsText_ChieMatsumiya};
-static const struct CreditsEntry gCreditsEntry_AkikoShinozaki[] = {11, FALSE, gCreditsText_AkikoShinozaki};
-static const struct CreditsEntry gCreditsEntry_AstukoFujii[] = {11, FALSE, gCreditsText_AstukoFujii};
-static const struct CreditsEntry gCreditsEntry_NozomuSaito[] = {11, FALSE, gCreditsText_NozomuSaito};
-static const struct CreditsEntry gCreditsEntry_KenkichiToyama[] = {11, FALSE, gCreditsText_KenkichiToyama};
-static const struct CreditsEntry gCreditsEntry_SuguruNakatsui[] = {11, FALSE, gCreditsText_SuguruNakatsui};
-static const struct CreditsEntry gCreditsEntry_YumiFunasaka[] = {11, FALSE, gCreditsText_YumiFunasaka};
-static const struct CreditsEntry gCreditsEntry_NaokoYanase[] = {11, FALSE, gCreditsText_NaokoYanase};
-static const struct CreditsEntry gCreditsEntry_NCLSuperMarioClub[] = {11, FALSE, gCreditsText_NCLSuperMarioClub};
-static const struct CreditsEntry gCreditsEntry_AtsushiTada[] = {11, FALSE, gCreditsText_AtsushiTada};
-static const struct CreditsEntry gCreditsEntry_TakahiroOhnishi[] = {11, FALSE, gCreditsText_TakahiroOhnishi};
-static const struct CreditsEntry gCreditsEntry_NorihideOkamura[] = {11, FALSE, gCreditsText_NorihideOkamura};
-static const struct CreditsEntry gCreditsEntry_HiroNakamura[] = {11, FALSE, gCreditsText_HiroNakamura};
-static const struct CreditsEntry gCreditsEntry_HiroyukiUesugi[] = {11, FALSE, gCreditsText_HiroyukiUesugi};
-static const struct CreditsEntry gCreditsEntry_TerukiMurakawa[] = {11, FALSE, gCreditsText_TerukiMurakawa};
-static const struct CreditsEntry gCreditsEntry_AkiraKinashi[] = {11, FALSE, gCreditsText_AkiraKinashi};
-static const struct CreditsEntry gCreditsEntry_MichikoTakizawa[] = {11, FALSE, gCreditsText_MichikoTakizawa};
-static const struct CreditsEntry gCreditsEntry_MakikoTakada[] = {11, FALSE, gCreditsText_MakikoTakada};
-static const struct CreditsEntry gCreditsEntry_TakanaoKondo[] = {11, FALSE, gCreditsText_TakanaoKondo};
-static const struct CreditsEntry gCreditsEntry_AiMashima[] = {11, FALSE, gCreditsText_AiMashima};
-static const struct CreditsEntry gCreditsEntry_GakujiNomoto[] = {11, FALSE, gCreditsText_GakujiNomoto};
-static const struct CreditsEntry gCreditsEntry_TakehiroIzushi[] = {11, FALSE, gCreditsText_TakehiroIzushi};
-static const struct CreditsEntry gCreditsEntry_HitoshiYamagami[] = {11, FALSE, gCreditsText_HitoshiYamagami};
-static const struct CreditsEntry gCreditsEntry_KyokoWatanabe[] = {11, FALSE, gCreditsText_KyokoWatanabe};
-static const struct CreditsEntry gCreditsEntry_TakaoNakano[] = {11, FALSE, gCreditsText_TakaoNakano};
-static const struct CreditsEntry gCreditsEntry_HiroyukiJinnai[] = {11, FALSE, gCreditsText_HiroyukiJinnai};
-static const struct CreditsEntry gCreditsEntry_HiroakiTsuru[] = {11, FALSE, gCreditsText_HiroakiTsuru};
-static const struct CreditsEntry gCreditsEntry_TsunekazIshihara[] = {11, FALSE, gCreditsText_TsunekazIshihara};
-static const struct CreditsEntry gCreditsEntry_SatoruIwata[] = {11, FALSE, gCreditsText_SatoruIwata};
-static const struct CreditsEntry gCreditsEntry_KazuyaSuyama[] = {11, FALSE, gCreditsText_KazuyaSuyama};
-static const struct CreditsEntry gCreditsEntry_SatoshiMitsuhara[] = {11, FALSE, gCreditsText_SatoshiMitsuhara};
-static const struct CreditsEntry gCreditsEntry_JapanBrailleLibrary[] = {9, FALSE, gCreditsText_JapanBrailleLibrary};
-static const struct CreditsEntry gCreditsEntry_TomotakaKomura[] = {11, FALSE, gCreditsText_TomotakaKomura};
-static const struct CreditsEntry gCreditsEntry_MikikoOhhashi[] = {11, FALSE, gCreditsText_MikikoOhhashi};
-static const struct CreditsEntry gCreditsEntry_DaisukeHoshino[] = {11, FALSE, gCreditsText_DaisukeHoshino};
-static const struct CreditsEntry gCreditsEntry_KenjiroIto[] = {11, FALSE, gCreditsText_KenjiroIto};
-static const struct CreditsEntry gCreditsEntry_RuiKawaguchi[] = {11, FALSE, gCreditsText_RuiKawaguchi};
-static const struct CreditsEntry gCreditsEntry_ShunsukeKohori[] = {11, FALSE, gCreditsText_ShunsukeKohori};
-static const struct CreditsEntry gCreditsEntry_SachikoNakamichi[] = {11, FALSE, gCreditsText_SachikoNakamichi};
-static const struct CreditsEntry gCreditsEntry_FujikoNomura[] = {11, FALSE, gCreditsText_FujikoNomura};
-static const struct CreditsEntry gCreditsEntry_KazukiYoshihara[] = {11, FALSE, gCreditsText_KazukiYoshihara};
-static const struct CreditsEntry gCreditsEntry_RetsujiNomoto[] = {11, FALSE, gCreditsText_RetsujiNomoto};
-static const struct CreditsEntry gCreditsEntry_AzusaTajima[] = {11, FALSE, gCreditsText_AzusaTajima};
-static const struct CreditsEntry gCreditsEntry_ShusakuEgami[] = {11, FALSE, gCreditsText_ShusakuEgami};
-static const struct CreditsEntry gCreditsEntry_PackageAndManual[] = {0, TRUE, gCreditsText_PackageAndManual};
-static const struct CreditsEntry gCreditsEntry_EnglishVersion[] = {0, TRUE, gCreditsText_EnglishVersion};
-static const struct CreditsEntry gCreditsEntry_Translator[] = {0, TRUE, gCreditsText_Translator};
-static const struct CreditsEntry gCreditsEntry_TextEditor[] = {0, TRUE, gCreditsText_TextEditor};
-static const struct CreditsEntry gCreditsEntry_NCLCoordinator[] = {0, TRUE, gCreditsText_NCLCoordinator};
-static const struct CreditsEntry gCreditsEntry_GraphicDesigner[] = {0, TRUE, gCreditsText_GraphicDesigner};
-static const struct CreditsEntry gCreditsEntry_NOAProductTesting[] = {0, TRUE, gCreditsText_NOAProductTesting};
-static const struct CreditsEntry gCreditsEntry_HideyukiNakajima[] = {0, FALSE, gCreditsText_HideyukiNakajima};
-static const struct CreditsEntry gCreditsEntry_HidenoriSaeki[] = {0, FALSE, gCreditsText_HidenoriSaeki};
-static const struct CreditsEntry gCreditsEntry_YokoWatanabe[] = {0, FALSE, gCreditsText_YokoWatanabe};
-static const struct CreditsEntry gCreditsEntry_SakaeKimura[] = {0, FALSE, gCreditsText_SakaeKimura};
-static const struct CreditsEntry gCreditsEntry_ChiakiShinkai[] = {0, FALSE, gCreditsText_ChiakiShinkai};
-static const struct CreditsEntry gCreditsEntry_SethMcMahill[] = {0, FALSE, gCreditsText_SethMcMahill};
-static const struct CreditsEntry gCreditsEntry_NobOgasawara[] = {0, FALSE, gCreditsText_NobOgasawara};
-static const struct CreditsEntry gCreditsEntry_TeresaLillygren[] = {0, FALSE, gCreditsText_TeresaLillygren};
-static const struct CreditsEntry gCreditsEntry_KimikoNakamichi[] = {0, FALSE, gCreditsText_KimikoNakamichi};
-static const struct CreditsEntry gCreditsEntry_SouichiYamamoto[] = {0, FALSE, gCreditsText_SouichiYamamoto};
-static const struct CreditsEntry gCreditsEntry_YuichiroIto[] = {0, FALSE, gCreditsText_YuichiroIto};
-static const struct CreditsEntry gCreditsEntry_ThomasHertzog[] = {0, FALSE, gCreditsText_ThomasHertzog};
-static const struct CreditsEntry gCreditsEntry_MikaKurosawa[] = {0, FALSE, gCreditsText_MikaKurosawa};
-static const struct CreditsEntry gCreditsEntry_NationalFederationBlind[] = {0, FALSE, gCreditsText_NationalFederationBlind};
-static const struct CreditsEntry gCreditsEntry_PatriciaAMaurer[] = {0, FALSE, gCreditsText_PatriciaAMaurer};
-static const struct CreditsEntry gCreditsEntry_EuropeanBlindUnion[] = {0, FALSE, gCreditsText_EuropeanBlindUnion};
-static const struct CreditsEntry gCreditsEntry_AustralianBrailleAuthority[] = {0, FALSE, gCreditsText_AustralianBrailleAuthority};
-static const struct CreditsEntry gCreditsEntry_RoyalNewZealandFederationBlind[] = {0, FALSE, gCreditsText_RoyalNewZealandFederationBlind};
-static const struct CreditsEntry gCreditsEntry_MotoyasuTojima[] = {0, FALSE, gCreditsText_MotoyasuTojima};
-static const struct CreditsEntry gCreditsEntry_NicolaPrattBarlow[] = {0, FALSE, gCreditsText_NicolaPrattBarlow};
-static const struct CreditsEntry gCreditsEntry_ShellieDow[] = {0, FALSE, gCreditsText_ShellieDow};
-static const struct CreditsEntry gCreditsEntry_ErikJohnson[] = {0, FALSE, gCreditsText_ErikJohnson};
-
-#define _ gCreditsEntry_EmptyString
-static const struct CreditsEntry *const gCreditsEntryPointerTable[][5] =
-{
- {
- _,
- gCreditsEntry_PkmnEmeraldVersion,
- gCreditsEntry_Credits,
- _,
- _
- },
- {
- _,
- gCreditsEntry_Director,
- gCreditsEntry_ShigekiMorimoto,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_ArtDirector,
- gCreditsEntry_KenSugimori,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_WorldDirector,
- gCreditsEntry_JunichiMasuda,
- _,
- _,
- },
- {
- gCreditsEntry_LeadProgrammer,
- gCreditsEntry_HisashiSogabe,
- gCreditsEntry_LeadGraphicArtist,
- gCreditsEntry_MotofumiFujiwara,
- _,
- },
- {
- gCreditsEntry_Programmers,
- gCreditsEntry_HisashiSogabe,
- gCreditsEntry_TomomichiOhta,
- gCreditsEntry_NozomuSaito,
- gCreditsEntry_EmptyString,
- },
- {
- gCreditsEntry_Programmers,
- gCreditsEntry_AkitoMori,
- gCreditsEntry_HiroyukiNakamura,
- gCreditsEntry_MasaoTaya,
- _,
- },
- {
- gCreditsEntry_Programmers,
- gCreditsEntry_SatoshiNohara,
- gCreditsEntry_MiyukiIwasawa,
- gCreditsEntry_YoshinoriMatsuda,
- gCreditsEntry_KeitaKagaya,
- },
- {
- gCreditsEntry_Programmers,
- gCreditsEntry_TetsuyaWatanabe,
- gCreditsEntry_SosukeTamada,
- gCreditsEntry_TakenoriOhta,
- _,
- },
- {
- _,
- gCreditsEntry_GraphicDesigners,
- gCreditsEntry_MotofumiFujiwara,
- gCreditsEntry_SatoshiOhta,
- _,
- },
- {
- gCreditsEntry_GraphicDesigners,
- gCreditsEntry_KenkichiToyama,
- gCreditsEntry_AsukaIwashita,
- gCreditsEntry_TakaoUnno,
- _,
- },
- {
- gCreditsEntry_GraphicDesigners,
- gCreditsEntry_KenSugimori,
- gCreditsEntry_HironobuYoshida,
- gCreditsEntry_AimiTomita,
- gCreditsEntry_KanakoEo,
- },
- {
- gCreditsEntry_MusicComposition,
- gCreditsEntry_GoIchinose,
- gCreditsEntry_JunichiMasuda,
- gCreditsEntry_MorikazuAoki,
- gCreditsEntry_HitomiSato,
- },
- {
- _,
- gCreditsEntry_SoundEffectsAndPkmnVoices,
- gCreditsEntry_GoIchinose,
- gCreditsEntry_MorikazuAoki,
- _,
- },
- {
- gCreditsEntry_GameDesigners,
- gCreditsEntry_ShigekiMorimoto,
- gCreditsEntry_TeruyukiShimoyamada,
- gCreditsEntry_TakeshiKawachimaru,
- gCreditsEntry_AkihitoTomisawa,
- },
- {
- gCreditsEntry_GameDesigners,
- gCreditsEntry_SuguruNakatsui,
- gCreditsEntry_TetsujiOhta,
- gCreditsEntry_HitomiSato,
- gCreditsEntry_KenjiMatsushima,
- },
- {
- gCreditsEntry_GameDesigners,
- gCreditsEntry_JunichiMasuda,
- gCreditsEntry_KojiNishino,
- gCreditsEntry_ShigeruOhmori,
- gCreditsEntry_TadashiTakahashi,
- },
- {
- gCreditsEntry_ScenarioPlot,
- gCreditsEntry_AkihitoTomisawa,
- gCreditsEntry_JunichiMasuda,
- gCreditsEntry_KojiNishino,
- _,
- },
- {
- gCreditsEntry_Scenario,
- gCreditsEntry_AkihitoTomisawa,
- gCreditsEntry_HitomiSato,
- gCreditsEntry_ToshinobuMatsumiya,
- _,
- },
- {
- gCreditsEntry_ScriptDesigners,
- gCreditsEntry_TomomichiOhta,
- gCreditsEntry_SatoshiNohara,
- _,
- _,
- },
- {
- gCreditsEntry_MapDesigners,
- gCreditsEntry_SuguruNakatsui,
- gCreditsEntry_TeruyukiShimoyamada,
- gCreditsEntry_ShigeruOhmori,
- gCreditsEntry_TetsujiOhta,
- },
- {
- _,
- gCreditsEntry_BattleFrontierData,
- gCreditsEntry_TetsujiOhta,
- _,
- _,
- },
- {
- gCreditsEntry_ParametricDesigners,
- gCreditsEntry_TeruyukiShimoyamada,
- gCreditsEntry_ShigekiMorimoto,
- gCreditsEntry_TetsujiOhta,
- gCreditsEntry_KojiNishino,
- },
- {
- _,
- gCreditsEntry_PokedexText,
- gCreditsEntry_KenjiMatsushima,
- _,
- _,
- },
- {
- gCreditsEntry_EnvAndToolPgrms,
- gCreditsEntry_HisashiSogabe,
- gCreditsEntry_SosukeTamada,
- gCreditsEntry_HiroyukiNakamura,
- gCreditsEntry_AkitoMori,
- },
- {
- gCreditsEntry_PkmnDesigners,
- gCreditsEntry_KenSugimori,
- gCreditsEntry_MotofumiFujiwara,
- gCreditsEntry_ShigekiMorimoto,
- _,
- },
- {
- gCreditsEntry_PkmnDesigners,
- gCreditsEntry_HironobuYoshida,
- gCreditsEntry_SatoshiOhta,
- gCreditsEntry_AsukaIwashita,
- _,
- },
- {
- gCreditsEntry_PkmnDesigners,
- gCreditsEntry_TakaoUnno,
- gCreditsEntry_KanakoEo,
- gCreditsEntry_AimiTomita,
- _,
- },
- {
- gCreditsEntry_PkmnDesigners,
- gCreditsEntry_AtsukoNishida,
- gCreditsEntry_MuneoSaito,
- gCreditsEntry_RenaYoshikawa,
- gCreditsEntry_JunOkutani,
- },
- {
- _,
- gCreditsEntry_SupportProgrammers,
- gCreditsEntry_SatoshiMitsuhara,
- gCreditsEntry_DaisukeHoshino,
- _,
- },
- {
- _,
- gCreditsEntry_NCLProductTesting,
- gCreditsEntry_NCLSuperMarioClub,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_PackageAndManual,
- gCreditsEntry_KenSugimori,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_SpecialThanks,
- gCreditsEntry_KenjiTominaga,
- gCreditsEntry_HirokiEnomoto,
- _,
- },
- {
- gCreditsEntry_SpecialThanks,
- gCreditsEntry_KazuyaSuyama,
- gCreditsEntry_KenjiroIto,
- gCreditsEntry_MichikoTakizawa,
- gCreditsEntry_MakikoTakada,
- },
- {
- gCreditsEntry_SpecialThanks,
- gCreditsEntry_MikikoOhhashi,
- gCreditsEntry_TakanaoKondo,
- gCreditsEntry_RuiKawaguchi,
- _,
- },
- {
- gCreditsEntry_SpecialThanks,
- gCreditsEntry_TakahiroOhnishi,
- gCreditsEntry_NorihideOkamura,
- gCreditsEntry_ShunsukeKohori,
- _,
- },
- {
- gCreditsEntry_InfoSupervisors,
- gCreditsEntry_KazuyukiTerada,
- gCreditsEntry_YuriSakurai,
- gCreditsEntry_YumiFunasaka,
- gCreditsEntry_NaokoYanase,
- },
- {
- _,
- gCreditsEntry_Artwork,
- gCreditsEntry_SachikoNakamichi,
- gCreditsEntry_FujikoNomura,
- _,
- },
- {
- _,
- gCreditsEntry_Artwork,
- gCreditsEntry_HideyukiNakajima,
- gCreditsEntry_HidenoriSaeki,
- _,
- },
- {
- gCreditsEntry_Artwork,
- gCreditsEntry_YokoWatanabe,
- gCreditsEntry_SakaeKimura,
- gCreditsEntry_ChiakiShinkai,
- _,
- },
- {
- gCreditsEntry_Coordinators,
- gCreditsEntry_KazukiYoshihara,
- gCreditsEntry_AkiraKinashi,
- gCreditsEntry_RetsujiNomoto,
- _,
- },
- {
- _,
- gCreditsEntry_EnglishVersion,
- gCreditsEntry_HiroNakamura,
- gCreditsEntry_SethMcMahill,
- _,
- },
- {
- _,
- gCreditsEntry_Translator,
- gCreditsEntry_NobOgasawara,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_TextEditor,
- gCreditsEntry_TeresaLillygren,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_NCLCoordinator,
- gCreditsEntry_KimikoNakamichi,
- _,
- _,
- },
- {
- gCreditsEntry_Programmers,
- gCreditsEntry_TerukiMurakawa,
- gCreditsEntry_SouichiYamamoto,
- gCreditsEntry_YuichiroIto,
- gCreditsEntry_AkiraKinashi,
- },
- {
- _,
- gCreditsEntry_GraphicDesigner,
- gCreditsEntry_AkiraKinashi,
- _,
- _,
- },
- {
- gCreditsEntry_EnvAndToolPgrms,
- gCreditsEntry_TerukiMurakawa,
- gCreditsEntry_SouichiYamamoto,
- gCreditsEntry_KimikoNakamichi,
- _,
- },
- {
- gCreditsEntry_NOAProductTesting,
- gCreditsEntry_ThomasHertzog,
- gCreditsEntry_ErikJohnson,
- gCreditsEntry_MikaKurosawa,
- _,
- },
- {
- gCreditsEntry_BrailleCodeCheck,
- gCreditsEntry_NationalFederationBlind,
- gCreditsEntry_PatriciaAMaurer,
- gCreditsEntry_JapanBrailleLibrary,
- gCreditsEntry_EuropeanBlindUnion,
- },
- {
- _,
- gCreditsEntry_BrailleCodeCheck,
- gCreditsEntry_AustralianBrailleAuthority,
- gCreditsEntry_RoyalNewZealandFederationBlind,
- _,
- },
- {
- gCreditsEntry_SpecialThanks,
- gCreditsEntry_HiroyukiUesugi,
- gCreditsEntry_MotoyasuTojima,
- gCreditsEntry_NicolaPrattBarlow,
- gCreditsEntry_ShellieDow,
- },
- {
- _,
- gCreditsEntry_TaskManagers,
- gCreditsEntry_AzusaTajima,
- gCreditsEntry_ShusakuEgami,
- _,
- },
- {
- gCreditsEntry_Producers,
- gCreditsEntry_HiroyukiJinnai,
- gCreditsEntry_HitoshiYamagami,
- gCreditsEntry_GakujiNomoto,
- gCreditsEntry_HiroakiTsuru,
- },
- {
- _,
- gCreditsEntry_ExecutiveDirector,
- gCreditsEntry_SatoshiTajiri,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_ExecProducers,
- gCreditsEntry_SatoruIwata,
- _,
- _,
- },
- {
- _,
- gCreditsEntry_ExecProducers,
- gCreditsEntry_TsunekazIshihara,
- _,
- _,
- },
-};
-#undef _
+#include "data/credits.h"
static const struct BgTemplate sBackgroundTemplates[] =
{
@@ -966,7 +197,7 @@ static const u8 sMonSpritePos[][2] =
{136, 36},
};
-static const union AnimCmd gUnknown_085E6F84[] =
+static const union AnimCmd sAnim_Player_Slow[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(64, 8),
@@ -975,7 +206,7 @@ static const union AnimCmd gUnknown_085E6F84[] =
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E6F98[] =
+static const union AnimCmd sAnim_Player_Fast[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(64, 4),
@@ -984,7 +215,7 @@ static const union AnimCmd gUnknown_085E6F98[] =
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E6FAC[] =
+static const union AnimCmd sAnim_Player_LookBack[] =
{
ANIMCMD_FRAME(256, 4),
ANIMCMD_FRAME(320, 4),
@@ -992,7 +223,7 @@ static const union AnimCmd gUnknown_085E6FAC[] =
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E6FBC[] =
+static const union AnimCmd sAnim_Player_LookForward[] =
{
ANIMCMD_FRAME(384, 30),
ANIMCMD_FRAME(320, 30),
@@ -1001,15 +232,15 @@ static const union AnimCmd gUnknown_085E6FBC[] =
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E6FD0[] =
+static const union AnimCmd *const sAnims_Player[] =
{
- gUnknown_085E6F84,
- gUnknown_085E6F98,
- gUnknown_085E6FAC,
- gUnknown_085E6FBC,
+ sAnim_Player_Slow,
+ sAnim_Player_Fast,
+ sAnim_Player_LookBack,
+ sAnim_Player_LookForward,
};
-static const union AnimCmd gUnknown_085E6FE0[] =
+static const union AnimCmd sAnim_Rival_Slow[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(64, 8),
@@ -1018,7 +249,7 @@ static const union AnimCmd gUnknown_085E6FE0[] =
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E6FF4[] =
+static const union AnimCmd sAnim_Rival_Fast[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(64, 4),
@@ -1027,31 +258,32 @@ static const union AnimCmd gUnknown_085E6FF4[] =
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E7008[] =
+static const union AnimCmd sAnim_Rival_Still[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E7010[] =
+static const union AnimCmd *const sAnims_Rival[] =
{
- gUnknown_085E6FE0,
- gUnknown_085E6FF4,
- gUnknown_085E7008,
+ sAnim_Rival_Slow,
+ sAnim_Rival_Fast,
+ sAnim_Rival_Still,
};
-static const struct SpriteSheet gUnknown_085E701C[] = {
- { gDecompressionBuffer, 6144, 1001 },
- { NULL },
+#define MONBG_OFFSET (MON_PIC_SIZE * 3)
+static const struct SpriteSheet sSpriteSheet_MonBg[] = {
+ { gDecompressionBuffer, MONBG_OFFSET, TAG_MON_BG },
+ {},
};
-static const struct SpritePalette gUnknown_085E702C[] = {
- { (const u16 *)(gDecompressionBuffer + 0x1800), 1001 },
- { NULL },
+static const struct SpritePalette sSpritePalette_MonBg[] = {
+ { (const u16 *)&gDecompressionBuffer[MONBG_OFFSET], TAG_MON_BG },
+ {},
};
-static const struct OamData gUnknown_085E703C =
+static const struct OamData sOamData_MonBg =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -1066,101 +298,74 @@ static const struct OamData gUnknown_085E703C =
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E7044[] =
+static const union AnimCmd sAnim_MonBg_Yellow[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E704C[] =
+static const union AnimCmd sAnim_MonBg_Red[] =
{
ANIMCMD_FRAME(64, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E7054[] =
+static const union AnimCmd sAnim_MonBg_Blue[] =
{
ANIMCMD_FRAME(128, 8),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E705C[] =
+static const union AnimCmd *const sAnims_MonBg[] =
{
- gUnknown_085E7044,
- gUnknown_085E704C,
- gUnknown_085E7054,
+ [POS_LEFT] = sAnim_MonBg_Yellow,
+ [POS_CENTER] = sAnim_MonBg_Red,
+ [POS_RIGHT] = sAnim_MonBg_Blue,
};
-static const struct SpriteTemplate gUnknown_085E7068 =
+static const struct SpriteTemplate sSpriteTemplate_CreditsMonBg =
{
- .tileTag = 1001,
- .paletteTag = 1001,
- .oam = &gUnknown_085E703C,
- .anims = gUnknown_085E705C,
+ .tileTag = TAG_MON_BG,
+ .paletteTag = TAG_MON_BG,
+ .oam = &sOamData_MonBg,
+ .anims = sAnims_MonBg,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_81772B8,
+ .callback = SpriteCB_CreditsMonBg,
};
-static void Task_WaitPaletteFade(u8 taskIdA);
-static void Task_ProgressCreditTasks(u8 taskIdA);
-static void sub_8175808(u8 taskIdA);
-static void c2_080C9BFC(u8 taskIdA);
-static void Task_CreditsLoadGrassScene(u8 taskIdA);
-static void sub_81758A4(u8 taskIdA);
-static void Task_CreditsTheEnd1(u8 taskIdA);
-static void Task_CreditsTheEnd2(u8 taskIdA);
-static void Task_CreditsTheEnd3(u8 taskIdA);
-static void Task_CreditsTheEnd4(u8 taskIdA);
-static void Task_CreditsTheEnd5(u8 taskIdA);
-static void Task_CreditsTheEnd6(u8 taskIdA);
-static void Task_CreditsSoftReset(u8 taskIdA);
-static void ResetGpuAndVram(void);
-static void sub_8175DA0(u8 taskIdB);
-static u8 CheckChangeScene(u8 page, u8 taskIdA);
-static void sub_81760FC(u8 taskIdA);
-static void sub_817651C(u8 taskIdA);
-static void sub_817624C(u8 taskIdA);
-static bool8 sub_8176AB0(u8 data, u8 taskIdA);
-static void ResetCreditsTasks(u8 taskIdA);
-static void LoadTheEndScreen(u16, u16, u16);
-static void sub_8176E40(u16 arg0, u16 palette);
-static void sub_8176EE8(struct Sprite *sprite);
-static void sub_8176F90(struct Sprite *sprite);
-static u8 MakeMonSprite(u16 species, s16 x, s16 y, u16 position);
-static void DeterminePokemonToShow(void);
-
-static void CreditsVBlankCallback(void)
+static void VBlankCB_Credits(void)
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
-static void CB2_RunCreditsSequence(void)
+static void CB2_Credits(void)
{
RunTasks();
AnimateSprites();
if ((JOY_HELD(B_BUTTON))
- && gHasHallOfFameRecords != 0
- && gTasks[gUnknown_0203BCE2].func == Task_ProgressCreditTasks)
+ && gHasHallOfFameRecords
+ && gTasks[sSavedTaskId].func == Task_CreditsMain)
{
- CreditsVBlankCallback();
+ // Speed up credits
+ VBlankCB_Credits();
RunTasks();
AnimateSprites();
- gUnknown_0203BCE5 = 1;
+ sUsedSpeedUp = TRUE;
}
BuildOamBuffer();
UpdatePaletteFade();
}
-static void sub_8175548(void)
+static void InitCreditsBgsAndWindows(void)
{
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBackgroundTemplates, ARRAY_COUNT(sBackgroundTemplates));
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
- LoadPalette(gUnknown_085E56F0, 0x80, 0x40);
+ LoadPalette(sCredits_Pal, 0x80, 64);
InitWindows(sWindowTemplates);
DeactivateAllTextPrinters();
PutWindowTilemap(0);
@@ -1168,7 +373,7 @@ static void sub_8175548(void)
ShowBg(0);
}
-static void sub_81755A4(void)
+static void FreeCreditsBgsAndWindows(void)
{
void *ptr;
FreeAllWindowBuffers();
@@ -1182,151 +387,153 @@ static void PrintCreditsText(const u8 *string, u8 y, bool8 isTitle)
u8 x;
u8 color[3];
- color[0] = 0;
+ color[0] = TEXT_COLOR_TRANSPARENT;
if (isTitle == TRUE)
{
- color[1] = 3;
- color[2] = 4;
+ color[1] = TEXT_COLOR_LIGHT_GREY;
+ color[2] = TEXT_COLOR_RED;
}
else
{
- color[1] = 1;
- color[2] = 2;
+ color[1] = TEXT_COLOR_WHITE;
+ color[2] = TEXT_COLOR_DARK_GREY;
}
- x = GetStringCenterAlignXOffsetWithLetterSpacing(1, string, 0xF0, 1);
+ x = GetStringCenterAlignXOffsetWithLetterSpacing(1, string, DISPLAY_WIDTH, 1);
AddTextPrinterParameterized4(0, 1, x, y, 1, 0, color, -1, string);
}
+#define tMainTaskId data[1]
+
void CB2_StartCreditsSequence(void)
{
- u8 taskIdA;
- s16 taskIdC;
- u8 taskIdB;
+ u8 taskId;
+ s16 bikeTaskId;
+ u8 pageTaskId;
ResetGpuAndVram();
SetVBlankCallback(NULL);
InitHeap(gHeap, HEAP_SIZE);
ResetPaletteFade();
ResetTasks();
- sub_8175548();
+ InitCreditsBgsAndWindows();
- taskIdA = CreateTask(Task_WaitPaletteFade, 0);
+ taskId = CreateTask(Task_WaitPaletteFade, 0);
- gTasks[taskIdA].data[TDA_4] = 0;
- gTasks[taskIdA].data[TDA_7] = 0;
- gTasks[taskIdA].data[TDA_11] = 0;
- gTasks[taskIdA].data[TDA_13] = 1;
+ gTasks[taskId].tEndCredits = FALSE;
+ gTasks[taskId].tSceneNum = SCENE_OCEAN_MORNING;
+ gTasks[taskId].tNextMode = MODE_NONE;
+ gTasks[taskId].tCurrentMode = MODE_BIKE_SCENE;
while (TRUE)
{
- if (sub_8176AB0(0, taskIdA))
+ if (LoadBikeScene(SCENE_OCEAN_MORNING, taskId))
break;
}
- taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID];
- gTasks[taskIdC].data[TDC_0] = 40;
+ bikeTaskId = gTasks[taskId].tTaskId_BikeScene;
+ gTasks[bikeTaskId].tState = 40;
SetGpuReg(REG_OFFSET_BG0VOFS, 0xFFFC);
- taskIdB = CreateTask(sub_8175DA0, 0);
+ pageTaskId = CreateTask(Task_UpdatePage, 0);
- gTasks[taskIdB].data[TDB_TASK_A_ID] = taskIdA;
- gTasks[taskIdA].data[TDA_TASK_B_ID] = taskIdB;
+ gTasks[pageTaskId].tMainTaskId = taskId;
+ gTasks[taskId].tTaskId_UpdatePage = pageTaskId;
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(INTR_FLAG_VBLANK);
- SetVBlankCallback(CreditsVBlankCallback);
+ SetVBlankCallback(VBlankCB_Credits);
m4aSongNumStart(MUS_CREDITS);
- SetMainCallback2(CB2_RunCreditsSequence);
- gUnknown_0203BCE5 = 0;
+ SetMainCallback2(CB2_Credits);
+ sUsedSpeedUp = FALSE;
sCreditsData = AllocZeroed(sizeof(struct CreditsData));
DeterminePokemonToShow();
sCreditsData->imgCounter = 0;
- sCreditsData->nextImgPos = 0;
+ sCreditsData->nextImgPos = POS_LEFT;
sCreditsData->currShownMon = 0;
- gUnknown_0203BCE2 = taskIdA;
+ sSavedTaskId = taskId;
}
-static void Task_WaitPaletteFade(u8 taskIdA)
+static void Task_WaitPaletteFade(u8 taskId)
{
if (!gPaletteFade.active)
- gTasks[taskIdA].func = Task_ProgressCreditTasks;
+ gTasks[taskId].func = Task_CreditsMain;
}
-static void Task_ProgressCreditTasks(u8 taskIdA)
+static void Task_CreditsMain(u8 taskId)
{
- u16 data1;
+ u16 mode;
- if (gTasks[taskIdA].data[TDA_4])
+ if (gTasks[taskId].tEndCredits)
{
- s16 taskIdC;
+ s16 bikeTaskId = gTasks[taskId].tTaskId_BikeScene;
+ gTasks[bikeTaskId].tState = 30;
- taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID];
- gTasks[taskIdC].data[TDC_0] = 30;
-
- gTasks[taskIdA].data[TDA_12] = 0x100;
- gTasks[taskIdA].func = Task_CreditsTheEnd1;
+ gTasks[taskId].tTheEndDelay = 256;
+ gTasks[taskId].func = Task_CreditsTheEnd1;
return;
}
- gUnknown_0203BCE0 = 0;
- data1 = gTasks[taskIdA].data[TDA_11];
+ sUnkVar = 0;
+ mode = gTasks[taskId].tNextMode;
- if (gTasks[taskIdA].data[TDA_11] == 1)
+ if (gTasks[taskId].tNextMode == MODE_BIKE_SCENE)
{
- gTasks[taskIdA].data[TDA_13] = data1;
- gTasks[taskIdA].data[TDA_11] = 0;
+ // Start a bike cutscene
+ gTasks[taskId].tCurrentMode = mode;
+ gTasks[taskId].tNextMode = MODE_NONE;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
- gTasks[taskIdA].func = sub_8175808;
+ gTasks[taskId].func = Task_ReadyBikeScene;
}
- else if (gTasks[taskIdA].data[TDA_11] == 2)
+ else if (gTasks[taskId].tNextMode == MODE_SHOW_MONS)
{
- gTasks[taskIdA].data[TDA_13] = data1;
- gTasks[taskIdA].data[TDA_11] = 0;
+ // Start a Pokémon interlude
+ gTasks[taskId].tCurrentMode = mode;
+ gTasks[taskId].tNextMode = MODE_NONE;
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
- gTasks[taskIdA].func = sub_81758A4;
+ gTasks[taskId].func = Task_ReadyShowMons;
}
}
-static void sub_8175808(u8 taskIdA)
+static void Task_ReadyBikeScene(u8 taskId)
{
if (!gPaletteFade.active)
{
SetGpuReg(REG_OFFSET_DISPCNT, 0);
- ResetCreditsTasks(taskIdA);
- gTasks[taskIdA].func = c2_080C9BFC;
+ ResetCreditsTasks(taskId);
+ gTasks[taskId].func = Task_SetBikeScene;
}
}
-static void c2_080C9BFC(u8 taskIdA)
+static void Task_SetBikeScene(u8 taskId)
{
SetVBlankCallback(NULL);
- if (sub_8176AB0(gTasks[taskIdA].data[TDA_7], taskIdA))
+ if (LoadBikeScene(gTasks[taskId].tSceneNum, taskId))
{
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
EnableInterrupts(INTR_FLAG_VBLANK);
- SetVBlankCallback(CreditsVBlankCallback);
- gTasks[taskIdA].func = Task_WaitPaletteFade;
+ SetVBlankCallback(VBlankCB_Credits);
+ gTasks[taskId].func = Task_WaitPaletteFade;
}
}
-static void sub_81758A4(u8 taskIdA)
+static void Task_ReadyShowMons(u8 taskId)
{
if (!gPaletteFade.active)
{
SetGpuReg(REG_OFFSET_DISPCNT, 0);
- ResetCreditsTasks(taskIdA);
- gTasks[taskIdA].func = Task_CreditsLoadGrassScene;
+ ResetCreditsTasks(taskId);
+ gTasks[taskId].func = Task_LoadShowMons;
}
}
-static void Task_CreditsLoadGrassScene(u8 taskIdA)
+static void Task_LoadShowMons(u8 taskId)
{
switch (gMain.state)
{
@@ -1344,30 +551,30 @@ static void Task_CreditsLoadGrassScene(u8 taskIdA)
LZ77UnCompVram(gBirchGrassTilemap, (void *)(BG_SCREEN_ADDR(7)));
LoadPalette(gBirchBagGrassPal[0] + 1, 1, 31 * 2);
- for (i = 0; i < 0x800; i++)
+ for (i = 0; i < MON_PIC_SIZE; i++)
gDecompressionBuffer[i] = 0x11;
- for (i = 0; i < 0x800; i++)
- (gDecompressionBuffer + 0x800)[i] = 0x22;
- for (i = 0; i < 0x800; i++)
- (gDecompressionBuffer + 0x1000)[i] = 0x33;
+ for (i = 0; i < MON_PIC_SIZE; i++)
+ (gDecompressionBuffer + MON_PIC_SIZE)[i] = 0x22;
+ for (i = 0; i < MON_PIC_SIZE; i++)
+ (gDecompressionBuffer + MON_PIC_SIZE * 2)[i] = 0x33;
- temp = (u16 *)(&gDecompressionBuffer[0x1800]);
+ temp = (u16 *)(&gDecompressionBuffer[MONBG_OFFSET]);
temp[0] = RGB_BLACK;
temp[1] = RGB(31, 31, 20); // light yellow
temp[2] = RGB(31, 20, 20); // light red
temp[3] = RGB(20, 20, 31); // light blue
- LoadSpriteSheet(gUnknown_085E701C);
- LoadSpritePalette(gUnknown_085E702C);
+ LoadSpriteSheet(sSpriteSheet_MonBg);
+ LoadSpritePalette(sSpritePalette_MonBg);
- gMain.state += 1;
+ gMain.state++;
break;
}
case 1:
- gTasks[taskIdA].data[TDA_TASK_D_ID] = CreateTask(sub_81760FC, 0);
- gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_STATE] = 1;
- gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_TASK_A_ID] = taskIdA;
- gTasks[gTasks[taskIdA].data[TDA_TASK_D_ID]].data[TDD_2] = gTasks[taskIdA].data[TDA_7];
+ gTasks[taskId].tTaskId_ShowMons = CreateTask(Task_ShowMons, 0);
+ gTasks[gTasks[taskId].tTaskId_ShowMons].tState = 1;
+ gTasks[gTasks[taskId].tTaskId_ShowMons].tMainTaskId = taskId;
+ gTasks[gTasks[taskId].tTaskId_ShowMons].data[2] = gTasks[taskId].tSceneNum; // data[2] never read
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetGpuReg(REG_OFFSET_BG3HOFS, 0);
@@ -1384,34 +591,36 @@ static void Task_CreditsLoadGrassScene(u8 taskIdA)
| DISPCNT_OBJ_ON);
gMain.state = 0;
- gUnknown_0203BD28 = 0;
- gTasks[taskIdA].func = Task_WaitPaletteFade;
+ gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_NORMAL;
+ gTasks[taskId].func = Task_WaitPaletteFade;
break;
}
}
-static void Task_CreditsTheEnd1(u8 taskIdA)
+static void Task_CreditsTheEnd1(u8 taskId)
{
- if (gTasks[taskIdA].data[TDA_12])
+ if (gTasks[taskId].tTheEndDelay)
{
- gTasks[taskIdA].data[TDA_12] -= 1;
+ gTasks[taskId].tTheEndDelay--;
return;
}
BeginNormalPaletteFade(PALETTES_ALL, 12, 0, 16, RGB_BLACK);
- gTasks[taskIdA].func = Task_CreditsTheEnd2;
+ gTasks[taskId].func = Task_CreditsTheEnd2;
}
-static void Task_CreditsTheEnd2(u8 taskIdA)
+static void Task_CreditsTheEnd2(u8 taskId)
{
if (!gPaletteFade.active)
{
- ResetCreditsTasks(taskIdA);
- gTasks[taskIdA].func = Task_CreditsTheEnd3;
+ ResetCreditsTasks(taskId);
+ gTasks[taskId].func = Task_CreditsTheEnd3;
}
}
-static void Task_CreditsTheEnd3(u8 taskIdA)
+#define tDelay data[0]
+
+static void Task_CreditsTheEnd3(u8 taskId)
{
ResetGpuAndVram();
ResetPaletteFade();
@@ -1430,60 +639,62 @@ static void Task_CreditsTheEnd3(u8 taskIdA)
| DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON);
- gTasks[taskIdA].data[TDA_0] = 235; //set this to 215 to actually show "THE END" in time to the last song beat
- gTasks[taskIdA].func = Task_CreditsTheEnd4;
+ gTasks[taskId].tDelay = 235; //set this to 215 to actually show "THE END" in time to the last song beat
+ gTasks[taskId].func = Task_CreditsTheEnd4;
}
-static void Task_CreditsTheEnd4(u8 taskIdA)
+static void Task_CreditsTheEnd4(u8 taskId)
{
- if (gTasks[taskIdA].data[TDA_0])
+ if (gTasks[taskId].tDelay)
{
- gTasks[taskIdA].data[TDA_0] -= 1;
+ gTasks[taskId].tDelay--;
return;
}
BeginNormalPaletteFade(PALETTES_ALL, 6, 0, 16, RGB_BLACK);
- gTasks[taskIdA].func = Task_CreditsTheEnd5;
+ gTasks[taskId].func = Task_CreditsTheEnd5;
}
-static void Task_CreditsTheEnd5(u8 taskIdA)
+static void Task_CreditsTheEnd5(u8 taskId)
{
if (!gPaletteFade.active)
{
- sub_8176E40(0x3800, 0);
+ DrawTheEnd(0x3800, 0);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0, RGB_BLACK);
- gTasks[taskIdA].data[TDA_0] = 7200;
- gTasks[taskIdA].func = Task_CreditsTheEnd6;
+ gTasks[taskId].tDelay = 7200;
+ gTasks[taskId].func = Task_CreditsTheEnd6;
}
}
-static void Task_CreditsTheEnd6(u8 taskIdA)
+static void Task_CreditsTheEnd6(u8 taskId)
{
if (!gPaletteFade.active)
{
- if (gTasks[taskIdA].data[TDA_0] == 0 || gMain.newKeys)
+ if (gTasks[taskId].tDelay == 0 || gMain.newKeys)
{
FadeOutBGM(4);
BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA);
- gTasks[taskIdA].func = Task_CreditsSoftReset;
+ gTasks[taskId].func = Task_CreditsSoftReset;
return;
}
- if (gTasks[taskIdA].data[TDA_0] == 7144)
+ if (gTasks[taskId].tDelay == 7144)
FadeOutBGM(8);
- if (gTasks[taskIdA].data[TDA_0] == 6840)
+ if (gTasks[taskId].tDelay == 6840)
m4aSongNumStart(MUS_END);
- gTasks[taskIdA].data[TDA_0] -= 1;
+ gTasks[taskId].tDelay--;
}
}
-static void Task_CreditsSoftReset(u8 taskIdA)
+#undef tDelay
+
+static void Task_CreditsSoftReset(u8 taskId)
{
if (!gPaletteFade.active)
- SoftReset(0xFF);
+ SoftReset(RESET_ALL);
}
static void ResetGpuAndVram(void)
@@ -1508,11 +719,14 @@ static void ResetGpuAndVram(void)
DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2);
}
-static void sub_8175DA0(u8 taskIdB)
+#define tCurrentPage data[2]
+#define tDelay data[3]
+
+static void Task_UpdatePage(u8 taskId)
{
int i;
- switch (gTasks[taskIdB].data[TDB_0])
+ switch (gTasks[taskId].tState)
{
case 0:
case 6:
@@ -1522,419 +736,450 @@ static void sub_8175DA0(u8 taskIdB)
default:
if (!gPaletteFade.active)
{
- gTasks[taskIdB].data[TDB_0] = 1;
- gTasks[taskIdB].data[TDB_3] = 0x48;
- gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 0;
- gUnknown_0203BCE0 = 0;
+ gTasks[taskId].tState = 1;
+ gTasks[taskId].tDelay = 72;
+ gTasks[gTasks[taskId].tMainTaskId].tPrintedPage = FALSE;
+ sUnkVar = 0;
}
return;
case 1:
- if (gTasks[taskIdB].data[TDB_3] != 0)
+ if (gTasks[taskId].tDelay != 0)
{
- gTasks[taskIdB].data[TDB_3] -= 1;
+ gTasks[taskId].tDelay--;
return;
}
- gTasks[taskIdB].data[TDB_0] += 1;
+ gTasks[taskId].tState++;
return;
case 2:
- if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].func == Task_ProgressCreditTasks)
+ if (gTasks[gTasks[taskId].tMainTaskId].func == Task_CreditsMain)
{
- if (gTasks[taskIdB].data[TDB_CURRENT_PAGE] < PAGE_COUNT)
+ if (gTasks[taskId].tCurrentPage < PAGE_COUNT)
{
- for (i = 0; i < 5; i++)
+ // Print text for this Credits page
+ for (i = 0; i < ENTRIES_PER_PAGE; i++)
PrintCreditsText(
- gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->text,
+ sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->text,
5 + i * 16,
- gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->isTitle);
-
+ sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->isTitle);
CopyWindowToVram(0, 2);
- gTasks[taskIdB].data[TDB_CURRENT_PAGE] += 1;
- gTasks[taskIdB].data[TDB_0] += 1;
+ gTasks[taskId].tCurrentPage++;
+ gTasks[taskId].tState++;
- gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 1;
+ gTasks[gTasks[taskId].tMainTaskId].tPrintedPage = TRUE;
- if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_13] == 1)
- BeginNormalPaletteFade(0x00000300, 0, 16, 0, COLOR_LIGHT_GREEN);
- else
- BeginNormalPaletteFade(0x00000300, 0, 16, 0, COLOR_DARK_GREEN);
+ if (gTasks[gTasks[taskId].tMainTaskId].tCurrentMode == MODE_BIKE_SCENE)
+ BeginNormalPaletteFade(0x300, 0, 16, 0, COLOR_LIGHT_GREEN);
+ else // MODE_SHOW_MONS
+ BeginNormalPaletteFade(0x300, 0, 16, 0, COLOR_DARK_GREEN);
return;
}
- gTasks[taskIdB].data[TDB_0] = 10;
+
+ // Reached final page of Credits, end task
+ gTasks[taskId].tState = 10;
return;
}
- gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_14] = 0;
+ gTasks[gTasks[taskId].tMainTaskId].tPrintedPage = FALSE;
return;
case 3:
if (!gPaletteFade.active)
{
- gTasks[taskIdB].data[TDB_3] = 0x73;
- gTasks[taskIdB].data[TDB_0] += 1;
+ gTasks[taskId].tDelay = 115;
+ gTasks[taskId].tState++;
}
return;
case 4:
- if (gTasks[taskIdB].data[TDB_3] != 0)
+ if (gTasks[taskId].tDelay != 0)
{
- gTasks[taskIdB].data[TDB_3] -= 1;
+ gTasks[taskId].tDelay--;
return;
}
- if (CheckChangeScene((u8)gTasks[taskIdB].data[TDB_CURRENT_PAGE], (u8)gTasks[taskIdB].data[TDB_TASK_A_ID]))
+ if (CheckChangeScene((u8)gTasks[taskId].tCurrentPage, (u8)gTasks[taskId].tMainTaskId))
{
- gTasks[taskIdB].data[TDB_0] += 1;
+ gTasks[taskId].tState++;
return;
}
- gTasks[taskIdB].data[TDB_0] += 1;
- if (gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_13] == 1)
- BeginNormalPaletteFade(0x00000300, 0, 0, 16, COLOR_LIGHT_GREEN);
- else
- BeginNormalPaletteFade(0x00000300, 0, 0, 16, COLOR_DARK_GREEN);
+ gTasks[taskId].tState++;
+ if (gTasks[gTasks[taskId].tMainTaskId].tCurrentMode == MODE_BIKE_SCENE)
+ BeginNormalPaletteFade(0x300, 0, 0, 16, COLOR_LIGHT_GREEN);
+ else // MODE_SHOW_MONS
+ BeginNormalPaletteFade(0x300, 0, 0, 16, COLOR_DARK_GREEN);
return;
case 5:
if (!gPaletteFade.active)
{
+ // Still more Credits pages to show, return to state 2 to print
FillWindowPixelBuffer(0, PIXEL_FILL(0));
CopyWindowToVram(0, 2);
- gTasks[taskIdB].data[TDB_0] = 2;
+ gTasks[taskId].tState = 2;
}
return;
case 10:
- gTasks[gTasks[taskIdB].data[TDB_TASK_A_ID]].data[TDA_4] = 1;
- DestroyTask(taskIdB);
- sub_81755A4();
+ gTasks[gTasks[taskId].tMainTaskId].tEndCredits = TRUE;
+ DestroyTask(taskId);
+ FreeCreditsBgsAndWindows();
FREE_AND_SET_NULL(sCreditsData);
return;
}
}
-static u8 CheckChangeScene(u8 page, u8 taskIdA)
+#undef tDelay
+
+#define PAGE_INTERVAL (PAGE_COUNT / 9) // 9 scenes (5 bike scenes, 4 Pokémon interludes)
+
+static u8 CheckChangeScene(u8 page, u8 taskId)
{
- // Starts with bike + ocean + morning
+ // Starts with bike + ocean + morning (SCENE_OCEAN_MORNING)
- if (page == 6)
+ if (page == PAGE_INTERVAL * 1)
{
- // Grass patch
- gTasks[taskIdA].data[TDA_11] = 2;
+ // Pokémon interlude
+ gTasks[taskId].tNextMode = MODE_SHOW_MONS;
}
- if (page == 12)
+ if (page == PAGE_INTERVAL * 2)
{
// Bike + ocean + sunset
- gTasks[taskIdA].data[TDA_7] = 1;
- gTasks[taskIdA].data[TDA_11] = 1;
+ gTasks[taskId].tSceneNum = SCENE_OCEAN_SUNSET;
+ gTasks[taskId].tNextMode = MODE_BIKE_SCENE;
}
- if (page == 18)
+ if (page == PAGE_INTERVAL * 3)
{
- // Grass patch
- gTasks[taskIdA].data[TDA_11] = 2;
+ // Pokémon interlude
+ gTasks[taskId].tNextMode = MODE_SHOW_MONS;
}
- if (page == 24)
+ if (page == PAGE_INTERVAL * 4)
{
// Bike + forest + sunset
- gTasks[taskIdA].data[TDA_7] = 2;
- gTasks[taskIdA].data[TDA_11] = 1;
+ gTasks[taskId].tSceneNum = SCENE_FOREST_RIVAL_ARRIVE;
+ gTasks[taskId].tNextMode = MODE_BIKE_SCENE;
}
- if (page == 30)
+ if (page == PAGE_INTERVAL * 5)
{
- // Grass patch
- gTasks[taskIdA].data[TDA_11] = 2;
+ // Pokémon interlude
+ gTasks[taskId].tNextMode = MODE_SHOW_MONS;
}
- if (page == 36)
+ if (page == PAGE_INTERVAL * 6)
{
// Bike + forest + sunset
- gTasks[taskIdA].data[TDA_7] = 3;
- gTasks[taskIdA].data[TDA_11] = 1;
+ gTasks[taskId].tSceneNum = SCENE_FOREST_CATCH_RIVAL;
+ gTasks[taskId].tNextMode = MODE_BIKE_SCENE;
}
- if (page == 42)
+ if (page == PAGE_INTERVAL * 7)
{
- // Grass patch
- gTasks[taskIdA].data[TDA_11] = 2;
+ // Pokémon interlude
+ gTasks[taskId].tNextMode = MODE_SHOW_MONS;
}
- if (page == 48)
+ if (page == PAGE_INTERVAL * 8)
{
// Bike + town + night
- gTasks[taskIdA].data[TDA_7] = 4;
- gTasks[taskIdA].data[TDA_11] = 1;
+ gTasks[taskId].tSceneNum = SCENE_CITY_NIGHT;
+ gTasks[taskId].tNextMode = MODE_BIKE_SCENE;
}
- if (gTasks[taskIdA].data[TDA_11] != 0)
+ if (gTasks[taskId].tNextMode != MODE_NONE)
{
- // Returns true if changed?
+ // Returns true if changed
return TRUE;
}
return FALSE;
}
-static void sub_81760FC(u8 taskIdD)
+#define tDelay data[3]
+
+static void Task_ShowMons(u8 taskId)
{
- u8 r2;
+ u8 spriteId;
- switch (gTasks[taskIdD].data[TDD_STATE])
+ switch (gTasks[taskId].tState)
{
case 0:
break;
case 1:
- if (sCreditsData->nextImgPos == 0 && gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].data[TDA_14] == 0)
+ if (sCreditsData->nextImgPos == POS_LEFT && gTasks[gTasks[taskId].tMainTaskId].tPrintedPage == FALSE)
break;
- gTasks[taskIdD].data[TDD_STATE]++;
+ gTasks[taskId].tState++;
break;
case 2:
- if (sCreditsData->imgCounter == NUM_MON_SLIDES || gTasks[gTasks[taskIdD].data[TDD_TASK_A_ID]].func != Task_ProgressCreditTasks)
+ if (sCreditsData->imgCounter == NUM_MON_SLIDES || gTasks[gTasks[taskId].tMainTaskId].func != Task_CreditsMain)
break;
- r2 = MakeMonSprite(sCreditsData->monToShow[sCreditsData->currShownMon], sMonSpritePos[sCreditsData->nextImgPos][0], sMonSpritePos[sCreditsData->nextImgPos][1], sCreditsData->nextImgPos);
+ spriteId = CreateCreditsMonSprite(sCreditsData->monToShow[sCreditsData->currShownMon],
+ sMonSpritePos[sCreditsData->nextImgPos][0],
+ sMonSpritePos[sCreditsData->nextImgPos][1],
+ sCreditsData->nextImgPos);
if (sCreditsData->currShownMon < sCreditsData->numMonToShow - 1)
{
sCreditsData->currShownMon++;
- gSprites[r2].data[3] = 50;
+ gSprites[spriteId].data[3] = 50;
}
else
{
sCreditsData->currShownMon = 0;
- gSprites[r2].data[3] = 512;
+ gSprites[spriteId].data[3] = 512;
}
sCreditsData->imgCounter++;
- if (sCreditsData->nextImgPos == 2)
- sCreditsData->nextImgPos = 0;
+
+ if (sCreditsData->nextImgPos == POS_RIGHT)
+ sCreditsData->nextImgPos = POS_LEFT;
else
sCreditsData->nextImgPos++;
- gTasks[taskIdD].data[TDD_3] = 50;
- gTasks[taskIdD].data[TDD_STATE]++;
+
+ gTasks[taskId].tDelay = 50;
+ gTasks[taskId].tState++;
break;
case 3:
- if (gTasks[taskIdD].data[TDD_3] != 0)
- gTasks[taskIdD].data[TDD_3]--;
+ if (gTasks[taskId].tDelay != 0)
+ gTasks[taskId].tDelay--;
else
- gTasks[taskIdD].data[TDD_STATE] = 1;
+ gTasks[taskId].tState = 1;
break;
}
}
-static void sub_817624C(u8 taskIdC)
+#undef tMainTaskId
+#undef tDelay
+
+#define tPlayer data[2]
+#define tRival data[3]
+#define tDelay data[4]
+#define tSinIdx data[5]
+
+static void Task_BikeScene(u8 taskId)
{
- switch (gTasks[taskIdC].data[TDC_0])
+ switch (gTasks[taskId].tState)
{
case 0:
- gUnknown_0203BD26 = Sin((gTasks[taskIdC].data[TDC_5] >> 1) & 0x7F, 12);
- gTasks[taskIdC].data[TDC_5]++;
+ gIntroCredits_MovingSceneryVOffset = Sin((gTasks[taskId].tSinIdx >> 1) & 0x7F, 12);
+ gTasks[taskId].tSinIdx++;
break;
case 1:
- if (gUnknown_0203BD26 != 0)
+ if (gIntroCredits_MovingSceneryVOffset != 0)
{
- gUnknown_0203BD26 = Sin((gTasks[taskIdC].data[TDC_5] >> 1) & 0x7F, 12);
- gTasks[taskIdC].data[TDC_5]++;
+ gIntroCredits_MovingSceneryVOffset = Sin((gTasks[taskId].tSinIdx >> 1) & 0x7F, 12);
+ gTasks[taskId].tSinIdx++;
}
else
{
- gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 2;
- gTasks[taskIdC].data[TDC_5] = 0;
- gTasks[taskIdC].data[TDC_0]++;
+ gSprites[gTasks[taskId].tPlayer].data[0] = 2;
+ gTasks[taskId].tSinIdx = 0;
+ gTasks[taskId].tState++;
}
break;
case 2:
- if (gTasks[taskIdC].data[TDC_5] < 64)
+ if (gTasks[taskId].tSinIdx < 64)
{
- gTasks[taskIdC].data[TDC_5]++;
- gUnknown_0203BD26 = Sin(gTasks[taskIdC].data[TDC_5] & 0x7F, 20);
+ gTasks[taskId].tSinIdx++;
+ gIntroCredits_MovingSceneryVOffset = Sin(gTasks[taskId].tSinIdx & 0x7F, 20);
}
else
{
- gTasks[taskIdC].data[TDC_0]++;
+ gTasks[taskId].tState++;
}
break;
case 3:
- gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 3;
- gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 1;
- gTasks[taskIdC].data[TDC_4] = 120;
- gTasks[taskIdC].data[TDC_0]++;
+ gSprites[gTasks[taskId].tPlayer].data[0] = 3;
+ gSprites[gTasks[taskId].tRival].data[0] = 1;
+ gTasks[taskId].tDelay = 120;
+ gTasks[taskId].tState++;
break;
case 4:
- if (gTasks[taskIdC].data[TDC_4] != 0)
+ if (gTasks[taskId].tDelay != 0)
{
- gTasks[taskIdC].data[TDC_4]--;
+ gTasks[taskId].tDelay--;
}
else
{
- gTasks[taskIdC].data[TDC_5] = 64;
- gTasks[taskIdC].data[TDC_0]++;
+ gTasks[taskId].tSinIdx = 64;
+ gTasks[taskId].tState++;
}
break;
case 5:
- if (gTasks[taskIdC].data[TDC_5] > 0)
+ if (gTasks[taskId].tSinIdx > 0)
{
- gTasks[taskIdC].data[TDC_5]--;
- gUnknown_0203BD26 = Sin(gTasks[taskIdC].data[TDC_5] & 0x7F, 20);
+ gTasks[taskId].tSinIdx--;
+ gIntroCredits_MovingSceneryVOffset = Sin(gTasks[taskId].tSinIdx & 0x7F, 20);
}
else
{
- gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 1;
- gTasks[taskIdC].data[TDC_0]++;
+ gSprites[gTasks[taskId].tPlayer].data[0] = 1;
+ gTasks[taskId].tState++;
}
break;
case 6:
- gTasks[taskIdC].data[TDC_0] = 50;
+ gTasks[taskId].tState = 50;
break;
case 10:
- gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 2;
- gTasks[taskIdC].data[TDC_0] = 50;
+ gSprites[gTasks[taskId].tRival].data[0] = 2;
+ gTasks[taskId].tState = 50;
break;
case 20:
- gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 4;
- gTasks[taskIdC].data[TDC_0] = 50;
+ gSprites[gTasks[taskId].tPlayer].data[0] = 4;
+ gTasks[taskId].tState = 50;
break;
case 30:
- gSprites[gTasks[taskIdC].data[TDC_2]].data[0] = 5;
- gSprites[gTasks[taskIdC].data[TDC_3]].data[0] = 3;
- gTasks[taskIdC].data[TDC_0] = 50;
+ gSprites[gTasks[taskId].tPlayer].data[0] = 5;
+ gSprites[gTasks[taskId].tRival].data[0] = 3;
+ gTasks[taskId].tState = 50;
break;
case 50:
- gTasks[taskIdC].data[TDC_0] = 0;
+ gTasks[taskId].tState = 0;
break;
}
}
-static void sub_817651C(u8 taskIdE)
+#define TIMER_STOP 0x7FFF
+#define tTimer data[1]
+#define tMainTaskId data[2]
+
+static void Task_CycleSceneryPalette(u8 taskId)
{
- s16 taskIdC;
+ s16 bikeTaskId;
- switch (gTasks[taskIdE].data[TDE_0])
+ switch (gTasks[taskId].tState)
{
default:
- case 0:
- if (gTasks[taskIdE].data[TDE_1] != 0x7FFF)
+ case SCENE_OCEAN_MORNING:
+ if (gTasks[taskId].tTimer != TIMER_STOP)
{
-
- if (gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_B_ID]].data[TDB_CURRENT_PAGE] == 2)
+ if (gTasks[gTasks[gTasks[taskId].tMainTaskId].tTaskId_UpdatePage].tCurrentPage == 2)
{
- gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID]].data[TDC_0] = 20;
- gTasks[taskIdE].data[TDE_1] = 0x7FFF;
+ gTasks[gTasks[gTasks[taskId].tMainTaskId].tTaskId_BikeScene].tState = 20;
+ gTasks[taskId].tTimer = TIMER_STOP;
}
}
- sub_817B540(0);
+ CycleSceneryPalette(0);
break;
- case 1:
- sub_817B540(0);
+ case SCENE_OCEAN_SUNSET:
+ CycleSceneryPalette(0);
break;
- case 2:
- if (gTasks[taskIdE].data[TDE_1] != 0x7FFF)
+ case SCENE_FOREST_RIVAL_ARRIVE:
+ if (gTasks[taskId].tTimer != TIMER_STOP)
{
- taskIdC = gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID];
+ bikeTaskId = gTasks[gTasks[taskId].tMainTaskId].tTaskId_BikeScene;
// Floor to multiple of 128
- if ((gTasks[taskIdC].data[TDC_5] & -128) == 640)
+ if ((gTasks[bikeTaskId].tSinIdx & -128) == 640)
{
- gTasks[taskIdC].data[TDC_0] = 1;
- gTasks[taskIdE].data[TDE_1] = 0x7FFF;
+ gTasks[bikeTaskId].tState = 1;
+ gTasks[taskId].tTimer = TIMER_STOP;
}
}
- sub_817B540(1);
+ CycleSceneryPalette(1);
break;
- case 3:
- if (gTasks[taskIdE].data[TDE_1] != 0x7FFF)
+ case SCENE_FOREST_CATCH_RIVAL:
+ if (gTasks[taskId].tTimer != TIMER_STOP)
{
- if (gTasks[taskIdE].data[TDE_1] == 0x248)
+ if (gTasks[taskId].tTimer == 584)
{
- gTasks[gTasks[gTasks[taskIdE].data[TDE_TASK_A_ID]].data[TDA_TASK_C_ID]].data[TDC_0] = 10;
- gTasks[taskIdE].data[TDE_1] = 0x7FFF;
+ gTasks[gTasks[gTasks[taskId].tMainTaskId].tTaskId_BikeScene].tState = 10;
+ gTasks[taskId].tTimer = TIMER_STOP;
}
else
{
- gTasks[taskIdE].data[TDE_1] += 1;
+ gTasks[taskId].tTimer++;
}
}
- sub_817B540(1);
+ CycleSceneryPalette(1);
break;
- case 4:
- sub_817B540(2);
+ case SCENE_CITY_NIGHT:
+ CycleSceneryPalette(2);
break;
}
}
-static void sub_817664C(u8 data, u8 taskIdA)
+static void SetBikeScene(u8 scene, u8 taskId)
{
- switch (data)
+ switch (scene)
{
- case 0:
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 272;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0;
- gTasks[taskIdA].data[TDA_0] = CreateBicycleAnimationTask(0, 0x2000, 0x20, 8);
+ case SCENE_OCEAN_MORNING:
+ gSprites[gTasks[taskId].tPlayerSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tRivalSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.x = DISPLAY_WIDTH + 32;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.x = DISPLAY_WIDTH + 32;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tPlayerSpriteId].data[0] = 0;
+ gSprites[gTasks[taskId].tRivalSpriteId].data[0] = 0;
+ gTasks[taskId].tTaskId_BgScenery = CreateBicycleBgAnimationTask(0, 0x2000, 0x20, 8);
break;
- case 1:
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0;
- gTasks[taskIdA].data[TDA_0] = CreateBicycleAnimationTask(0, 0x2000, 0x20, 8);
+ case SCENE_OCEAN_SUNSET:
+ gSprites[gTasks[taskId].tPlayerSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tRivalSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.x = 120;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.x = DISPLAY_WIDTH + 32;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tPlayerSpriteId].data[0] = 0;
+ gSprites[gTasks[taskId].tRivalSpriteId].data[0] = 0;
+ gTasks[taskId].tTaskId_BgScenery = CreateBicycleBgAnimationTask(0, 0x2000, 0x20, 8);
break;
- case 2:
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 272;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0;
- gTasks[taskIdA].data[TDA_0] = CreateBicycleAnimationTask(1, 0x2000, 0x200, 8);
+ case SCENE_FOREST_RIVAL_ARRIVE:
+ gSprites[gTasks[taskId].tPlayerSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tRivalSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.x = 120;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.x = DISPLAY_WIDTH + 32;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tPlayerSpriteId].data[0] = 0;
+ gSprites[gTasks[taskId].tRivalSpriteId].data[0] = 0;
+ gTasks[taskId].tTaskId_BgScenery = CreateBicycleBgAnimationTask(1, 0x2000, 0x200, 8);
break;
- case 3:
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 120;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = -32;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0;
- gTasks[taskIdA].data[TDA_0] = CreateBicycleAnimationTask(1, 0x2000, 0x200, 8);
+ case SCENE_FOREST_CATCH_RIVAL:
+ gSprites[gTasks[taskId].tPlayerSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tRivalSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.x = 120;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.x = -32;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tPlayerSpriteId].data[0] = 0;
+ gSprites[gTasks[taskId].tRivalSpriteId].data[0] = 0;
+ gTasks[taskId].tTaskId_BgScenery = CreateBicycleBgAnimationTask(1, 0x2000, 0x200, 8);
break;
- case 4:
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].invisible = FALSE;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.x = 88;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.x = 152;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].pos1.y = 46;
- gSprites[gTasks[taskIdA].data[TDA_PLAYER_CYCLIST]].data[0] = 0;
- gSprites[gTasks[taskIdA].data[TDA_RIVAL_CYCLIST]].data[0] = 0;
- gTasks[taskIdA].data[TDA_0] = CreateBicycleAnimationTask(2, 0x2000, 0x200, 8);
+ case SCENE_CITY_NIGHT:
+ gSprites[gTasks[taskId].tPlayerSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tRivalSpriteId].invisible = FALSE;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.x = 88;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.x = 152;
+ gSprites[gTasks[taskId].tPlayerSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tRivalSpriteId].pos1.y = 46;
+ gSprites[gTasks[taskId].tPlayerSpriteId].data[0] = 0;
+ gSprites[gTasks[taskId].tRivalSpriteId].data[0] = 0;
+ gTasks[taskId].tTaskId_BgScenery = CreateBicycleBgAnimationTask(2, 0x2000, 0x200, 8);
break;
}
- gTasks[taskIdA].data[TDA_TASK_E_ID] = CreateTask(sub_817651C, 0);
- gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_0] = data;
- gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_1] = 0;
- gTasks[gTasks[taskIdA].data[TDA_TASK_E_ID]].data[TDE_TASK_A_ID] = taskIdA;
+ gTasks[taskId].tTaskId_SceneryPal = CreateTask(Task_CycleSceneryPalette, 0);
+ gTasks[gTasks[taskId].tTaskId_SceneryPal].tState = scene;
+ gTasks[gTasks[taskId].tTaskId_SceneryPal].tTimer = 0;
+ gTasks[gTasks[taskId].tTaskId_SceneryPal].tMainTaskId = taskId;
- gTasks[taskIdA].data[TDA_TASK_C_ID] = CreateTask(sub_817624C, 0);
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_0] = 0;
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_1] = taskIdA;
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_2] = gTasks[taskIdA].data[TDA_PLAYER_CYCLIST];
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_3] = gTasks[taskIdA].data[TDA_RIVAL_CYCLIST];
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_4] = 0;
+ gTasks[taskId].tTaskId_BikeScene = CreateTask(Task_BikeScene, 0);
+ gTasks[gTasks[taskId].tTaskId_BikeScene].tState = 0;
+ gTasks[gTasks[taskId].tTaskId_BikeScene].data[1] = taskId; // data[1] is never read
+ gTasks[gTasks[taskId].tTaskId_BikeScene].tPlayer = gTasks[taskId].tPlayerSpriteId;
+ gTasks[gTasks[taskId].tTaskId_BikeScene].tRival = gTasks[taskId].tRivalSpriteId;
+ gTasks[gTasks[taskId].tTaskId_BikeScene].tDelay = 0;
- if (data == 2)
- gTasks[gTasks[taskIdA].data[TDA_TASK_C_ID]].data[TDC_5] = 0x45;
+ if (scene == SCENE_FOREST_RIVAL_ARRIVE)
+ gTasks[gTasks[taskId].tTaskId_BikeScene].tSinIdx = 69;
}
-static bool8 sub_8176AB0(u8 data, u8 taskIdA)
+#undef tTimer
+#undef tDelay
+#undef tSinIdx
+#undef tRival
+#undef tPlayer
+
+static bool8 LoadBikeScene(u8 scene, u8 taskId)
{
u8 spriteId;
@@ -1956,116 +1201,120 @@ static bool8 sub_8176AB0(u8 data, u8 taskIdA)
gMain.state = 1;
break;
case 1:
- gUnknown_0203BD24 = 34;
- gUnknown_0203BD26 = 0;
- sub_817B1C8(data);
- gMain.state += 1;
+ gIntroCredits_MovingSceneryVBase = 34;
+ gIntroCredits_MovingSceneryVOffset = 0;
+ LoadCreditsSceneGraphics(scene);
+ gMain.state++;
break;
case 2:
if (gSaveBlock2Ptr->playerGender == MALE)
{
- LoadCompressedSpriteSheet(gUnknown_085F5334);
- LoadCompressedSpriteSheet(gUnknown_085F53BC);
- LoadCompressedSpriteSheet(gUnknown_085F5354);
- LoadSpritePalettes(gUnknown_085F5384);
-
- spriteId = intro_create_brendan_sprite(120, 46);
- gTasks[taskIdA].data[TDA_PLAYER_CYCLIST] = spriteId;
- gSprites[spriteId].callback = sub_8176EE8;
- gSprites[spriteId].anims = gUnknown_085E6FD0;
-
- spriteId = intro_create_may_sprite(272, 46);
- gTasks[taskIdA].data[TDA_RIVAL_CYCLIST] = spriteId;
- gSprites[spriteId].callback = sub_8176F90;
- gSprites[spriteId].anims = gUnknown_085E7010;
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsBrendan);
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsRivalMay);
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsBicycle);
+ LoadSpritePalettes(gSpritePalettes_Credits);
+
+ spriteId = CreateIntroBrendanSprite(120, 46);
+ gTasks[taskId].tPlayerSpriteId = spriteId;
+ gSprites[spriteId].callback = SpriteCB_Player;
+ gSprites[spriteId].anims = sAnims_Player;
+
+ spriteId = CreateIntroMaySprite(DISPLAY_WIDTH + 32, 46);
+ gTasks[taskId].tRivalSpriteId = spriteId;
+ gSprites[spriteId].callback = SpriteCB_Rival;
+ gSprites[spriteId].anims = sAnims_Rival;
}
else
{
- LoadCompressedSpriteSheet(gUnknown_085F5344);
- LoadCompressedSpriteSheet(gUnknown_085F53AC);
- LoadCompressedSpriteSheet(gUnknown_085F5354);
- LoadSpritePalettes(gUnknown_085F5384);
-
- spriteId = intro_create_may_sprite(120, 46);
- gTasks[taskIdA].data[TDA_PLAYER_CYCLIST] = spriteId;
- gSprites[spriteId].callback = sub_8176EE8;
- gSprites[spriteId].anims = gUnknown_085E6FD0;
-
- spriteId = intro_create_brendan_sprite(272, 46);
- gTasks[taskIdA].data[TDA_RIVAL_CYCLIST] = spriteId;
- gSprites[spriteId].callback = sub_8176F90;
- gSprites[spriteId].anims = gUnknown_085E7010;
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsMay);
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsRivalBrendan);
+ LoadCompressedSpriteSheet(gSpriteSheet_CreditsBicycle);
+ LoadSpritePalettes(gSpritePalettes_Credits);
+
+ spriteId = CreateIntroMaySprite(120, 46);
+ gTasks[taskId].tPlayerSpriteId = spriteId;
+ gSprites[spriteId].callback = SpriteCB_Player;
+ gSprites[spriteId].anims = sAnims_Player;
+
+ spriteId = CreateIntroBrendanSprite(DISPLAY_WIDTH + 32, 46);
+ gTasks[taskId].tRivalSpriteId = spriteId;
+ gSprites[spriteId].callback = SpriteCB_Rival;
+ gSprites[spriteId].anims = sAnims_Rival;
};
- gMain.state += 1;
+ gMain.state++;
break;
case 3:
- sub_817664C(data, taskIdA);
- sub_817B3A8(data);
+ SetBikeScene(scene, taskId);
+ SetCreditsSceneBgCnt(scene);
gMain.state = 0;
return TRUE;
}
return FALSE;
}
-static void ResetCreditsTasks(u8 taskIdA)
+static void ResetCreditsTasks(u8 taskId)
{
- if (gTasks[taskIdA].data[TDA_0] != 0)
+ // Destroy Task_BicycleBgAnimation, if running
+ if (gTasks[taskId].tTaskId_BgScenery != 0)
{
- DestroyTask(gTasks[taskIdA].data[TDA_0]);
- gTasks[taskIdA].data[TDA_0] = 0;
+ DestroyTask(gTasks[taskId].tTaskId_BgScenery);
+ gTasks[taskId].tTaskId_BgScenery = 0;
}
- if (gTasks[taskIdA].data[TDA_TASK_C_ID] != 0)
+ // Destroy Task_BikeScene, if running
+ if (gTasks[taskId].tTaskId_BikeScene != 0)
{
- DestroyTask(gTasks[taskIdA].data[TDA_TASK_C_ID]);
- gTasks[taskIdA].data[TDA_TASK_C_ID] = 0;
+ DestroyTask(gTasks[taskId].tTaskId_BikeScene);
+ gTasks[taskId].tTaskId_BikeScene = 0;
}
- if (gTasks[taskIdA].data[TDA_TASK_E_ID] != 0)
+ // Destroy Task_CycleSceneryPalette, if running
+ if (gTasks[taskId].tTaskId_SceneryPal != 0)
{
- DestroyTask(gTasks[taskIdA].data[TDA_TASK_E_ID]);
- gTasks[taskIdA].data[TDA_TASK_E_ID] = 0;
+ DestroyTask(gTasks[taskId].tTaskId_SceneryPal);
+ gTasks[taskId].tTaskId_SceneryPal = 0;
}
- if (gTasks[taskIdA].data[TDA_TASK_D_ID] != 0)
+ // Destroy Task_ShowMons, if running
+ if (gTasks[taskId].tTaskId_ShowMons != 0)
{
- DestroyTask(gTasks[taskIdA].data[TDA_TASK_D_ID]);
- gTasks[taskIdA].data[TDA_TASK_D_ID] = 0;
+ DestroyTask(gTasks[taskId].tTaskId_ShowMons);
+ gTasks[taskId].tTaskId_ShowMons = 0;
}
- gUnknown_0203BD28 = 1;
+ gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_DESTROY;
}
-static void LoadTheEndScreen(u16 arg0, u16 arg1, u16 arg2)
+static void LoadTheEndScreen(u16 arg0, u16 arg1, u16 palOffset)
{
u16 baseTile;
u16 i;
- LZ77UnCompVram(gCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0));
- LoadPalette(gIntroCopyright_Pal, arg2, sizeof(gIntroCopyright_Pal));
+ LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0));
+ LoadPalette(gIntroCopyright_Pal, palOffset, sizeof(gIntroCopyright_Pal));
- baseTile = (arg2 / 16) << 12;
+ baseTile = (palOffset / 16) << 12;
for (i = 0; i < 32 * 32; i++)
((u16 *) (VRAM + arg1))[i] = baseTile + 1;
}
-static u16 sub_8176D78(u8 arg0)
+static u16 GetLetterMapTile(u8 baseTiles)
{
- u16 out = (arg0 & 0x3F) + 80;
+ u16 out = (baseTiles & 0x3F) + 80;
- if (arg0 == 0xFF)
+ if (baseTiles == 0xFF)
return 1;
- if (arg0 & (1 << 7))
+ if (baseTiles & (1 << 7))
out |= 1 << 11;
- if (arg0 & (1 << 6))
+ if (baseTiles & (1 << 6))
out |= 1 << 10;
return out;
}
-static void sub_8176DBC(const u8 arg0[], u8 baseX, u8 baseY, u16 arg3, u16 palette)
+static void DrawLetterMapTiles(const u8 baseTiles[], u8 baseX, u8 baseY, u16 offset, u16 palette)
{
u8 y, x;
const u16 tileOffset = (palette / 16) << 12;
@@ -2073,35 +1322,37 @@ static void sub_8176DBC(const u8 arg0[], u8 baseX, u8 baseY, u16 arg3, u16 palet
for (y = 0; y < 5; y++)
{
for (x = 0; x < 3; x++)
- ((u16 *) (VRAM + arg3 + (baseY + y) * 64))[baseX + x] = tileOffset + sub_8176D78(arg0[y * 3 + x]);
+ ((u16 *) (VRAM + offset + (baseY + y) * 64))[baseX + x] = tileOffset + GetLetterMapTile(baseTiles[y * 3 + x]);
}
}
-static void sub_8176E40(u16 arg0, u16 palette)
+static void DrawTheEnd(u16 offset, u16 palette)
{
u16 pos;
u16 baseTile = (palette / 16) << 12;
for (pos = 0; pos < 32 * 32; pos++)
- ((u16 *) (VRAM + arg0))[pos] = baseTile + 1;
-
- sub_8176DBC(sTheEnd_LetterTMap, 3, 7, arg0, palette);
- sub_8176DBC(sTheEnd_LetterHMap, 7, 7, arg0, palette);
- sub_8176DBC(sTheEnd_LetterEMap, 11, 7, arg0, palette);
- sub_8176DBC(sTheEnd_LetterEMap, 16, 7, arg0, palette);
- sub_8176DBC(sTheEnd_LetterNMap, 20, 7, arg0, palette);
- sub_8176DBC(sTheEnd_LetterDMap, 24, 7, arg0, palette);
+ ((u16 *) (VRAM + offset))[pos] = baseTile + 1;
+
+ DrawLetterMapTiles(sTheEnd_LetterMap_T, 3, 7, offset, palette);
+ DrawLetterMapTiles(sTheEnd_LetterMap_H, 7, 7, offset, palette);
+ DrawLetterMapTiles(sTheEnd_LetterMap_E, 11, 7, offset, palette);
+ DrawLetterMapTiles(sTheEnd_LetterMap_E, 16, 7, offset, palette);
+ DrawLetterMapTiles(sTheEnd_LetterMap_N, 20, 7, offset, palette);
+ DrawLetterMapTiles(sTheEnd_LetterMap_D, 24, 7, offset, palette);
}
-static void sub_8176EE8(struct Sprite *sprite)
+#define sState data[0]
+
+static void SpriteCB_Player(struct Sprite *sprite)
{
- if (gUnknown_0203BD28 != 0)
+ if (gIntroCredits_MovingSceneryState != INTROCRED_SCENERY_NORMAL)
{
DestroySprite(sprite);
return;
}
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
StartSpriteAnimIfDifferent(sprite, 0);
@@ -2109,7 +1360,7 @@ static void sub_8176EE8(struct Sprite *sprite)
case 1:
StartSpriteAnimIfDifferent(sprite, 1);
if (sprite->pos1.x > -32)
- sprite->pos1.x -= 1;
+ sprite->pos1.x--;
break;
case 2:
StartSpriteAnimIfDifferent(sprite, 2);
@@ -2120,25 +1371,25 @@ static void sub_8176EE8(struct Sprite *sprite)
case 4:
StartSpriteAnimIfDifferent(sprite, 0);
if (sprite->pos1.x > 120)
- sprite->pos1.x -= 1;
+ sprite->pos1.x--;
break;
case 5:
StartSpriteAnimIfDifferent(sprite, 0);
if (sprite->pos1.x > -32)
- sprite->pos1.x -= 1;
+ sprite->pos1.x--;
break;
}
}
-static void sub_8176F90(struct Sprite *sprite)
+static void SpriteCB_Rival(struct Sprite *sprite)
{
- if (gUnknown_0203BD28 != 0)
+ if (gIntroCredits_MovingSceneryState != INTROCRED_SCENERY_NORMAL)
{
DestroySprite(sprite);
return;
}
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
sprite->pos2.y = 0;
@@ -2151,64 +1402,67 @@ static void sub_8176F90(struct Sprite *sprite)
StartSpriteAnimIfDifferent(sprite, 2);
if (sprite->pos1.x > -32)
sprite->pos1.x -= 2;
- sprite->pos2.y = -gUnknown_0203BD26;
+ sprite->pos2.y = -gIntroCredits_MovingSceneryVOffset;
break;
case 2:
- sprite->data[7] += 1;
+ sprite->data[7]++;
StartSpriteAnimIfDifferent(sprite, 0);
if ((sprite->data[7] & 3) == 0)
- sprite->pos1.x += 1;
+ sprite->pos1.x++;
break;
case 3:
StartSpriteAnimIfDifferent(sprite, 0);
if (sprite->pos1.x > -32)
- sprite->pos1.x -= 1;
+ sprite->pos1.x--;
break;
}
}
-static void sub_8177050(struct Sprite *sprite)
+#define sPosition data[1]
+#define sSpriteId data[6]
+
+static void SpriteCB_CreditsMon(struct Sprite *sprite)
{
- if (gUnknown_0203BD28)
+ if (gIntroCredits_MovingSceneryState != INTROCRED_SCENERY_NORMAL)
{
- FreeAndDestroyMonPicSprite(sprite->data[6]);
+ FreeAndDestroyMonPicSprite(sprite->sSpriteId);
return;
}
- sprite->data[7] += 1;
- switch (sprite->data[0])
+ sprite->data[7]++;
+ switch (sprite->sState)
{
case 0:
default:
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
- sprite->oam.matrixNum = sprite->data[1];
+ sprite->oam.matrixNum = sprite->sPosition;
sprite->data[2] = 16;
- SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]);
+ SetOamMatrix(sprite->sPosition, 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]);
sprite->invisible = FALSE;
- sprite->data[0] = 1;
+ sprite->sState = 1;
break;
case 1:
if (sprite->data[2] < 256)
{
sprite->data[2] += 8;
- SetOamMatrix(sprite->data[1], 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]);
+ SetOamMatrix(sprite->sPosition, 0x10000 / sprite->data[2], 0, 0, 0x10000 / sprite->data[2]);
}
else
{
- sprite->data[0] += 1;
+ sprite->sState++;
}
- switch (sprite->data[1])
+ switch (sprite->sPosition)
{
- case 1:
+ case POS_LEFT + 1:
if ((sprite->data[7] & 3) == 0)
- sprite->pos1.y += 1;
+ sprite->pos1.y++;
sprite->pos1.x -= 2;
break;
- case 2:
+ case POS_CENTER + 1:
break;
- case 3:
+ case POS_RIGHT + 1:
if ((sprite->data[7] & 3) == 0)
- sprite->pos1.y += 1;
+ sprite->pos1.y++;
sprite->pos1.x += 2;
break;
}
@@ -2216,7 +1470,7 @@ static void sub_8177050(struct Sprite *sprite)
case 2:
if (sprite->data[3] != 0)
{
- sprite->data[3] -= 1;
+ sprite->data[3]--;
}
else
{
@@ -2224,7 +1478,7 @@ static void sub_8177050(struct Sprite *sprite)
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
sprite->oam.objMode = ST_OAM_OBJ_BLEND;
sprite->data[3] = 16;
- sprite->data[0] += 1;
+ sprite->sState++;
}
break;
case 3:
@@ -2232,7 +1486,7 @@ static void sub_8177050(struct Sprite *sprite)
{
int data3;
- sprite->data[3] -= 1;
+ sprite->data[3]--;
data3 = 16 - sprite->data[3];
SetGpuReg(REG_OFFSET_BLDALPHA, (data3 << 8) + sprite->data[3]);
@@ -2240,11 +1494,11 @@ static void sub_8177050(struct Sprite *sprite)
else
{
sprite->invisible = TRUE;
- sprite->data[0] = 9;
+ sprite->sState = 9;
}
break;
case 9:
- sprite->data[0] += 1;
+ sprite->sState++;
break;
case 10:
SetGpuReg(REG_OFFSET_BLDCNT, 0);
@@ -2254,40 +1508,44 @@ static void sub_8177050(struct Sprite *sprite)
}
}
-static u8 MakeMonSprite(u16 nationalDexNum, s16 x, s16 y, u16 position)
+#define sMonSpriteId data[0]
+
+static u8 CreateCreditsMonSprite(u16 nationalDexNum, s16 x, s16 y, u16 position)
{
- u8 spriteId;
- u8 spriteId2;
+ u8 monSpriteId;
+ u8 bgSpriteId;
- spriteId = CreateMonSpriteFromNationalDexNumber(nationalDexNum, x, y, position);
- gSprites[spriteId].oam.priority = 1;
- gSprites[spriteId].data[1] = position + 1;
- gSprites[spriteId].invisible = TRUE;
- gSprites[spriteId].callback = sub_8177050;
- gSprites[spriteId].data[6] = spriteId;
+ monSpriteId = CreateMonSpriteFromNationalDexNumber(nationalDexNum, x, y, position);
+ gSprites[monSpriteId].oam.priority = 1;
+ gSprites[monSpriteId].sPosition = position + 1;
+ gSprites[monSpriteId].invisible = TRUE;
+ gSprites[monSpriteId].callback = SpriteCB_CreditsMon;
+ gSprites[monSpriteId].sSpriteId = monSpriteId;
- spriteId2 = CreateSprite(&gUnknown_085E7068, gSprites[spriteId].pos1.x, gSprites[spriteId].pos1.y, 1);
- gSprites[spriteId2].data[0] = spriteId;
+ bgSpriteId = CreateSprite(&sSpriteTemplate_CreditsMonBg, gSprites[monSpriteId].pos1.x, gSprites[monSpriteId].pos1.y, 1);
+ gSprites[bgSpriteId].sMonSpriteId = monSpriteId;
- StartSpriteAnimIfDifferent(&gSprites[spriteId2], position);
+ StartSpriteAnimIfDifferent(&gSprites[bgSpriteId], position);
- return spriteId;
+ return monSpriteId;
}
-static void sub_81772B8(struct Sprite *sprite)
+static void SpriteCB_CreditsMonBg(struct Sprite *sprite)
{
- if (gSprites[sprite->data[0]].data[0] == 10 || gUnknown_0203BD28)
+ if (gSprites[sprite->sMonSpriteId].data[0] == 10
+ || gIntroCredits_MovingSceneryState != INTROCRED_SCENERY_NORMAL)
{
DestroySprite(sprite);
return;
}
- sprite->invisible = gSprites[sprite->data[0]].invisible;
- sprite->oam.objMode = gSprites[sprite->data[0]].oam.objMode;
- sprite->oam.affineMode = gSprites[sprite->data[0]].oam.affineMode;
- sprite->oam.matrixNum = gSprites[sprite->data[0]].oam.matrixNum;
- sprite->pos1.x = gSprites[sprite->data[0]].pos1.x;
- sprite->pos1.y = gSprites[sprite->data[0]].pos1.y;
+ // Copy sprite data from the associated Pokémon
+ sprite->invisible = gSprites[sprite->sMonSpriteId].invisible;
+ sprite->oam.objMode = gSprites[sprite->sMonSpriteId].oam.objMode;
+ sprite->oam.affineMode = gSprites[sprite->sMonSpriteId].oam.affineMode;
+ sprite->oam.matrixNum = gSprites[sprite->sMonSpriteId].oam.matrixNum;
+ sprite->pos1.x = gSprites[sprite->sMonSpriteId].pos1.x;
+ sprite->pos1.y = gSprites[sprite->sMonSpriteId].pos1.y;
}
static void DeterminePokemonToShow(void)
@@ -2310,7 +1568,7 @@ static void DeterminePokemonToShow(void)
// Fill the rest of the array with zeroes
for (dexNum = j; dexNum < NATIONAL_DEX_COUNT; dexNum++)
- sCreditsData->caughtMonIds[dexNum] = 0;
+ sCreditsData->caughtMonIds[dexNum] = NATIONAL_DEX_NONE;
// Cap the number of pokemon we care about to NUM_MON_SLIDES, the max we show in the credits scene (-1 for the starter)
sCreditsData->numCaughtMon = j;
@@ -2352,7 +1610,7 @@ static void DeterminePokemonToShow(void)
page = 0;
}
// Ensure the last pokemon is our starter
- sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
+ sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
}
else
{
@@ -2363,12 +1621,12 @@ static void DeterminePokemonToShow(void)
if (dexNum < sCreditsData->numMonToShow - 1)
{
sCreditsData->monToShow[dexNum] = sCreditsData->monToShow[NUM_MON_SLIDES-1];
- sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
+ sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
}
else
{
// Ensure the last pokemon is our starter
- sCreditsData->monToShow[NUM_MON_SLIDES-1] = starter;
+ sCreditsData->monToShow[NUM_MON_SLIDES - 1] = starter;
}
}
sCreditsData->numMonToShow = NUM_MON_SLIDES;
diff --git a/src/data.c b/src/data.c
index 6a4295440..30672f7c4 100644
--- a/src/data.c
+++ b/src/data.c
@@ -12,36 +12,38 @@ const u16 gMinigameDigits_Pal[] = INCBIN_U16("graphics/link/minigame_digits.gbap
const u32 gMinigameDigits_Gfx[] = INCBIN_U32("graphics/link/minigame_digits.4bpp.lz");
static const u32 sMinigameDigitsThin_Gfx[] = INCBIN_U32("graphics/link/minigame_digits2.4bpp.lz"); // Unused
+#define BATTLER_OFFSET(i) (gHeap + 0x8000 + MON_PIC_SIZE * (i))
+
const struct SpriteFrameImage gBattlerPicTable_PlayerLeft[] =
{
- gHeap + 0x8000, 0x800,
- gHeap + 0x8800, 0x800,
- gHeap + 0x9000, 0x800,
- gHeap + 0x9800, 0x800,
+ BATTLER_OFFSET(0), MON_PIC_SIZE,
+ BATTLER_OFFSET(1), MON_PIC_SIZE,
+ BATTLER_OFFSET(2), MON_PIC_SIZE,
+ BATTLER_OFFSET(3), MON_PIC_SIZE,
};
const struct SpriteFrameImage gBattlerPicTable_OpponentLeft[] =
{
- gHeap + 0xA000, 0x800,
- gHeap + 0xA800, 0x800,
- gHeap + 0xB000, 0x800,
- gHeap + 0xB800, 0x800,
+ BATTLER_OFFSET(4), MON_PIC_SIZE,
+ BATTLER_OFFSET(5), MON_PIC_SIZE,
+ BATTLER_OFFSET(6), MON_PIC_SIZE,
+ BATTLER_OFFSET(7), MON_PIC_SIZE,
};
const struct SpriteFrameImage gBattlerPicTable_PlayerRight[] =
{
- gHeap + 0xC000, 0x800,
- gHeap + 0xC800, 0x800,
- gHeap + 0xD000, 0x800,
- gHeap + 0xD800, 0x800,
+ BATTLER_OFFSET(8), MON_PIC_SIZE,
+ BATTLER_OFFSET(9), MON_PIC_SIZE,
+ BATTLER_OFFSET(10), MON_PIC_SIZE,
+ BATTLER_OFFSET(11), MON_PIC_SIZE,
};
const struct SpriteFrameImage gBattlerPicTable_OpponentRight[] =
{
- gHeap + 0xE000, 0x800,
- gHeap + 0xE800, 0x800,
- gHeap + 0xF000, 0x800,
- gHeap + 0xF800, 0x800,
+ BATTLER_OFFSET(12), MON_PIC_SIZE,
+ BATTLER_OFFSET(13), MON_PIC_SIZE,
+ BATTLER_OFFSET(14), MON_PIC_SIZE,
+ BATTLER_OFFSET(15), MON_PIC_SIZE,
};
const struct SpriteFrameImage gTrainerBackPicTable_Brendan[] =
@@ -290,7 +292,7 @@ const union AnimCmd *const gUnknown_082FF70C[] =
gUnknown_082FF704,
};
-#define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, 0x800, SPECIES_##species}
+#define SPECIES_SPRITE(species, sprite) [SPECIES_##species] = {sprite, MON_PIC_SIZE, SPECIES_##species}
#define SPECIES_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species}
#define SPECIES_SHINY_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species + SPECIES_SHINY_TAG}
diff --git a/src/data/credits.h b/src/data/credits.h
new file mode 100644
index 000000000..3ae2b1d3b
--- /dev/null
+++ b/src/data/credits.h
@@ -0,0 +1,787 @@
+enum
+{
+ PAGE_TITLE,
+ PAGE_DIRECTOR,
+ PAGE_ART_DIRECTOR,
+ PAGE_WORLD_DIRECTOR,
+ PAGE_LEAD_PROGRAMMER,
+ PAGE_PROGRAMMERS_1,
+ PAGE_PROGRAMMERS_2,
+ PAGE_PROGRAMMERS_3,
+ PAGE_PROGRAMMERS_4,
+ PAGE_GRAPHIC_DESIGNERS_1,
+ PAGE_GRAPHIC_DESIGNERS_2,
+ PAGE_GRAPHIC_DESIGNERS_3,
+ PAGE_MUSIC_COMPOSITION,
+ PAGE_SOUND_EFFECTS,
+ PAGE_GAME_DESIGNERS_1,
+ PAGE_GAME_DESIGNERS_2,
+ PAGE_GAME_DESIGNERS_3,
+ PAGE_SCENARIO_PLOT,
+ PAGE_SCENARIO,
+ PAGE_SCRIPT_DESIGNERS,
+ PAGE_MAP_DESIGNERS,
+ PAGE_BATTLE_FRONTIER_DATA,
+ PAGE_PARAMETRIC_DESIGNERS,
+ PAGE_POKEDEX_TEXT,
+ PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_1,
+ PAGE_PKMN_DESIGNERS_1,
+ PAGE_PKMN_DESIGNERS_2,
+ PAGE_PKMN_DESIGNERS_3,
+ PAGE_PKMN_DESIGNERS_4,
+ PAGE_SUPPORT_PROGRAMMERS,
+ PAGE_NCL_PRODUCT_TESTING,
+ PAGE_PACKAGE_AND_MANUAL,
+ PAGE_SPECIAL_THANKS_1,
+ PAGE_SPECIAL_THANKS_2,
+ PAGE_SPECIAL_THANKS_3,
+ PAGE_SPECIAL_THANKS_4,
+ PAGE_INFORMATION_SUPERVISORS,
+ PAGE_ARTWORK_1,
+ PAGE_ARTWORK_2,
+ PAGE_ARTWORK_3,
+ PAGE_COORDINATORS,
+ PAGE_ENGLISH_VERSION,
+ PAGE_TRANSLATOR,
+ PAGE_TEXT_EDITOR,
+ PAGE_NCL_COORDINATOR,
+ PAGE_PROGRAMMERS_5,
+ PAGE_GRAPHIC_DESIGNER,
+ PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_2,
+ PAGE_NOA_TESTING,
+ PAGE_BRAILLE_CODE_CHECK_1,
+ PAGE_BRAILLE_CODE_CHECK_2,
+ PAGE_SPECIAL_THANKS_5,
+ PAGE_TASK_MANAGERS,
+ PAGE_PRODUCERS,
+ PAGE_EXECUTIVE_DIRECTOR,
+ PAGE_EXECUTIVE_PRODUCERS_1,
+ PAGE_EXECUTIVE_PRODUCERS_2,
+ PAGE_COUNT
+};
+
+#define ENTRIES_PER_PAGE 5
+
+static const u8 sCreditsText_EmptyString[] = _("");
+static const u8 sCreditsText_PkmnEmeraldVersion[] = _("POKéMON EMERALD VERSION");
+static const u8 sCreditsText_Credits[] = _("Credits");
+static const u8 sCreditsText_ExecutiveDirector[] = _("Executive Director");
+static const u8 sCreditsText_Director[] = _("Director");
+static const u8 sCreditsText_ArtDirector[] = _("Art Director");
+static const u8 sCreditsText_BattleDirector[] = _("Battle Director");
+static const u8 sCreditsText_MainProgrammer[] = _("Main Programmer");
+static const u8 sCreditsText_BattleSystemPgrms[] = _("Battle System Programmers");
+static const u8 sCreditsText_FieldSystemPgrms[] = _("Field System Programmer");
+static const u8 sCreditsText_Programmers[] = _("Programmers");
+static const u8 sCreditsText_MainGraphicDesigner[] = _("Main Graphic Designer");
+static const u8 sCreditsText_GraphicDesigners[] = _("Graphic Designers");
+static const u8 sCreditsText_PkmnDesigners[] = _("POKéMON Designers");
+static const u8 sCreditsText_MusicComposition[] = _("Music Composition");
+static const u8 sCreditsText_SoundEffectsAndPkmnVoices[] = _("Sound Effects & POKéMON Voices");
+static const u8 sCreditsText_GameDesigners[] = _("Game Designers");
+static const u8 sCreditsText_ScenarioPlot[] = _("Scenario Plot");
+static const u8 sCreditsText_Scenario[] = _("Scenario");
+static const u8 sCreditsText_ScriptDesigners[] = _("Script Designers");
+static const u8 sCreditsText_MapDesigners[] = _("Map Designers");
+static const u8 sCreditsText_MapDataDesigners[] = _("Map Data Designers");
+static const u8 sCreditsText_ParametricDesigners[] = _("Parametric Designers");
+static const u8 sCreditsText_PokedexText[] = _("POKéDEX Text");
+static const u8 sCreditsText_EnvAndToolPgrms[] = _("Environment & Tool Programmers");
+static const u8 sCreditsText_NCLProductTesting[] = _("NCL Product Testing");
+static const u8 sCreditsText_SpecialThanks[] = _("Special Thanks");
+static const u8 sCreditsText_Coordinators[] = _("Coordinators");
+static const u8 sCreditsText_Producers[] = _("Producers");
+static const u8 sCreditsText_ExecProducers[] = _("Executive Producers");
+static const u8 sCreditsText_InfoSupervisors[] = _("Information Supervisors");
+static const u8 sCreditsText_TaskManagers[] = _("Task Managers");
+static const u8 sCreditsText_BrailleCodeCheck[] = _("Braille Code Check");
+static const u8 sCreditsText_WorldDirector[] = _("World Director");
+static const u8 sCreditsText_BattleFrontierData[] = _("Battle Frontier Data");
+static const u8 sCreditsText_SupportProgrammers[] = _("Support Programmers");
+static const u8 sCreditsText_Artwork[] = _("Artwork");
+static const u8 sCreditsText_LeadProgrammer[] = _("Lead Programmer");
+static const u8 sCreditsText_LeadGraphicArtist[] = _("Lead Graphic Artist");
+static const u8 sCreditsText_SatoshiTajiri[] = _("Satoshi Tajiri");
+static const u8 sCreditsText_JunichiMasuda[] = _("Junichi Masuda");
+static const u8 sCreditsText_KenSugimori[] = _("Ken Sugimori");
+static const u8 sCreditsText_ShigekiMorimoto[] = _("Shigeki Morimoto");
+static const u8 sCreditsText_TetsuyaWatanabe[] = _("Tetsuya Watanabe");
+static const u8 sCreditsText_HisashiSogabe[] = _("Hisashi Sogabe");
+static const u8 sCreditsText_SosukeTamada[] = _("Sosuke Tamada");
+static const u8 sCreditsText_AkitoMori[] = _("Akito Mori");
+static const u8 sCreditsText_KeitaKagaya[] = _("Keita Kagaya");
+static const u8 sCreditsText_YoshinoriMatsuda[] = _("Yoshinori Matsuda");
+static const u8 sCreditsText_HiroyukiNakamura[] = _("Hiroyuki Nakamura");
+static const u8 sCreditsText_MasaoTaya[] = _("Masao Taya");
+static const u8 sCreditsText_SatoshiNohara[] = _("Satoshi Nohara");
+static const u8 sCreditsText_TomomichiOhta[] = _("Tomomichi Ohta");
+static const u8 sCreditsText_MiyukiIwasawa[] = _("Miyuki Iwasawa");
+static const u8 sCreditsText_TakenoriOhta[] = _("Takenori Ohta");
+static const u8 sCreditsText_HironobuYoshida[] = _("Hironobu Yoshida");
+static const u8 sCreditsText_MotofumiFujiwara[] = _("Motofumi Fujiwara");
+static const u8 sCreditsText_SatoshiOhta[] = _("Satoshi Ohta");
+static const u8 sCreditsText_AsukaIwashita[] = _("Asuka Iwashita");
+static const u8 sCreditsText_AimiTomita[] = _("Aimi Tomita");
+static const u8 sCreditsText_TakaoUnno[] = _("Takao Unno");
+static const u8 sCreditsText_KanakoEo[] = _("Kanako Eo");
+static const u8 sCreditsText_JunOkutani[] = _("Jun Okutani");
+static const u8 sCreditsText_AtsukoNishida[] = _("Atsuko Nishida");
+static const u8 sCreditsText_MuneoSaito[] = _("Muneo Saito");
+static const u8 sCreditsText_RenaYoshikawa[] = _("Rena Yoshikawa");
+static const u8 sCreditsText_GoIchinose[] = _("Go Ichinose");
+static const u8 sCreditsText_MorikazuAoki[] = _("Morikazu Aoki");
+static const u8 sCreditsText_KojiNishino[] = _("Koji Nishino");
+static const u8 sCreditsText_KenjiMatsushima[] = _("Kenji Matsushima");
+static const u8 sCreditsText_TetsujiOhta[] = _("Tetsuji Ohta");
+static const u8 sCreditsText_HitomiSato[] = _("Hitomi Sato");
+static const u8 sCreditsText_TakeshiKawachimaru[] = _("Takeshi Kawachimaru");
+static const u8 sCreditsText_TeruyukiShimoyamada[] = _("Teruyuki Shimoyamada");
+static const u8 sCreditsText_ShigeruOhmori[] = _("Shigeru Ohmori");
+static const u8 sCreditsText_TadashiTakahashi[] = _("Tadashi Takahashi");
+static const u8 sCreditsText_ToshinobuMatsumiya[] = _("Toshinobu Matsumiya");
+static const u8 sCreditsText_AkihitoTomisawa[] = _("Akihito Tomisawa");
+static const u8 sCreditsText_HirokiEnomoto[] = _("Hiroki Enomoto");
+static const u8 sCreditsText_KazuyukiTerada[] = _("Kazuyuki Terada");
+static const u8 sCreditsText_YuriSakurai[] = _("Yuri Sakurai");
+static const u8 sCreditsText_HiromiSagawa[] = _("Hiromi Sagawa");
+static const u8 sCreditsText_KenjiTominaga[] = _("Kenji Tominaga");
+static const u8 sCreditsText_YoshioTajiri[] = _("Yoshio Tajiri");
+static const u8 sCreditsText_TeikoSasaki[] = _("Teiko Sasaki");
+static const u8 sCreditsText_SachikoHamano[] = _("Sachiko Hamano");
+static const u8 sCreditsText_ChieMatsumiya[] = _("Chie Matsumiya");
+static const u8 sCreditsText_AkikoShinozaki[] = _("Akiko Shinozaki");
+static const u8 sCreditsText_AstukoFujii[] = _("Astuko Fujii");
+static const u8 sCreditsText_NozomuSaito[] = _("Nozomu Saito");
+static const u8 sCreditsText_KenkichiToyama[] = _("Kenkichi Toyama");
+static const u8 sCreditsText_SuguruNakatsui[] = _("Suguru Nakatsui");
+static const u8 sCreditsText_YumiFunasaka[] = _("Yumi Funasaka");
+static const u8 sCreditsText_NaokoYanase[] = _("Naoko Yanase");
+static const u8 sCreditsText_NCLSuperMarioClub[] = _("NCL Super Mario Club");
+static const u8 sCreditsText_AtsushiTada[] = _("Atsushi Tada");
+static const u8 sCreditsText_TakahiroOhnishi[] = _("Takahiro Ohnishi");
+static const u8 sCreditsText_NorihideOkamura[] = _("Norihide Okamura");
+static const u8 sCreditsText_HiroNakamura[] = _("Hiro Nakamura");
+static const u8 sCreditsText_HiroyukiUesugi[] = _("Hiroyuki Uesugi");
+static const u8 sCreditsText_TerukiMurakawa[] = _("Teruki Murakawa");
+static const u8 sCreditsText_AkiraKinashi[] = _("Akira Kinashi");
+static const u8 sCreditsText_MichikoTakizawa[] = _("Michiko Takizawa");
+static const u8 sCreditsText_MakikoTakada[] = _("Makiko Takada");
+static const u8 sCreditsText_TakanaoKondo[] = _("Takanao Kondo");
+static const u8 sCreditsText_AiMashima[] = _("Ai Mashima");
+static const u8 sCreditsText_GakujiNomoto[] = _("Gakuji Nomoto");
+static const u8 sCreditsText_TakehiroIzushi[] = _("Takehiro Izushi");
+static const u8 sCreditsText_HitoshiYamagami[] = _("Hitoshi Yamagami");
+static const u8 sCreditsText_KyokoWatanabe[] = _("Kyoko Watanabe");
+static const u8 sCreditsText_TakaoNakano[] = _("Takao Nakano");
+static const u8 sCreditsText_HiroyukiJinnai[] = _("Hiroyuki Jinnai");
+static const u8 sCreditsText_HiroakiTsuru[] = _("Hiroaki Tsuru");
+static const u8 sCreditsText_TsunekazIshihara[] = _("Tsunekaz Ishihara");
+static const u8 sCreditsText_SatoruIwata[] = _("Satoru Iwata");
+static const u8 sCreditsText_KazuyaSuyama[] = _("Kazuya Suyama");
+static const u8 sCreditsText_SatoshiMitsuhara[] = _("Satoshi Mitsuhara");
+static const u8 sCreditsText_JapanBrailleLibrary[] = _("Japan Braille Library");
+static const u8 sCreditsText_TomotakaKomura[] = _("Tomotaka Komura");
+static const u8 sCreditsText_MikikoOhhashi[] = _("Mikiko Ohhashi");
+static const u8 sCreditsText_DaisukeHoshino[] = _("Daisuke Hoshino");
+static const u8 sCreditsText_KenjiroIto[] = _("Kenjiro Ito");
+static const u8 sCreditsText_RuiKawaguchi[] = _("Rui Kawaguchi");
+static const u8 sCreditsText_ShunsukeKohori[] = _("Shunsuke Kohori");
+static const u8 sCreditsText_SachikoNakamichi[] = _("Sachiko Nakamichi");
+static const u8 sCreditsText_FujikoNomura[] = _("Fujiko Nomura");
+static const u8 sCreditsText_KazukiYoshihara[] = _("Kazuki Yoshihara");
+static const u8 sCreditsText_RetsujiNomoto[] = _("Retsuji Nomoto");
+static const u8 sCreditsText_AzusaTajima[] = _("Azusa Tajima");
+static const u8 sCreditsText_ShusakuEgami[] = _("Shusaku Egami");
+static const u8 sCreditsText_PackageAndManual[] = _("Package & Manual Illustration");
+static const u8 sCreditsText_EnglishVersion[] = _("English Version Coordinators");
+static const u8 sCreditsText_Translator[] = _("Translator");
+static const u8 sCreditsText_TextEditor[] = _("Text Editor");
+static const u8 sCreditsText_NCLCoordinator[] = _("NCL Coordinator");
+static const u8 sCreditsText_GraphicDesigner[] = _("Graphic Designer");
+static const u8 sCreditsText_NOAProductTesting[] = _("NOA Product Testing");
+static const u8 sCreditsText_HideyukiNakajima[] = _("Hideyuki Nakajima");
+static const u8 sCreditsText_HidenoriSaeki[] = _("Hidenori Saeki");
+static const u8 sCreditsText_YokoWatanabe[] = _("Yoko Watanabe");
+static const u8 sCreditsText_SakaeKimura[] = _("Sakae Kimura");
+static const u8 sCreditsText_ChiakiShinkai[] = _("Chiaki Shinkai");
+static const u8 sCreditsText_SethMcMahill[] = _("Seth McMahill");
+static const u8 sCreditsText_NobOgasawara[] = _("Nob Ogasawara");
+static const u8 sCreditsText_TeresaLillygren[] = _("Teresa Lillygren");
+static const u8 sCreditsText_KimikoNakamichi[] = _("Kimiko Nakamichi");
+static const u8 sCreditsText_SouichiYamamoto[] = _("Souichi Yamamoto");
+static const u8 sCreditsText_YuichiroIto[] = _("Yuichiro Ito");
+static const u8 sCreditsText_ThomasHertzog[] = _("Thomas Hertzog");
+static const u8 sCreditsText_MikaKurosawa[] = _("Mika Kurosawa");
+static const u8 sCreditsText_NationalFederationBlind[] = _("National Federation of the Blind");
+static const u8 sCreditsText_PatriciaAMaurer[] = _("Patricia A. Maurer");
+static const u8 sCreditsText_EuropeanBlindUnion[] = _("European Blind Union");
+static const u8 sCreditsText_AustralianBrailleAuthority[] = _("Australian Braille Authority");
+static const u8 sCreditsText_RoyalNewZealandFederationBlind[] = _("Royal New Zealand Federation for the Blind");
+static const u8 sCreditsText_MotoyasuTojima[] = _("Motoyasu Tojima");
+static const u8 sCreditsText_NicolaPrattBarlow[] = _("Nicola Pratt-Barlow");
+static const u8 sCreditsText_ShellieDow[] = _("Shellie Dow");
+static const u8 sCreditsText_ErikJohnson[] = _("Erik Johnson");
+static const struct CreditsEntry sCreditsEntry_EmptyString[] = { 0, FALSE, sCreditsText_EmptyString};
+static const struct CreditsEntry sCreditsEntry_PkmnEmeraldVersion[] = { 7, TRUE, sCreditsText_PkmnEmeraldVersion};
+static const struct CreditsEntry sCreditsEntry_Credits[] = {11, TRUE, sCreditsText_Credits};
+static const struct CreditsEntry sCreditsEntry_ExecutiveDirector[] = { 8, TRUE, sCreditsText_ExecutiveDirector};
+static const struct CreditsEntry sCreditsEntry_Director[] = {12, TRUE, sCreditsText_Director};
+static const struct CreditsEntry sCreditsEntry_ArtDirector[] = {10, TRUE, sCreditsText_ArtDirector};
+static const struct CreditsEntry sCreditsEntry_BattleDirector[] = {10, TRUE, sCreditsText_BattleDirector};
+static const struct CreditsEntry sCreditsEntry_MainProgrammer[] = {10, TRUE, sCreditsText_MainProgrammer};
+static const struct CreditsEntry sCreditsEntry_BattleSystemPgrms[] = { 8, TRUE, sCreditsText_BattleSystemPgrms};
+static const struct CreditsEntry sCreditsEntry_FieldSystemPgrms[] = { 7, TRUE, sCreditsText_FieldSystemPgrms};
+static const struct CreditsEntry sCreditsEntry_Programmers[] = {12, TRUE, sCreditsText_Programmers};
+static const struct CreditsEntry sCreditsEntry_MainGraphicDesigner[] = { 7, TRUE, sCreditsText_MainGraphicDesigner};
+static const struct CreditsEntry sCreditsEntry_GraphicDesigners[] = { 9, TRUE, sCreditsText_GraphicDesigners};
+static const struct CreditsEntry sCreditsEntry_PkmnDesigners[] = {10, TRUE, sCreditsText_PkmnDesigners};
+static const struct CreditsEntry sCreditsEntry_MusicComposition[] = {13, TRUE, sCreditsText_MusicComposition};
+static const struct CreditsEntry sCreditsEntry_SoundEffectsAndPkmnVoices[] = { 4, TRUE, sCreditsText_SoundEffectsAndPkmnVoices};
+static const struct CreditsEntry sCreditsEntry_GameDesigners[] = {11, TRUE, sCreditsText_GameDesigners};
+static const struct CreditsEntry sCreditsEntry_ScenarioPlot[] = {11, TRUE, sCreditsText_ScenarioPlot};
+static const struct CreditsEntry sCreditsEntry_Scenario[] = {13, TRUE, sCreditsText_Scenario};
+static const struct CreditsEntry sCreditsEntry_ScriptDesigners[] = {10, TRUE, sCreditsText_ScriptDesigners};
+static const struct CreditsEntry sCreditsEntry_MapDesigners[] = {11, TRUE, sCreditsText_MapDesigners};
+static const struct CreditsEntry sCreditsEntry_MapDataDesigners[] = { 9, TRUE, sCreditsText_MapDataDesigners};
+static const struct CreditsEntry sCreditsEntry_ParametricDesigners[] = { 9, TRUE, sCreditsText_ParametricDesigners};
+static const struct CreditsEntry sCreditsEntry_PokedexText[] = {11, TRUE, sCreditsText_PokedexText};
+static const struct CreditsEntry sCreditsEntry_EnvAndToolPgrms[] = { 6, TRUE, sCreditsText_EnvAndToolPgrms};
+static const struct CreditsEntry sCreditsEntry_NCLProductTesting[] = {11, TRUE, sCreditsText_NCLProductTesting};
+static const struct CreditsEntry sCreditsEntry_SpecialThanks[] = {10, TRUE, sCreditsText_SpecialThanks};
+static const struct CreditsEntry sCreditsEntry_Coordinators[] = {11, TRUE, sCreditsText_Coordinators};
+static const struct CreditsEntry sCreditsEntry_Producers[] = {11, TRUE, sCreditsText_Producers};
+static const struct CreditsEntry sCreditsEntry_ExecProducers[] = { 7, TRUE, sCreditsText_ExecProducers};
+static const struct CreditsEntry sCreditsEntry_InfoSupervisors[] = {10, TRUE, sCreditsText_InfoSupervisors};
+static const struct CreditsEntry sCreditsEntry_TaskManagers[] = { 8, TRUE, sCreditsText_TaskManagers};
+static const struct CreditsEntry sCreditsEntry_BrailleCodeCheck[] = {10, TRUE, sCreditsText_BrailleCodeCheck};
+static const struct CreditsEntry sCreditsEntry_WorldDirector[] = {10, TRUE, sCreditsText_WorldDirector};
+static const struct CreditsEntry sCreditsEntry_BattleFrontierData[] = { 8, TRUE, sCreditsText_BattleFrontierData};
+static const struct CreditsEntry sCreditsEntry_SupportProgrammers[] = {10, TRUE, sCreditsText_SupportProgrammers};
+static const struct CreditsEntry sCreditsEntry_Artwork[] = {12, TRUE, sCreditsText_Artwork};
+static const struct CreditsEntry sCreditsEntry_LeadProgrammer[] = {10, TRUE, sCreditsText_LeadProgrammer};
+static const struct CreditsEntry sCreditsEntry_LeadGraphicArtist[] = { 9, TRUE, sCreditsText_LeadGraphicArtist};
+static const struct CreditsEntry sCreditsEntry_SatoshiTajiri[] = {11, FALSE, sCreditsText_SatoshiTajiri};
+static const struct CreditsEntry sCreditsEntry_JunichiMasuda[] = {11, FALSE, sCreditsText_JunichiMasuda};
+static const struct CreditsEntry sCreditsEntry_KenSugimori[] = {11, FALSE, sCreditsText_KenSugimori};
+static const struct CreditsEntry sCreditsEntry_ShigekiMorimoto[] = {11, FALSE, sCreditsText_ShigekiMorimoto};
+static const struct CreditsEntry sCreditsEntry_TetsuyaWatanabe[] = {11, FALSE, sCreditsText_TetsuyaWatanabe};
+static const struct CreditsEntry sCreditsEntry_HisashiSogabe[] = {11, FALSE, sCreditsText_HisashiSogabe};
+static const struct CreditsEntry sCreditsEntry_SosukeTamada[] = {11, FALSE, sCreditsText_SosukeTamada};
+static const struct CreditsEntry sCreditsEntry_AkitoMori[] = {11, FALSE, sCreditsText_AkitoMori};
+static const struct CreditsEntry sCreditsEntry_KeitaKagaya[] = {11, FALSE, sCreditsText_KeitaKagaya};
+static const struct CreditsEntry sCreditsEntry_YoshinoriMatsuda[] = {11, FALSE, sCreditsText_YoshinoriMatsuda};
+static const struct CreditsEntry sCreditsEntry_HiroyukiNakamura[] = {11, FALSE, sCreditsText_HiroyukiNakamura};
+static const struct CreditsEntry sCreditsEntry_MasaoTaya[] = {11, FALSE, sCreditsText_MasaoTaya};
+static const struct CreditsEntry sCreditsEntry_SatoshiNohara[] = {11, FALSE, sCreditsText_SatoshiNohara};
+static const struct CreditsEntry sCreditsEntry_TomomichiOhta[] = {11, FALSE, sCreditsText_TomomichiOhta};
+static const struct CreditsEntry sCreditsEntry_MiyukiIwasawa[] = {11, FALSE, sCreditsText_MiyukiIwasawa};
+static const struct CreditsEntry sCreditsEntry_TakenoriOhta[] = {11, FALSE, sCreditsText_TakenoriOhta};
+static const struct CreditsEntry sCreditsEntry_HironobuYoshida[] = {11, FALSE, sCreditsText_HironobuYoshida};
+static const struct CreditsEntry sCreditsEntry_MotofumiFujiwara[] = {11, FALSE, sCreditsText_MotofumiFujiwara};
+static const struct CreditsEntry sCreditsEntry_SatoshiOhta[] = {11, FALSE, sCreditsText_SatoshiOhta};
+static const struct CreditsEntry sCreditsEntry_AsukaIwashita[] = {11, FALSE, sCreditsText_AsukaIwashita};
+static const struct CreditsEntry sCreditsEntry_AimiTomita[] = {11, FALSE, sCreditsText_AimiTomita};
+static const struct CreditsEntry sCreditsEntry_TakaoUnno[] = {11, FALSE, sCreditsText_TakaoUnno};
+static const struct CreditsEntry sCreditsEntry_KanakoEo[] = {11, FALSE, sCreditsText_KanakoEo};
+static const struct CreditsEntry sCreditsEntry_JunOkutani[] = {11, FALSE, sCreditsText_JunOkutani};
+static const struct CreditsEntry sCreditsEntry_AtsukoNishida[] = {11, FALSE, sCreditsText_AtsukoNishida};
+static const struct CreditsEntry sCreditsEntry_MuneoSaito[] = {11, FALSE, sCreditsText_MuneoSaito};
+static const struct CreditsEntry sCreditsEntry_RenaYoshikawa[] = {11, FALSE, sCreditsText_RenaYoshikawa};
+static const struct CreditsEntry sCreditsEntry_GoIchinose[] = {11, FALSE, sCreditsText_GoIchinose};
+static const struct CreditsEntry sCreditsEntry_MorikazuAoki[] = {11, FALSE, sCreditsText_MorikazuAoki};
+static const struct CreditsEntry sCreditsEntry_KojiNishino[] = {11, FALSE, sCreditsText_KojiNishino};
+static const struct CreditsEntry sCreditsEntry_KenjiMatsushima[] = {11, FALSE, sCreditsText_KenjiMatsushima};
+static const struct CreditsEntry sCreditsEntry_TetsujiOhta[] = {11, FALSE, sCreditsText_TetsujiOhta};
+static const struct CreditsEntry sCreditsEntry_HitomiSato[] = {11, FALSE, sCreditsText_HitomiSato};
+static const struct CreditsEntry sCreditsEntry_TakeshiKawachimaru[] = {11, FALSE, sCreditsText_TakeshiKawachimaru};
+static const struct CreditsEntry sCreditsEntry_TeruyukiShimoyamada[] = {11, FALSE, sCreditsText_TeruyukiShimoyamada};
+static const struct CreditsEntry sCreditsEntry_ShigeruOhmori[] = {11, FALSE, sCreditsText_ShigeruOhmori};
+static const struct CreditsEntry sCreditsEntry_TadashiTakahashi[] = {11, FALSE, sCreditsText_TadashiTakahashi};
+static const struct CreditsEntry sCreditsEntry_ToshinobuMatsumiya[] = {11, FALSE, sCreditsText_ToshinobuMatsumiya};
+static const struct CreditsEntry sCreditsEntry_AkihitoTomisawa[] = {11, FALSE, sCreditsText_AkihitoTomisawa};
+static const struct CreditsEntry sCreditsEntry_HirokiEnomoto[] = {11, FALSE, sCreditsText_HirokiEnomoto};
+static const struct CreditsEntry sCreditsEntry_KazuyukiTerada[] = {11, FALSE, sCreditsText_KazuyukiTerada};
+static const struct CreditsEntry sCreditsEntry_YuriSakurai[] = {11, FALSE, sCreditsText_YuriSakurai};
+static const struct CreditsEntry sCreditsEntry_HiromiSagawa[] = {11, FALSE, sCreditsText_HiromiSagawa};
+static const struct CreditsEntry sCreditsEntry_KenjiTominaga[] = {11, FALSE, sCreditsText_KenjiTominaga};
+static const struct CreditsEntry sCreditsEntry_YoshioTajiri[] = {11, FALSE, sCreditsText_YoshioTajiri};
+static const struct CreditsEntry sCreditsEntry_TeikoSasaki[] = {11, FALSE, sCreditsText_TeikoSasaki};
+static const struct CreditsEntry sCreditsEntry_SachikoHamano[] = {11, FALSE, sCreditsText_SachikoHamano};
+static const struct CreditsEntry sCreditsEntry_ChieMatsumiya[] = {11, FALSE, sCreditsText_ChieMatsumiya};
+static const struct CreditsEntry sCreditsEntry_AkikoShinozaki[] = {11, FALSE, sCreditsText_AkikoShinozaki};
+static const struct CreditsEntry sCreditsEntry_AstukoFujii[] = {11, FALSE, sCreditsText_AstukoFujii};
+static const struct CreditsEntry sCreditsEntry_NozomuSaito[] = {11, FALSE, sCreditsText_NozomuSaito};
+static const struct CreditsEntry sCreditsEntry_KenkichiToyama[] = {11, FALSE, sCreditsText_KenkichiToyama};
+static const struct CreditsEntry sCreditsEntry_SuguruNakatsui[] = {11, FALSE, sCreditsText_SuguruNakatsui};
+static const struct CreditsEntry sCreditsEntry_YumiFunasaka[] = {11, FALSE, sCreditsText_YumiFunasaka};
+static const struct CreditsEntry sCreditsEntry_NaokoYanase[] = {11, FALSE, sCreditsText_NaokoYanase};
+static const struct CreditsEntry sCreditsEntry_NCLSuperMarioClub[] = {11, FALSE, sCreditsText_NCLSuperMarioClub};
+static const struct CreditsEntry sCreditsEntry_AtsushiTada[] = {11, FALSE, sCreditsText_AtsushiTada};
+static const struct CreditsEntry sCreditsEntry_TakahiroOhnishi[] = {11, FALSE, sCreditsText_TakahiroOhnishi};
+static const struct CreditsEntry sCreditsEntry_NorihideOkamura[] = {11, FALSE, sCreditsText_NorihideOkamura};
+static const struct CreditsEntry sCreditsEntry_HiroNakamura[] = {11, FALSE, sCreditsText_HiroNakamura};
+static const struct CreditsEntry sCreditsEntry_HiroyukiUesugi[] = {11, FALSE, sCreditsText_HiroyukiUesugi};
+static const struct CreditsEntry sCreditsEntry_TerukiMurakawa[] = {11, FALSE, sCreditsText_TerukiMurakawa};
+static const struct CreditsEntry sCreditsEntry_AkiraKinashi[] = {11, FALSE, sCreditsText_AkiraKinashi};
+static const struct CreditsEntry sCreditsEntry_MichikoTakizawa[] = {11, FALSE, sCreditsText_MichikoTakizawa};
+static const struct CreditsEntry sCreditsEntry_MakikoTakada[] = {11, FALSE, sCreditsText_MakikoTakada};
+static const struct CreditsEntry sCreditsEntry_TakanaoKondo[] = {11, FALSE, sCreditsText_TakanaoKondo};
+static const struct CreditsEntry sCreditsEntry_AiMashima[] = {11, FALSE, sCreditsText_AiMashima};
+static const struct CreditsEntry sCreditsEntry_GakujiNomoto[] = {11, FALSE, sCreditsText_GakujiNomoto};
+static const struct CreditsEntry sCreditsEntry_TakehiroIzushi[] = {11, FALSE, sCreditsText_TakehiroIzushi};
+static const struct CreditsEntry sCreditsEntry_HitoshiYamagami[] = {11, FALSE, sCreditsText_HitoshiYamagami};
+static const struct CreditsEntry sCreditsEntry_KyokoWatanabe[] = {11, FALSE, sCreditsText_KyokoWatanabe};
+static const struct CreditsEntry sCreditsEntry_TakaoNakano[] = {11, FALSE, sCreditsText_TakaoNakano};
+static const struct CreditsEntry sCreditsEntry_HiroyukiJinnai[] = {11, FALSE, sCreditsText_HiroyukiJinnai};
+static const struct CreditsEntry sCreditsEntry_HiroakiTsuru[] = {11, FALSE, sCreditsText_HiroakiTsuru};
+static const struct CreditsEntry sCreditsEntry_TsunekazIshihara[] = {11, FALSE, sCreditsText_TsunekazIshihara};
+static const struct CreditsEntry sCreditsEntry_SatoruIwata[] = {11, FALSE, sCreditsText_SatoruIwata};
+static const struct CreditsEntry sCreditsEntry_KazuyaSuyama[] = {11, FALSE, sCreditsText_KazuyaSuyama};
+static const struct CreditsEntry sCreditsEntry_SatoshiMitsuhara[] = {11, FALSE, sCreditsText_SatoshiMitsuhara};
+static const struct CreditsEntry sCreditsEntry_JapanBrailleLibrary[] = { 9, FALSE, sCreditsText_JapanBrailleLibrary};
+static const struct CreditsEntry sCreditsEntry_TomotakaKomura[] = {11, FALSE, sCreditsText_TomotakaKomura};
+static const struct CreditsEntry sCreditsEntry_MikikoOhhashi[] = {11, FALSE, sCreditsText_MikikoOhhashi};
+static const struct CreditsEntry sCreditsEntry_DaisukeHoshino[] = {11, FALSE, sCreditsText_DaisukeHoshino};
+static const struct CreditsEntry sCreditsEntry_KenjiroIto[] = {11, FALSE, sCreditsText_KenjiroIto};
+static const struct CreditsEntry sCreditsEntry_RuiKawaguchi[] = {11, FALSE, sCreditsText_RuiKawaguchi};
+static const struct CreditsEntry sCreditsEntry_ShunsukeKohori[] = {11, FALSE, sCreditsText_ShunsukeKohori};
+static const struct CreditsEntry sCreditsEntry_SachikoNakamichi[] = {11, FALSE, sCreditsText_SachikoNakamichi};
+static const struct CreditsEntry sCreditsEntry_FujikoNomura[] = {11, FALSE, sCreditsText_FujikoNomura};
+static const struct CreditsEntry sCreditsEntry_KazukiYoshihara[] = {11, FALSE, sCreditsText_KazukiYoshihara};
+static const struct CreditsEntry sCreditsEntry_RetsujiNomoto[] = {11, FALSE, sCreditsText_RetsujiNomoto};
+static const struct CreditsEntry sCreditsEntry_AzusaTajima[] = {11, FALSE, sCreditsText_AzusaTajima};
+static const struct CreditsEntry sCreditsEntry_ShusakuEgami[] = {11, FALSE, sCreditsText_ShusakuEgami};
+static const struct CreditsEntry sCreditsEntry_PackageAndManual[] = { 0, TRUE, sCreditsText_PackageAndManual};
+static const struct CreditsEntry sCreditsEntry_EnglishVersion[] = { 0, TRUE, sCreditsText_EnglishVersion};
+static const struct CreditsEntry sCreditsEntry_Translator[] = { 0, TRUE, sCreditsText_Translator};
+static const struct CreditsEntry sCreditsEntry_TextEditor[] = { 0, TRUE, sCreditsText_TextEditor};
+static const struct CreditsEntry sCreditsEntry_NCLCoordinator[] = { 0, TRUE, sCreditsText_NCLCoordinator};
+static const struct CreditsEntry sCreditsEntry_GraphicDesigner[] = { 0, TRUE, sCreditsText_GraphicDesigner};
+static const struct CreditsEntry sCreditsEntry_NOAProductTesting[] = { 0, TRUE, sCreditsText_NOAProductTesting};
+static const struct CreditsEntry sCreditsEntry_HideyukiNakajima[] = { 0, FALSE, sCreditsText_HideyukiNakajima};
+static const struct CreditsEntry sCreditsEntry_HidenoriSaeki[] = { 0, FALSE, sCreditsText_HidenoriSaeki};
+static const struct CreditsEntry sCreditsEntry_YokoWatanabe[] = { 0, FALSE, sCreditsText_YokoWatanabe};
+static const struct CreditsEntry sCreditsEntry_SakaeKimura[] = { 0, FALSE, sCreditsText_SakaeKimura};
+static const struct CreditsEntry sCreditsEntry_ChiakiShinkai[] = { 0, FALSE, sCreditsText_ChiakiShinkai};
+static const struct CreditsEntry sCreditsEntry_SethMcMahill[] = { 0, FALSE, sCreditsText_SethMcMahill};
+static const struct CreditsEntry sCreditsEntry_NobOgasawara[] = { 0, FALSE, sCreditsText_NobOgasawara};
+static const struct CreditsEntry sCreditsEntry_TeresaLillygren[] = { 0, FALSE, sCreditsText_TeresaLillygren};
+static const struct CreditsEntry sCreditsEntry_KimikoNakamichi[] = { 0, FALSE, sCreditsText_KimikoNakamichi};
+static const struct CreditsEntry sCreditsEntry_SouichiYamamoto[] = { 0, FALSE, sCreditsText_SouichiYamamoto};
+static const struct CreditsEntry sCreditsEntry_YuichiroIto[] = { 0, FALSE, sCreditsText_YuichiroIto};
+static const struct CreditsEntry sCreditsEntry_ThomasHertzog[] = { 0, FALSE, sCreditsText_ThomasHertzog};
+static const struct CreditsEntry sCreditsEntry_MikaKurosawa[] = { 0, FALSE, sCreditsText_MikaKurosawa};
+static const struct CreditsEntry sCreditsEntry_NationalFederationBlind[] = { 0, FALSE, sCreditsText_NationalFederationBlind};
+static const struct CreditsEntry sCreditsEntry_PatriciaAMaurer[] = { 0, FALSE, sCreditsText_PatriciaAMaurer};
+static const struct CreditsEntry sCreditsEntry_EuropeanBlindUnion[] = { 0, FALSE, sCreditsText_EuropeanBlindUnion};
+static const struct CreditsEntry sCreditsEntry_AustralianBrailleAuthority[] = { 0, FALSE, sCreditsText_AustralianBrailleAuthority};
+static const struct CreditsEntry sCreditsEntry_RoyalNewZealandFederationBlind[] = { 0, FALSE, sCreditsText_RoyalNewZealandFederationBlind};
+static const struct CreditsEntry sCreditsEntry_MotoyasuTojima[] = { 0, FALSE, sCreditsText_MotoyasuTojima};
+static const struct CreditsEntry sCreditsEntry_NicolaPrattBarlow[] = { 0, FALSE, sCreditsText_NicolaPrattBarlow};
+static const struct CreditsEntry sCreditsEntry_ShellieDow[] = { 0, FALSE, sCreditsText_ShellieDow};
+static const struct CreditsEntry sCreditsEntry_ErikJohnson[] = { 0, FALSE, sCreditsText_ErikJohnson};
+
+#define _ sCreditsEntry_EmptyString
+static const struct CreditsEntry *const sCreditsEntryPointerTable[PAGE_COUNT][ENTRIES_PER_PAGE] =
+{
+ [PAGE_TITLE] = {
+ _,
+ sCreditsEntry_PkmnEmeraldVersion,
+ sCreditsEntry_Credits,
+ _,
+ _
+ },
+ [PAGE_DIRECTOR] = {
+ _,
+ sCreditsEntry_Director,
+ sCreditsEntry_ShigekiMorimoto,
+ _,
+ _,
+ },
+ [PAGE_ART_DIRECTOR] = {
+ _,
+ sCreditsEntry_ArtDirector,
+ sCreditsEntry_KenSugimori,
+ _,
+ _,
+ },
+ [PAGE_WORLD_DIRECTOR] = {
+ _,
+ sCreditsEntry_WorldDirector,
+ sCreditsEntry_JunichiMasuda,
+ _,
+ _,
+ },
+ [PAGE_LEAD_PROGRAMMER] = {
+ sCreditsEntry_LeadProgrammer,
+ sCreditsEntry_HisashiSogabe,
+ sCreditsEntry_LeadGraphicArtist,
+ sCreditsEntry_MotofumiFujiwara,
+ _,
+ },
+ [PAGE_PROGRAMMERS_1] = {
+ sCreditsEntry_Programmers,
+ sCreditsEntry_HisashiSogabe,
+ sCreditsEntry_TomomichiOhta,
+ sCreditsEntry_NozomuSaito,
+ sCreditsEntry_EmptyString,
+ },
+ [PAGE_PROGRAMMERS_2] = {
+ sCreditsEntry_Programmers,
+ sCreditsEntry_AkitoMori,
+ sCreditsEntry_HiroyukiNakamura,
+ sCreditsEntry_MasaoTaya,
+ _,
+ },
+ [PAGE_PROGRAMMERS_3] = {
+ sCreditsEntry_Programmers,
+ sCreditsEntry_SatoshiNohara,
+ sCreditsEntry_MiyukiIwasawa,
+ sCreditsEntry_YoshinoriMatsuda,
+ sCreditsEntry_KeitaKagaya,
+ },
+ [PAGE_PROGRAMMERS_4] = {
+ sCreditsEntry_Programmers,
+ sCreditsEntry_TetsuyaWatanabe,
+ sCreditsEntry_SosukeTamada,
+ sCreditsEntry_TakenoriOhta,
+ _,
+ },
+ [PAGE_GRAPHIC_DESIGNERS_1] = {
+ _,
+ sCreditsEntry_GraphicDesigners,
+ sCreditsEntry_MotofumiFujiwara,
+ sCreditsEntry_SatoshiOhta,
+ _,
+ },
+ [PAGE_GRAPHIC_DESIGNERS_2] = {
+ sCreditsEntry_GraphicDesigners,
+ sCreditsEntry_KenkichiToyama,
+ sCreditsEntry_AsukaIwashita,
+ sCreditsEntry_TakaoUnno,
+ _,
+ },
+ [PAGE_GRAPHIC_DESIGNERS_3] = {
+ sCreditsEntry_GraphicDesigners,
+ sCreditsEntry_KenSugimori,
+ sCreditsEntry_HironobuYoshida,
+ sCreditsEntry_AimiTomita,
+ sCreditsEntry_KanakoEo,
+ },
+ [PAGE_MUSIC_COMPOSITION] = {
+ sCreditsEntry_MusicComposition,
+ sCreditsEntry_GoIchinose,
+ sCreditsEntry_JunichiMasuda,
+ sCreditsEntry_MorikazuAoki,
+ sCreditsEntry_HitomiSato,
+ },
+ [PAGE_SOUND_EFFECTS] = {
+ _,
+ sCreditsEntry_SoundEffectsAndPkmnVoices,
+ sCreditsEntry_GoIchinose,
+ sCreditsEntry_MorikazuAoki,
+ _,
+ },
+ [PAGE_GAME_DESIGNERS_1] = {
+ sCreditsEntry_GameDesigners,
+ sCreditsEntry_ShigekiMorimoto,
+ sCreditsEntry_TeruyukiShimoyamada,
+ sCreditsEntry_TakeshiKawachimaru,
+ sCreditsEntry_AkihitoTomisawa,
+ },
+ [PAGE_GAME_DESIGNERS_2] = {
+ sCreditsEntry_GameDesigners,
+ sCreditsEntry_SuguruNakatsui,
+ sCreditsEntry_TetsujiOhta,
+ sCreditsEntry_HitomiSato,
+ sCreditsEntry_KenjiMatsushima,
+ },
+ [PAGE_GAME_DESIGNERS_3] = {
+ sCreditsEntry_GameDesigners,
+ sCreditsEntry_JunichiMasuda,
+ sCreditsEntry_KojiNishino,
+ sCreditsEntry_ShigeruOhmori,
+ sCreditsEntry_TadashiTakahashi,
+ },
+ [PAGE_SCENARIO_PLOT] = {
+ sCreditsEntry_ScenarioPlot,
+ sCreditsEntry_AkihitoTomisawa,
+ sCreditsEntry_JunichiMasuda,
+ sCreditsEntry_KojiNishino,
+ _,
+ },
+ [PAGE_SCENARIO] = {
+ sCreditsEntry_Scenario,
+ sCreditsEntry_AkihitoTomisawa,
+ sCreditsEntry_HitomiSato,
+ sCreditsEntry_ToshinobuMatsumiya,
+ _,
+ },
+ [PAGE_SCRIPT_DESIGNERS] = {
+ sCreditsEntry_ScriptDesigners,
+ sCreditsEntry_TomomichiOhta,
+ sCreditsEntry_SatoshiNohara,
+ _,
+ _,
+ },
+ [PAGE_MAP_DESIGNERS] = {
+ sCreditsEntry_MapDesigners,
+ sCreditsEntry_SuguruNakatsui,
+ sCreditsEntry_TeruyukiShimoyamada,
+ sCreditsEntry_ShigeruOhmori,
+ sCreditsEntry_TetsujiOhta,
+ },
+ [PAGE_BATTLE_FRONTIER_DATA] = {
+ _,
+ sCreditsEntry_BattleFrontierData,
+ sCreditsEntry_TetsujiOhta,
+ _,
+ _,
+ },
+ [PAGE_PARAMETRIC_DESIGNERS] = {
+ sCreditsEntry_ParametricDesigners,
+ sCreditsEntry_TeruyukiShimoyamada,
+ sCreditsEntry_ShigekiMorimoto,
+ sCreditsEntry_TetsujiOhta,
+ sCreditsEntry_KojiNishino,
+ },
+ [PAGE_POKEDEX_TEXT] = {
+ _,
+ sCreditsEntry_PokedexText,
+ sCreditsEntry_KenjiMatsushima,
+ _,
+ _,
+ },
+ [PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_1] = {
+ sCreditsEntry_EnvAndToolPgrms,
+ sCreditsEntry_HisashiSogabe,
+ sCreditsEntry_SosukeTamada,
+ sCreditsEntry_HiroyukiNakamura,
+ sCreditsEntry_AkitoMori,
+ },
+ [PAGE_PKMN_DESIGNERS_1] = {
+ sCreditsEntry_PkmnDesigners,
+ sCreditsEntry_KenSugimori,
+ sCreditsEntry_MotofumiFujiwara,
+ sCreditsEntry_ShigekiMorimoto,
+ _,
+ },
+ [PAGE_PKMN_DESIGNERS_2] = {
+ sCreditsEntry_PkmnDesigners,
+ sCreditsEntry_HironobuYoshida,
+ sCreditsEntry_SatoshiOhta,
+ sCreditsEntry_AsukaIwashita,
+ _,
+ },
+ [PAGE_PKMN_DESIGNERS_3] = {
+ sCreditsEntry_PkmnDesigners,
+ sCreditsEntry_TakaoUnno,
+ sCreditsEntry_KanakoEo,
+ sCreditsEntry_AimiTomita,
+ _,
+ },
+ [PAGE_PKMN_DESIGNERS_4] = {
+ sCreditsEntry_PkmnDesigners,
+ sCreditsEntry_AtsukoNishida,
+ sCreditsEntry_MuneoSaito,
+ sCreditsEntry_RenaYoshikawa,
+ sCreditsEntry_JunOkutani,
+ },
+ [PAGE_SUPPORT_PROGRAMMERS] = {
+ _,
+ sCreditsEntry_SupportProgrammers,
+ sCreditsEntry_SatoshiMitsuhara,
+ sCreditsEntry_DaisukeHoshino,
+ _,
+ },
+ [PAGE_NCL_PRODUCT_TESTING] = {
+ _,
+ sCreditsEntry_NCLProductTesting,
+ sCreditsEntry_NCLSuperMarioClub,
+ _,
+ _,
+ },
+ [PAGE_PACKAGE_AND_MANUAL] = {
+ _,
+ sCreditsEntry_PackageAndManual,
+ sCreditsEntry_KenSugimori,
+ _,
+ _,
+ },
+ [PAGE_SPECIAL_THANKS_1] = {
+ _,
+ sCreditsEntry_SpecialThanks,
+ sCreditsEntry_KenjiTominaga,
+ sCreditsEntry_HirokiEnomoto,
+ _,
+ },
+ [PAGE_SPECIAL_THANKS_2] = {
+ sCreditsEntry_SpecialThanks,
+ sCreditsEntry_KazuyaSuyama,
+ sCreditsEntry_KenjiroIto,
+ sCreditsEntry_MichikoTakizawa,
+ sCreditsEntry_MakikoTakada,
+ },
+ [PAGE_SPECIAL_THANKS_3] = {
+ sCreditsEntry_SpecialThanks,
+ sCreditsEntry_MikikoOhhashi,
+ sCreditsEntry_TakanaoKondo,
+ sCreditsEntry_RuiKawaguchi,
+ _,
+ },
+ [PAGE_SPECIAL_THANKS_4] = {
+ sCreditsEntry_SpecialThanks,
+ sCreditsEntry_TakahiroOhnishi,
+ sCreditsEntry_NorihideOkamura,
+ sCreditsEntry_ShunsukeKohori,
+ _,
+ },
+ [PAGE_INFORMATION_SUPERVISORS] = {
+ sCreditsEntry_InfoSupervisors,
+ sCreditsEntry_KazuyukiTerada,
+ sCreditsEntry_YuriSakurai,
+ sCreditsEntry_YumiFunasaka,
+ sCreditsEntry_NaokoYanase,
+ },
+ [PAGE_ARTWORK_1] = {
+ _,
+ sCreditsEntry_Artwork,
+ sCreditsEntry_SachikoNakamichi,
+ sCreditsEntry_FujikoNomura,
+ _,
+ },
+ [PAGE_ARTWORK_2] = {
+ _,
+ sCreditsEntry_Artwork,
+ sCreditsEntry_HideyukiNakajima,
+ sCreditsEntry_HidenoriSaeki,
+ _,
+ },
+ [PAGE_ARTWORK_3] = {
+ sCreditsEntry_Artwork,
+ sCreditsEntry_YokoWatanabe,
+ sCreditsEntry_SakaeKimura,
+ sCreditsEntry_ChiakiShinkai,
+ _,
+ },
+ [PAGE_COORDINATORS] = {
+ sCreditsEntry_Coordinators,
+ sCreditsEntry_KazukiYoshihara,
+ sCreditsEntry_AkiraKinashi,
+ sCreditsEntry_RetsujiNomoto,
+ _,
+ },
+ [PAGE_ENGLISH_VERSION] = {
+ _,
+ sCreditsEntry_EnglishVersion,
+ sCreditsEntry_HiroNakamura,
+ sCreditsEntry_SethMcMahill,
+ _,
+ },
+ [PAGE_TRANSLATOR] = {
+ _,
+ sCreditsEntry_Translator,
+ sCreditsEntry_NobOgasawara,
+ _,
+ _,
+ },
+ [PAGE_TEXT_EDITOR] = {
+ _,
+ sCreditsEntry_TextEditor,
+ sCreditsEntry_TeresaLillygren,
+ _,
+ _,
+ },
+ [PAGE_NCL_COORDINATOR] = {
+ _,
+ sCreditsEntry_NCLCoordinator,
+ sCreditsEntry_KimikoNakamichi,
+ _,
+ _,
+ },
+ [PAGE_PROGRAMMERS_5] = {
+ sCreditsEntry_Programmers,
+ sCreditsEntry_TerukiMurakawa,
+ sCreditsEntry_SouichiYamamoto,
+ sCreditsEntry_YuichiroIto,
+ sCreditsEntry_AkiraKinashi,
+ },
+ [PAGE_GRAPHIC_DESIGNER] = {
+ _,
+ sCreditsEntry_GraphicDesigner,
+ sCreditsEntry_AkiraKinashi,
+ _,
+ _,
+ },
+ [PAGE_ENVIRONMENT_AND_TOOL_PROGRAMS_2] = {
+ sCreditsEntry_EnvAndToolPgrms,
+ sCreditsEntry_TerukiMurakawa,
+ sCreditsEntry_SouichiYamamoto,
+ sCreditsEntry_KimikoNakamichi,
+ _,
+ },
+ [PAGE_NOA_TESTING] = {
+ sCreditsEntry_NOAProductTesting,
+ sCreditsEntry_ThomasHertzog,
+ sCreditsEntry_ErikJohnson,
+ sCreditsEntry_MikaKurosawa,
+ _,
+ },
+ [PAGE_BRAILLE_CODE_CHECK_1] = {
+ sCreditsEntry_BrailleCodeCheck,
+ sCreditsEntry_NationalFederationBlind,
+ sCreditsEntry_PatriciaAMaurer,
+ sCreditsEntry_JapanBrailleLibrary,
+ sCreditsEntry_EuropeanBlindUnion,
+ },
+ [PAGE_BRAILLE_CODE_CHECK_2] = {
+ _,
+ sCreditsEntry_BrailleCodeCheck,
+ sCreditsEntry_AustralianBrailleAuthority,
+ sCreditsEntry_RoyalNewZealandFederationBlind,
+ _,
+ },
+ [PAGE_SPECIAL_THANKS_5] = {
+ sCreditsEntry_SpecialThanks,
+ sCreditsEntry_HiroyukiUesugi,
+ sCreditsEntry_MotoyasuTojima,
+ sCreditsEntry_NicolaPrattBarlow,
+ sCreditsEntry_ShellieDow,
+ },
+ [PAGE_TASK_MANAGERS] = {
+ _,
+ sCreditsEntry_TaskManagers,
+ sCreditsEntry_AzusaTajima,
+ sCreditsEntry_ShusakuEgami,
+ _,
+ },
+ [PAGE_PRODUCERS] = {
+ sCreditsEntry_Producers,
+ sCreditsEntry_HiroyukiJinnai,
+ sCreditsEntry_HitoshiYamagami,
+ sCreditsEntry_GakujiNomoto,
+ sCreditsEntry_HiroakiTsuru,
+ },
+ [PAGE_EXECUTIVE_DIRECTOR] = {
+ _,
+ sCreditsEntry_ExecutiveDirector,
+ sCreditsEntry_SatoshiTajiri,
+ _,
+ _,
+ },
+ [PAGE_EXECUTIVE_PRODUCERS_1] = {
+ _,
+ sCreditsEntry_ExecProducers,
+ sCreditsEntry_SatoruIwata,
+ _,
+ _,
+ },
+ [PAGE_EXECUTIVE_PRODUCERS_2] = {
+ _,
+ sCreditsEntry_ExecProducers,
+ sCreditsEntry_TsunekazIshihara,
+ _,
+ _,
+ },
+};
+#undef _
diff --git a/src/data/graphics/intro_scene.h b/src/data/graphics/intro_scene.h
index ea67c7b0d..cb7706c9a 100644
--- a/src/data/graphics/intro_scene.h
+++ b/src/data/graphics/intro_scene.h
@@ -1,48 +1,47 @@
-const u16 gIntro1GameFreakTextFadePal[] = INCBIN_U16("graphics/intro/intro1_text.gbapal"); // game freak text blue fade
-const u16 gIntro2BrendanNoTurnPal[] = INCBIN_U16("graphics/intro/intro2_brendan_noturn.gbapal");
-const u16 gIntro3BgPal[] = INCBIN_U16("graphics/intro/intro3.gbapal");
-const u16 gIntro2VolbeatPal[] = INCBIN_U16("graphics/intro/intro2_volbeat.gbapal");
-const u16 gIntro2TorchicPal[] = INCBIN_U16("graphics/intro/intro2_torchic.gbapal");
-const u16 gIntro2ManectricPal[] = INCBIN_U16("graphics/intro/intro2_manectric.gbapal");
-const u16 gIntro2FlygonPal[] = INCBIN_U16("graphics/intro/intro2_flygon.gbapal");
+const u16 gIntroGameFreakTextFade_Pal[] = INCBIN_U16("graphics/intro/scene_1/text.gbapal"); // game freak text blue fade
+const u16 gIntroPlayer_Pal[] = INCBIN_U16("graphics/intro/scene_2/player.gbapal");
+const u16 gIntro3Bg_Pal[] = INCBIN_U16("graphics/intro/scene_3/bg.gbapal");
+const u16 gIntroVolbeat_Pal[] = INCBIN_U16("graphics/intro/scene_2/volbeat.gbapal");
+const u16 gIntroTorchic_Pal[] = INCBIN_U16("graphics/intro/scene_2/torchic.gbapal");
+const u16 gIntroManectric_Pal[] = INCBIN_U16("graphics/intro/scene_2/manectric.gbapal");
+const u16 gIntroFlygon_Pal[] = INCBIN_U16("graphics/intro/scene_2/flygon.gbapal");
-const u32 gIntro2VolbeatGfx[] = INCBIN_U32("graphics/intro/intro2_volbeat.4bpp.lz");
-const u32 gIntro2TorchicGfx[] = INCBIN_U32("graphics/intro/intro2_torchic.4bpp.lz");
-const u32 gIntro2ManectricGfx[] = INCBIN_U32("graphics/intro/intro2_manectric.4bpp.lz");
-const u32 gIntro2FlygonGfx[] = INCBIN_U32("graphics/intro/intro2_flygon.4bpp.lz");
-const u32 gIntro2BrendanNoTurnGfx[] = INCBIN_U32("graphics/intro/intro2_brendan_noturn.4bpp.lz");
-const u32 gIntro2MayNoTurnGfx[] = INCBIN_U32("graphics/intro/intro2_may_noturn.4bpp.lz");
+const u32 gIntroVolbeat_Gfx[] = INCBIN_U32("graphics/intro/scene_2/volbeat.4bpp.lz");
+const u32 gIntroTorchic_Gfx[] = INCBIN_U32("graphics/intro/scene_2/torchic.4bpp.lz");
+const u32 gIntroManectric_Gfx[] = INCBIN_U32("graphics/intro/scene_2/manectric.4bpp.lz");
+const u32 gIntroFlygon_Gfx[] = INCBIN_U32("graphics/intro/scene_2/flygon.4bpp.lz");
+const u32 gIntroBrendan_Gfx[] = INCBIN_U32("graphics/intro/scene_2/brendan.4bpp.lz");
+const u32 gIntroMay_Gfx[] = INCBIN_U32("graphics/intro/scene_2/may.4bpp.lz");
-const u32 gIntro3GroudonGfx[] = INCBIN_U32("graphics/intro/intro3_groudon.8bpp.lz");
-const u32 gIntro3GroudonTilemap[] = INCBIN_U32("graphics/intro/intro3_groudon.bin.lz");
+const u32 gIntroGroudon_Gfx[] = INCBIN_U32("graphics/intro/scene_3/groudon.8bpp.lz");
+const u32 gIntroGroudon_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/groudon.bin.lz");
-const u32 gIntro3KyogreGfx[] = INCBIN_U32("graphics/intro/intro3_kyogre.8bpp.lz");
-const u32 gIntro3KyogreTilemap[] = INCBIN_U32("graphics/intro/intro3_kyogre.bin.lz");
+const u32 gIntroKyogre_Gfx[] = INCBIN_U32("graphics/intro/scene_3/kyogre.8bpp.lz");
+const u32 gIntroKyogre_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/kyogre.bin.lz");
-const u32 gIntro3LegendBgGfx[] = INCBIN_U32("graphics/intro/legend_bg.4bpp.lz"); // groudon/kyogre/bg
+const u32 gIntroLegendBg_Gfx[] = INCBIN_U32("graphics/intro/scene_3/legend_bg.4bpp.lz"); // groudon/kyogre bg
+const u32 gIntroGroudonBg_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/groudon_bg.bin.lz");
+const u32 gIntroKyogreBg_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/kyogre_bg.bin.lz");
-const u32 gIntro3GroudonBgTilemap[] = INCBIN_U32("graphics/intro/legend_bg1.bin.lz");
-const u32 gIntro3KyogreBgTilemap[] = INCBIN_U32("graphics/intro/legend_bg2.bin.lz");
+const u32 gIntroClouds_Gfx[] = INCBIN_U32("graphics/intro/scene_3/clouds.4bpp.lz");
+const u32 gIntroCloudsLeft_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/clouds_left.bin.lz");
+const u32 gIntroCloudsRight_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/clouds_right.bin.lz");
+const u32 gIntroCloudsSun_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/clouds_sun.bin.lz");
-const u32 gIntro3CloudsGfx[] = INCBIN_U32("graphics/intro/intro3_clouds.4bpp.lz");
-const u32 gIntro3Clouds1Tilemap[] = INCBIN_U32("graphics/intro/intro3_clouds1.bin.lz");
-const u32 gIntro3Clouds2Tilemap[] = INCBIN_U32("graphics/intro/intro3_clouds2.bin.lz");
-const u32 gIntro3Clouds3Tilemap[] = INCBIN_U32("graphics/intro/intro3_clouds3.bin.lz");
+const u32 gIntroLightning_Gfx[] = INCBIN_U32("graphics/intro/scene_3/lightning.4bpp.lz");
+const u16 gIntroLightning_Pal[] = INCBIN_U16("graphics/intro/scene_3/lightning.gbapal");
-const u32 gIntro3LightningGfx[] = INCBIN_U32("graphics/intro/intro3_lightning.4bpp.lz");
-const u16 gIntro3LightningPal[] = INCBIN_U16("graphics/intro/intro3_lightning.gbapal");
+const u32 gIntroRayquaza_Gfx[] = INCBIN_U32("graphics/intro/scene_3/rayquaza.4bpp.lz");
+const u32 gIntroRayquaza_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/rayquaza.bin.lz");
-const u32 gIntro3RayquazaGfx[] = INCBIN_U32("graphics/intro/intro3_rayquaza.4bpp.lz");
-const u32 gIntro3RayquazaTilemap[] = INCBIN_U32("graphics/intro/intro3_rayquaza.bin.lz");
+const u32 gIntroUnused1_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/unused_1.bin.lz");
+const u32 gIntroUnused2_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/unused_2.bin.lz");
-const u32 gUnknown_D8C374[] = INCBIN_U32("graphics/unknown/unknown_D8C374.bin.lz");
-const u32 gUnknown_D8C5C4[] = INCBIN_U32("graphics/unknown/unknown_D8C5C4.bin.lz");
+const u32 gIntroRayquazaClouds_Gfx[] = INCBIN_U32("graphics/intro/scene_3/rayquaza_clouds.4bpp.lz");
+const u32 gIntroRayquazaClouds_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/rayquaza_clouds.bin.lz");
-const u32 gIntro3Clouds2Gfx[] = INCBIN_U32("graphics/intro/intro3_clouds2.4bpp.lz"); //clouds 2, during the rayquaza flash
-const u32 gIntro3Clouds4Tilemap[] = INCBIN_U32("graphics/intro/intro3_clouds4.bin.lz");
+const u32 gIntroBubbles_Gfx[] = INCBIN_U32("graphics/intro/scene_3/bubbles.4bpp.lz");
+const u16 gIntroBubbles_Pal[] = INCBIN_U16("graphics/intro/scene_3/bubbles.gbapal");
-const u32 gIntro2BubblesGfx[] = INCBIN_U32("graphics/intro/intro2_bubbles.4bpp.lz");
-const u16 gIntro2BubblesPal[] = INCBIN_U16("graphics/intro/intro2_bubbles.gbapal");
-
-const u32 gIntro1FlygonGfx[] = INCBIN_U32("graphics/intro/intro1_flygon.4bpp.lz");
-const u32 gIntro1SparkleGfx[] = INCBIN_U32("graphics/intro/intro1_sparkle.4bpp.lz");
+const u32 gIntroFlygonSilhouette_Gfx[] = INCBIN_U32("graphics/intro/scene_1/flygon.4bpp.lz");
+const u32 gIntroSparkle_Gfx[] = INCBIN_U32("graphics/intro/scene_1/sparkle.4bpp.lz");
diff --git a/src/decompress.c b/src/decompress.c
index 335699449..a65f38c2d 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -390,5 +390,5 @@ void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src
static void DuplicateDeoxysTiles(void *pointer, s32 species)
{
if (species == SPECIES_DEOXYS)
- CpuCopy32(pointer + 0x800, pointer, 0x800);
+ CpuCopy32(pointer + MON_PIC_SIZE, pointer, MON_PIC_SIZE);
}
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 7d3a7f28b..4461a5e5d 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -71,7 +71,7 @@ static void ClearVramOamPltt_LoadHofPal(void);
static void LoadHofGfx(void);
static void InitHofBgs(void);
static bool8 CreateHofConfettiSprite(void);
-static void SetCallback2AfterHallOfFameDisplay(void);
+static void StartCredits(void);
static bool8 sub_8175024(void);
static void Task_Hof_InitMonData(u8 taskId);
static void Task_Hof_InitTeamSaveData(u8 taskId);
@@ -774,11 +774,11 @@ static void Task_Hof_HandleExit(u8 taskId)
if (sHofMonPtr != NULL)
FREE_AND_SET_NULL(sHofMonPtr);
- SetCallback2AfterHallOfFameDisplay();
+ StartCredits();
}
}
-static void SetCallback2AfterHallOfFameDisplay(void)
+static void StartCredits(void)
{
SetMainCallback2(CB2_StartCreditsSequence);
}
diff --git a/src/intro.c b/src/intro.c
index 324ec6d46..1477b67a1 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -27,119 +27,193 @@
#include "constants/battle_anim.h"
/*
- * Intro animation sequence state machine
- * --------------------------------------
- *
- * Entry Point: CB2_InitCopyrightScreenAfterBootup
- *
- * Note: States advance sequentially unless otherwise stated.
- *
- * CB2_InitCopyrightScreenAfterBootup
- * - Registers a serial interrupt handler that listens for a GameCube.
- * - Waits for 140 frames, and then until palette fading completes.
- * - Stops looking for a GameCube for dualboot.
- * - Check the save file for corruption
- * - Setup global pointers to save file
- * - Initialize gHeap
- *
- * MainCB2_Intro
- * - Spawn Task_IntroLoadPart1Graphics
- * - If any keys are pressed during the intro, advance to
- * MainCB2_EndIntro (which will then kill all tasks).
- *
- * Task_IntroLoadPart1Graphics
- * Task_IntroFadeIn (frame counter starts at 0 here)
- * Task_IntroWaterDrops
- * - At frame 128 of this state, spawn Task_IntroWaterDrops_1
- * - At frame 256 of this state, spawn Task_IntroWaterDrops_2
- * - At frame 560 of this state, spawn Task_IntroWaterDrops_3
- * Task_IntroScrollDownAndShowFlygon
- * Task_IntroWaitToSetupPart2
- * Task_IntroLoadPart2Graphics
- * Task_IntroStartBikeRide
- * - Spawn Task_AdvanceBicycleAnimation
- * Task_IntroHandleBikeAndFlygonMovement
- * - At frame 1856, kills the bicycle animation task
- * Task_IntroWaitToSetupPart3
- * Task_IntroLoadPart3Graphics (frame counter resets to 0 here)
- * Task_IntroSpinAndZoomPokeball
- * - Continues until the zoom reaches a certain point
- * Task_IntroWaitToSetupPart3LegendsFight
- * Task_IntroLoadGroudonScene
- * Task_IntroLoadPart3Graphics1
- * Task_IntroLoadPart3Graphics2
- * Task_IntroLoadPart3Graphics3
- * Task_IntroLoadPart3Graphics4
- * Task_IntroGroudonScene
- * Task_IntroLoadKyogreScene
- * Task_IntroKyogreScene
- * Task_IntroLoadClouds1
- * Task_IntroLoadClouds2
- * Task_IntroLoadClouds3
- * Task_IntroCloudsScene
- * Task_IntroLoadRayquazaLightningScene
- * Task_IntroRayquazaLightningScene
- * Task_IntroLoadRayquazaGlowScene
- * Task_IntroRayquazaGlowScene_0
- * - Runs concurrently with Task_IntroRayquazaGlowScene_1
- * Task_EndIntroMovie
- * MainCB2_EndIntro
- * - Advances to CB2_InitTitleScreen
- */
+ The intro is grouped into the following scenes
+ Scene 0. Copyright screen
+ Scene 1. GF Logo, pan up over plants, Flygon silhouette goes by
+ Scene 2. Player biking on path, joined by Pokémon
+ Scene 3. A fight between Groudon/Kyogre ends with Rayquaza
+
+ After this it progresses to the title screen
+*/
+
+// Scene 1 main tasks
+static void Task_Scene1_Load(u8);
+static void Task_Scene1_FadeIn(u8);
+static void Task_Scene1_WaterDrops(u8);
+static void Task_Scene1_PanUp(u8);
+static void Task_Scene1_End(u8);
+
+// Scene 1 supplemental functions
+static void IntroResetGpuRegs(void);
+static u8 CreateGameFreakLogoSprites(s16, s16, s16);
+static void Task_BlendLogoIn(u8);
+static void Task_BlendLogoOut(u8);
+static void Task_CreateSparkles(u8);
+static u8 CreateWaterDrop(s16, s16, u16, u16, u16, u8);
+static void SpriteCB_WaterDrop(struct Sprite *sprite);
+static void SpriteCB_WaterDrop_Slide(struct Sprite *);
+static void SpriteCB_WaterDrop_ReachLeafEnd(struct Sprite *);
+static void SpriteCB_WaterDrop_DangleFromLeaf(struct Sprite *);
+static void SpriteCB_WaterDrop_Fall(struct Sprite *);
+static void SpriteCB_WaterDrop_Ripple(struct Sprite *);
+static void SpriteCB_Sparkle(struct Sprite *sprite);
+static void SpriteCB_LogoLetter(struct Sprite *sprite);
+static void SpriteCB_GameFreakLogo(struct Sprite *sprite);
+static void SpriteCB_FlygonSilhouette(struct Sprite *sprite);
+
+// Scene 2 main tasks
+static void Task_Scene2_Load(u8);
+static void Task_Scene2_CreateSprites(u8);
+static void Task_Scene2_BikeRide(u8);
+static void Task_Scene2_End(u8);
+
+// Scene 2 supplemental functions
+static void SpriteCB_Torchic(struct Sprite *sprite);
+static void SpriteCB_Manectric(struct Sprite *sprite);
+static void SpriteCB_Volbeat(struct Sprite *sprite);
+static void SpriteCB_Flygon(struct Sprite *);
+static void SpriteCB_PlayerOnBicycle(struct Sprite *);
+
+// Scene 3 main tasks
+static void Task_Scene3_Load(u8);
+static void Task_Scene3_SpinPokeball(u8);
+static void Task_Scene3_WaitGroudon(u8);
+static void Task_Scene3_LoadGroudon(u8);
+static void Task_Scene3_InitGroudonBg(u8);
+static void Task_Scene3_NarrowWindow(u8);
+static void Task_Scene3_EndNarrowWindow(u8);
+static void Task_Scene3_StartGroudon(u8);
+static void Task_Scene3_Groudon(u8);
+static void Task_Scene3_LoadKyogre(u8);
+static void Task_Scene3_Kyogre(u8);
+static void Task_Scene3_LoadClouds1(u8);
+static void Task_Scene3_LoadClouds2(u8);
+static void Task_Scene3_InitClouds(u8);
+static void Task_Scene3_Clouds(u8);
+static void Task_Scene3_LoadLightning(u8);
+static void Task_Scene3_Lightning(u8);
+static void Task_Scene3_LoadRayquazaAttack(u8);
+static void Task_Scene3_Rayquaza(u8);
+static void Task_EndIntroMovie(u8);
+
+// Scene 3 supplemental functions
+static void CreateGroudonRockSprites(u8);
+static void CreateKyogreBubbleSprites_Body(u8);
+static void CreateKyogreBubbleSprites_Fins(void);
+static void Task_RayquazaAttack(u8);
+static void SpriteCB_GroudonRocks(struct Sprite *);
+static void SpriteCB_KyogreBubbles(struct Sprite *sprite);
+static void SpriteCB_Lightning(struct Sprite *sprite);
+static void SpriteCB_RayquazaOrb(struct Sprite *sprite);
+
+static void MainCB2_EndIntro(void);
extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
extern const struct SpriteTemplate gAncientPowerRockSpriteTemplate[];
-//ewram
-EWRAM_DATA u16 gIntroCharacterGender = 0;
-EWRAM_DATA u16 gUnknown_0203BCCA = 0;
-EWRAM_DATA u16 gIntroGraphicsFlygonYOffset = 0;
+#define TAG_VOLBEAT 1500
+#define TAG_TORCHIC 1501
+#define TAG_MANECTRIC 1502
+#define TAG_LIGHTNING 1503
+#define TAG_BUBBLES 1504
+#define TAG_SPARKLE 1505
+
+#define GFXTAG_DROPS_LOGO 2000
+#define PALTAG_DROPS 2000
+#define PALTAG_LOGO 2001
+
+#define TAG_FLYGON_SILHOUETTE 2002
+#define TAG_RAYQUAZA_ORB 2003
+
+#define COLOSSEUM_GAME_CODE 0x65366347 // "Gc6e" in ASCII
+
+// Used by various tasks and sprites
+#define tState data[0]
+#define sState data[0]
+
+/*
+ gIntroFrameCounter is used as a persistent timer throughout the
+ intro cinematic. At various points it's used to determine when
+ to trigger actions or progress through the cutscene.
+ The values for these are defined contiguously below.
+*/
+#define TIMER_BIG_DROP_START 76
+#define TIMER_LOGO_APPEAR 128
+#define TIMER_LOGO_LETTERS_COLOR 144
+#define TIMER_BIG_DROP_FALLS 251
+#define TIMER_LOGO_BLEND_OUT 256
+#define TIMER_LOGO_DISAPPEAR 272
+#define TIMER_SMALL_DROP_1 368
+#define TIMER_SMALL_DROP_2 384
+#define TIMER_SPARKLES 560
+#define TIMER_FLYGON_SILHOUETTE_APPEAR 832
+#define TIMER_END_PAN_UP 904
+#define TIMER_END_SCENE_1 1007
+#define TIMER_START_SCENE_2 1026
+#define TIMER_MANECTRIC_ENTER 1088
+#define TIMER_PLAYER_DRIFT_BACK 1109
+#define TIMER_MANECTRIC_RUN_CIRCULAR 1168
+#define TIMER_PLAYER_MOVE_FORWARD 1214
+#define TIMER_TORCHIC_ENTER 1224
+#define TIMER_FLYGON_ENTER 1394
+#define TIMER_PLAYER_MOVE_BACKWARD 1398
+#define TIMER_PLAYER_HOLD_POSITION 1576
+#define TIMER_PLAYER_EXIT 1727
+#define TIMER_TORCHIC_SPEED_UP 1735
+#define TIMER_TORCHIC_EXIT 1856
+#define TIMER_END_SCENE_2 1946
+#define TIMER_START_SCENE_3 2068
+// timer is reset for scene 3
+#define TIMER_POKEBALL_FADE 28
+#define TIMER_START_LEGENDARIES 43
+
+static EWRAM_DATA u16 sIntroCharacterGender = 0;
+static EWRAM_DATA u16 sUnusedVar = 0;
+static EWRAM_DATA u16 sFlygonYOffset = 0;
-//iwram
u32 gIntroFrameCounter;
struct GcmbStruct gMultibootProgramStruct;
-//.rodata
-static const u16 gIntro1DropsPal[] = INCBIN_U16("graphics/intro/intro1_drops.gbapal");
-static const u16 gIntro1GFLogoPal[] = INCBIN_U16("graphics/intro/intro1_gflogo.gbapal");
-static const u32 gIntroTiles[] = INCBIN_U32("graphics/intro/intro.4bpp.lz");
-static const u16 gIntro1BGPals[16][16] = INCBIN_U16("graphics/intro/intro1_bgpal.gbapal");
-static const u32 gIntro1BG0_Tilemap[] = INCBIN_U32("graphics/intro/intro1_bg0_map.bin.lz");
-static const u32 gIntro1BG1_Tilemap[] = INCBIN_U32("graphics/intro/intro1_bg1_map.bin.lz");
-static const u32 gIntro1BG2_Tilemap[] = INCBIN_U32("graphics/intro/intro1_bg2_map.bin.lz");
-static const u32 gIntro1BG3_Tilemap[] = INCBIN_U32("graphics/intro/intro1_bg3_map.bin.lz");
-static const u32 gIntro1BGLeavesGfx[] = INCBIN_U32("graphics/intro/introgfx.4bpp.lz");
-static const u16 gIntro3PokeballPal[] = INCBIN_U16("graphics/intro/intro3_pokeball.gbapal");
-static const u32 gIntro3Pokeball_Tilemap[] = INCBIN_U32("graphics/intro/intro3_pokeball_map.bin.lz");
-static const u32 gIntro3Pokeball_Gfx[] = INCBIN_U32("graphics/intro/intro3_pokeball.8bpp.lz");
-static const u16 gIntro3Streaks_Pal_Unused[] = INCBIN_U16("graphics/intro/intro3_streaks.gbapal");
-static const u32 gIntro3Streaks_Gfx_Unused[] = INCBIN_U32("graphics/intro/intro3_streaks.4bpp.lz");
-static const u32 gIntro3Streaks_Tilemap_Unused[] = INCBIN_U32("graphics/intro/intro3_streaks_map.bin.lz");
-static const u16 gIntro3Misc1Palette[] = INCBIN_U16("graphics/intro/intro3_misc1.gbapal");
-static const u16 gIntro3Misc2Palette_Unused[] = INCBIN_U16("graphics/intro/intro3_misc2.gbapal");
-static const u32 gIntro3MiscTiles[] = INCBIN_U32("graphics/intro/intro3_misc.4bpp.lz");
-static const u16 gIntro1FlygonPalette[] = INCBIN_U16("graphics/intro/intro1_flygon.gbapal");
-static const u32 gIntro1EonTiles_Unused[] = INCBIN_U32("graphics/intro/intro1_eon.4bpp.lz");
-static const u8 sUnknownBytes[] = {
+static const u16 sIntroDrops_Pal[] = INCBIN_U16("graphics/intro/scene_1/drops.gbapal");
+static const u16 sIntroLogo_Pal[] = INCBIN_U16("graphics/intro/scene_1/logo.gbapal");
+static const u32 sIntroDropsLogo_Gfx[] = INCBIN_U32("graphics/intro/scene_1/drops_logo.4bpp.lz");
+static const u16 sIntro1Bg_Pal[16][16] = INCBIN_U16("graphics/intro/scene_1/bg.gbapal");
+static const u32 sIntro1Bg0_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg0_map.bin.lz");
+static const u32 sIntro1Bg1_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg1_map.bin.lz");
+static const u32 sIntro1Bg2_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg2_map.bin.lz");
+static const u32 sIntro1Bg3_Tilemap[] = INCBIN_U32("graphics/intro/scene_1/bg3_map.bin.lz");
+static const u32 sIntro1Bg_Gfx[] = INCBIN_U32("graphics/intro/scene_1/bg.4bpp.lz");
+static const u16 sIntroPokeball_Pal[] = INCBIN_U16("graphics/intro/scene_3/pokeball.gbapal");
+static const u32 sIntroPokeball_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/pokeball_map.bin.lz");
+static const u32 sIntroPokeball_Gfx[] = INCBIN_U32("graphics/intro/scene_3/pokeball.8bpp.lz");
+static const u16 sIntroStreaks_Pal[] = INCBIN_U16("graphics/intro/scene_3/streaks.gbapal"); // Unused
+static const u32 sIntroStreaks_Gfx[] = INCBIN_U32("graphics/intro/scene_3/streaks.4bpp.lz"); // Unused
+static const u32 sIntroStreaks_Tilemap[] = INCBIN_U32("graphics/intro/scene_3/streaks_map.bin.lz"); // Unused
+static const u16 sIntroRayquzaOrb_Pal[] = INCBIN_U16("graphics/intro/scene_3/rayquaza_orb.gbapal");
+static const u16 sIntroMisc_Pal[] = INCBIN_U16("graphics/intro/scene_3/misc.gbapal"); // Unused
+static const u32 sIntroMisc_Gfx[] = INCBIN_U32("graphics/intro/scene_3/misc.4bpp.lz"); // Rayquza orb, and misc unused gfx
+static const u16 sIntroFlygonSilhouette_Pal[] = INCBIN_U16("graphics/intro/scene_1/flygon.gbapal");
+static const u32 sIntroLati_Gfx[] = INCBIN_U32("graphics/intro/scene_1/lati.4bpp.lz"); // Unused
+static const u8 sUnusedData[] = {
0x02, 0x03, 0x04, 0x05, 0x01, 0x01, 0x01, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x02, 0x0D,
0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x02, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x02, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x00
};
-static const struct CompressedSpriteSheet gIntroSpriteSheet_Sparkle[] =
+static const struct CompressedSpriteSheet sSpriteSheet_Sparkle[] =
{
- {gIntro1SparkleGfx, 0x400, 1505},
- {NULL},
+ {gIntroSparkle_Gfx, 0x400, TAG_SPARKLE},
+ {},
};
-static const struct SpritePalette gIntroPalette_Lightning[] =
+static const struct SpritePalette sSpritePalette_Sparkle[] =
{
- {gIntro3LightningPal, 1505},
- {NULL},
+ {gIntroLightning_Pal, TAG_SPARKLE}, // Lightning palette re-used
+ {},
};
-static const struct OamData gUnknown_085E4A94 =
+static const struct OamData sOamData_Sparkle =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -153,7 +227,7 @@ static const struct OamData gUnknown_085E4A94 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4A9C[] =
+static const union AnimCmd sAnim_Sparkle[] =
{
ANIMCMD_FRAME(0, 2),
ANIMCMD_FRAME(4, 2),
@@ -162,53 +236,52 @@ static const union AnimCmd gUnknown_085E4A9C[] =
ANIMCMD_FRAME(16, 2),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd *const gUnknown_085E4AB4[] =
+static const union AnimCmd *const sAnims_Sparkle[] =
{
- gUnknown_085E4A9C,
+ sAnim_Sparkle,
};
-static void sub_816D338(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4AB8 =
+static const struct SpriteTemplate sSpriteTemplate_Sparkle =
{
- .tileTag = 1505,
- .paletteTag = 1505,
- .oam = &gUnknown_085E4A94,
- .anims = gUnknown_085E4AB4,
+ .tileTag = TAG_SPARKLE,
+ .paletteTag = TAG_SPARKLE,
+ .oam = &sOamData_Sparkle,
+ .anims = sAnims_Sparkle,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816D338,
+ .callback = SpriteCB_Sparkle,
};
-static const u8 gUnknown_085E4AD0[][2] =
+static const u8 sSparkleCoords[][2] =
{
- {0x7C, 0x28},
- {0x66, 0x1E},
- {0x4D, 0x1E},
- {0x36, 0x0F},
- {0x94, 0x09},
- {0x3F, 0x1C},
- {0x5D, 0x28},
- {0x94, 0x20},
- {0xAD, 0x29},
- {0x5E, 0x14},
- {0xD0, 0x26},
- {0x00, 0x00},
+ {124, 40},
+ {102, 30},
+ { 77, 30},
+ { 54, 15},
+ {148, 9},
+ { 63, 28},
+ { 93, 40},
+ {148, 32},
+ {173, 41},
+ { 94, 20},
+ {208, 38},
+ {},
};
-static const struct CompressedSpriteSheet gIntroPokemonRunningSpriteSheet[] =
+static const struct CompressedSpriteSheet sSpriteSheet_RunningPokemon[] =
{
- {gIntro2VolbeatGfx, 0x400, 1500},
- {gIntro2TorchicGfx, 0xC00, 1501},
- {gIntro2ManectricGfx, 0x2000, 1502},
- {NULL},
+ {gIntroVolbeat_Gfx, 0x400, TAG_VOLBEAT},
+ {gIntroTorchic_Gfx, 0xC00, TAG_TORCHIC},
+ {gIntroManectric_Gfx, 0x2000, TAG_MANECTRIC},
+ {},
};
-static const struct SpritePalette gIntroPokemonRunningPalette[] =
+static const struct SpritePalette sSpritePalettes_RunningPokemon[] =
{
- {gIntro2VolbeatPal, 1500},
- {gIntro2TorchicPal, 1501},
- {gIntro2ManectricPal, 1502},
- {NULL},
+ {gIntroVolbeat_Pal, TAG_VOLBEAT},
+ {gIntroTorchic_Pal, TAG_TORCHIC},
+ {gIntroManectric_Pal, TAG_MANECTRIC},
+ {},
};
-static const struct OamData gUnknown_085E4B28 =
+static const struct OamData sOamData_Volbeat =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -222,30 +295,29 @@ static const struct OamData gUnknown_085E4B28 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4B30[] =
+static const union AnimCmd sAnim_Volbeat[] =
{
ANIMCMD_FRAME(0, 2),
ANIMCMD_FRAME(16, 2),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd *const gUnknown_085E4B3C[] =
+static const union AnimCmd *const sAnims_Volbeat[] =
{
- gUnknown_085E4B30,
+ sAnim_Volbeat,
};
-static void sub_816D81C(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4B40 =
+static const struct SpriteTemplate sSpriteTemplate_Volbeat =
{
- .tileTag = 1500,
- .paletteTag = 1500,
- .oam = &gUnknown_085E4B28,
- .anims = gUnknown_085E4B3C,
+ .tileTag = TAG_VOLBEAT,
+ .paletteTag = TAG_VOLBEAT,
+ .oam = &sOamData_Volbeat,
+ .anims = sAnims_Volbeat,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816D81C,
+ .callback = SpriteCB_Volbeat,
};
-static const struct OamData gUnknown_085E4B58 =
+static const struct OamData sOamData_Torchic =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -259,7 +331,7 @@ static const struct OamData gUnknown_085E4B58 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4B60[] =
+static const union AnimCmd sAnim_Torchic_Walk[] =
{
ANIMCMD_FRAME(0, 5),
ANIMCMD_FRAME(16, 5),
@@ -267,7 +339,7 @@ static const union AnimCmd gUnknown_085E4B60[] =
ANIMCMD_FRAME(16, 5),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E4B74[] =
+static const union AnimCmd sAnim_Torchic_Run[] =
{
ANIMCMD_FRAME(0, 3),
ANIMCMD_FRAME(16, 3),
@@ -275,33 +347,37 @@ static const union AnimCmd gUnknown_085E4B74[] =
ANIMCMD_FRAME(16, 3),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E4B88[] =
+static const union AnimCmd sAnim_Torchic_Trip[] =
{
ANIMCMD_FRAME(48, 4),
ANIMCMD_FRAME(64, 6),
ANIMCMD_FRAME(80, 0),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E4B98[] =
+enum {
+ TORCHIC_ANIM_WALK,
+ TORCHIC_ANIM_RUN,
+ TORCHIC_ANIM_TRIP,
+};
+static const union AnimCmd *const sAnims_Torchic[] =
{
- gUnknown_085E4B60,
- gUnknown_085E4B74,
- gUnknown_085E4B88,
+ [TORCHIC_ANIM_WALK] = sAnim_Torchic_Walk,
+ [TORCHIC_ANIM_RUN] = sAnim_Torchic_Run,
+ [TORCHIC_ANIM_TRIP] = sAnim_Torchic_Trip,
};
-static void sub_816D9C0(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4BA4 =
+static const struct SpriteTemplate sSpriteTemplate_Torchic =
{
- .tileTag = 1501,
- .paletteTag = 1501,
- .oam = &gUnknown_085E4B58,
- .anims = gUnknown_085E4B98,
+ .tileTag = TAG_TORCHIC,
+ .paletteTag = TAG_TORCHIC,
+ .oam = &sOamData_Torchic,
+ .anims = sAnims_Torchic,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816D9C0,
+ .callback = SpriteCB_Torchic,
};
-static const struct OamData gUnknown_085E4BBC =
+static const struct OamData sOamData_Manectric =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -315,7 +391,7 @@ static const struct OamData gUnknown_085E4BBC =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4BC4[] =
+static const union AnimCmd sAnim_Manectric[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(64, 4),
@@ -323,34 +399,33 @@ static const union AnimCmd gUnknown_085E4BC4[] =
ANIMCMD_FRAME(192, 4),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd *const gUnknown_085E4BD8[] =
+static const union AnimCmd *const sAnims_Manectric[] =
{
- gUnknown_085E4BC4,
+ sAnim_Manectric,
};
-static void sub_816DAE8(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4BDC =
+static const struct SpriteTemplate sSpriteTemplate_Manectric =
{
- .tileTag = 1502,
- .paletteTag = 1502,
- .oam = &gUnknown_085E4BBC,
- .anims = gUnknown_085E4BD8,
+ .tileTag = TAG_MANECTRIC,
+ .paletteTag = TAG_MANECTRIC,
+ .oam = &sOamData_Manectric,
+ .anims = sAnims_Manectric,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816DAE8,
+ .callback = SpriteCB_Manectric,
};
-static const struct CompressedSpriteSheet gIntroRayquazaLightningSpriteSheet[] =
+static const struct CompressedSpriteSheet sSpriteSheet_Lightning[] =
{
- {gIntro3LightningGfx, 0xC00, 1503},
- {NULL},
+ {gIntroLightning_Gfx, 0xC00, TAG_LIGHTNING},
+ {},
};
-static const struct SpritePalette gIntroRayquazaLightningPalette[] =
+static const struct SpritePalette sSpritePalette_Lightning[] =
{
- {gIntro3LightningPal, 1503},
- {NULL},
+ {gIntroLightning_Pal, TAG_LIGHTNING},
+ {},
};
-static const struct OamData gUnknown_085E4C14 =
+static const struct OamData sOamData_Lightning =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -364,78 +439,84 @@ static const struct OamData gUnknown_085E4C14 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4C1C[] =
+static const union AnimCmd sAnim_Lightning_Top[] =
{
ANIMCMD_FRAME(0, 2),
ANIMCMD_FRAME(48, 2),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4C28[] =
+static const union AnimCmd sAnim_Lightning_Middle[] =
{
ANIMCMD_FRAME(16, 2),
ANIMCMD_FRAME(64, 2),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4C34[] =
+static const union AnimCmd sAnim_Lightning_Bottom[] =
{
ANIMCMD_FRAME(32, 2),
ANIMCMD_FRAME(80, 2),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E4C40[] =
+static const union AnimCmd *const sAnims_Lightning[] =
{
- gUnknown_085E4C1C,
- gUnknown_085E4C28,
- gUnknown_085E4C34,
+ sAnim_Lightning_Top,
+ sAnim_Lightning_Middle,
+ sAnim_Lightning_Bottom,
};
-static void SpriteCB_IntroRayquazaLightning(struct Sprite *sprite);
-static const struct SpriteTemplate gIntroLightningSprite =
+static const struct SpriteTemplate sSpriteTemplate_Lightning =
{
- .tileTag = 1503,
- .paletteTag = 1503,
- .oam = &gUnknown_085E4C14,
- .anims = gUnknown_085E4C40,
+ .tileTag = TAG_LIGHTNING,
+ .paletteTag = TAG_LIGHTNING,
+ .oam = &sOamData_Lightning,
+ .anims = sAnims_Lightning,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = SpriteCB_IntroRayquazaLightning,
-};
-static const s16 gIntroGroudonRockData[][3] =
-{
- {0x68, 0x00, 0x0C0},
- {0x8E, 0x03, 0x280},
- {0x53, 0x01, 0x180},
- {0x9B, 0x00, 0x080},
- {0x38, 0x02, 0x200},
- {0xAE, 0x01, 0x100},
-};
-static const struct CompressedSpriteSheet gUnknown_085E4C88[] =
-{
- {gIntro2BubblesGfx, 0x600, 1504},
- {NULL},
-};
-static const struct SpritePalette gUnknown_085E4C98[] =
-{
- {gIntro2BubblesPal, 1504},
- {NULL},
-};
-static const s16 gIntroKyogreBubbleData[][3] =
-{
- {0x42, 0x40, 0x1},
- {0x60, 0x60, 0x8},
- {0x80, 0x40, 0x1},
- {0x90, 0x30, 0x8},
- {0xA0, 0x48, 0x1},
- {0xB0, 0x60, 0x8},
- {0x60, 0x60, 0x4},
- {0x70, 0x68, 0x8},
- {0x80, 0x60, 0x4},
- {0x58, 0x20, 0x4},
- {0x68, 0x18, 0x8},
- {0x78, 0x20, 0x4},
-};
-static const struct OamData gUnknown_085E4CF0 =
-{
- .y = 160,
+ .callback = SpriteCB_Lightning,
+};
+// x coord, anim number, speed
+// Smaller anim numbers are larger rocks, and are given slower speeds
+static const s16 sGroudonRockData[][3] =
+{
+ {104, 0, 0x0C0},
+ {142, 3, 0x280},
+ { 83, 1, 0x180},
+ {155, 0, 0x080},
+ { 56, 2, 0x200},
+ {174, 1, 0x100},
+};
+static const struct CompressedSpriteSheet sSpriteSheet_Bubbles[] =
+{
+ {gIntroBubbles_Gfx, 0x600, TAG_BUBBLES},
+ {},
+};
+static const struct SpritePalette sSpritePalette_Bubbles[] =
+{
+ {gIntroBubbles_Pal, TAG_BUBBLES},
+ {},
+};
+#define NUM_BUBBLES_IN_SET 6
+// x coord, y coord, delay before animation
+// Can be produced in two different sets depending on the function called to create the sprites
+static const s16 sKyogreBubbleData[NUM_BUBBLES_IN_SET * 2][3] =
+{
+ // Set 1, for Kyogre's body
+ { 66, 64, 1},
+ { 96, 96, 8},
+ {128, 64, 1},
+ {144, 48, 8},
+ {160, 72, 1},
+ {176, 96, 8},
+ // Set 2, for Kyogre's fins
+ { 96, 96, 4},
+ {112, 104, 8},
+ {128, 96, 4},
+ { 88, 32, 4},
+ {104, 24, 8},
+ {120, 32, 4},
+};
+static const struct OamData sOamData_Bubbles =
+{
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -449,7 +530,7 @@ static const struct OamData gUnknown_085E4CF0 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4CF8[] =
+static const union AnimCmd sAnim_Bubbles[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(8, 4),
@@ -458,24 +539,23 @@ static const union AnimCmd gUnknown_085E4CF8[] =
ANIMCMD_FRAME(32, 4),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E4D10[] =
+static const union AnimCmd *const sAnims_Bubbles[] =
{
- gUnknown_085E4CF8,
+ sAnim_Bubbles,
};
-static void SpriteCB_IntroKyogreBubbles(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4D14 =
+static const struct SpriteTemplate sSpriteTemplate_Bubbles =
{
- .tileTag = 1504,
- .paletteTag = 1504,
- .oam = &gUnknown_085E4CF0,
- .anims = gUnknown_085E4D10,
+ .tileTag = TAG_BUBBLES,
+ .paletteTag = TAG_BUBBLES,
+ .oam = &sOamData_Bubbles,
+ .anims = sAnims_Bubbles,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = SpriteCB_IntroKyogreBubbles,
+ .callback = SpriteCB_KyogreBubbles,
};
-static const struct OamData gUnknown_085E4D2C =
+static const struct OamData sOamData_WaterDrop =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -489,45 +569,50 @@ static const struct OamData gUnknown_085E4D2C =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4D34[] =
+enum {
+ DROP_ANIM_UPPER_HALF,
+ DROP_ANIM_LOWER_HALF,
+ DROP_ANIM_REFLECTION,
+ DROP_ANIM_RIPPLE,
+};
+static const union AnimCmd sAnim_WaterDrop_UpperHalf[] =
{
ANIMCMD_FRAME(16, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4D3C[] =
+static const union AnimCmd sAnim_WaterDrop_LowerHalf[] =
{
ANIMCMD_FRAME(24, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4D44[] =
+static const union AnimCmd sAnim_WaterDrop_Reflection[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4D4C[] =
+static const union AnimCmd sAnim_WaterDrop_Ripple[] =
{
ANIMCMD_FRAME(48, 8),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E4D54[] =
+static const union AnimCmd *const sAnims_WaterDrop[] =
{
- gUnknown_085E4D34,
- gUnknown_085E4D3C,
- gUnknown_085E4D44,
- gUnknown_085E4D4C,
+ [DROP_ANIM_UPPER_HALF] = sAnim_WaterDrop_UpperHalf,
+ [DROP_ANIM_LOWER_HALF] = sAnim_WaterDrop_LowerHalf,
+ [DROP_ANIM_REFLECTION] = sAnim_WaterDrop_Reflection,
+ [DROP_ANIM_RIPPLE] = sAnim_WaterDrop_Ripple,
};
-static void sub_816F454(struct Sprite *sprite);
-static const struct SpriteTemplate gIntroWaterDropSprite =
+static const struct SpriteTemplate sSpriteTemplate_WaterDrop =
{
- .tileTag = 2000,
- .paletteTag = 2000,
- .oam = &gUnknown_085E4D2C,
- .anims = gUnknown_085E4D54,
+ .tileTag = GFXTAG_DROPS_LOGO,
+ .paletteTag = PALTAG_DROPS,
+ .oam = &sOamData_WaterDrop,
+ .anims = sAnims_WaterDrop,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816F454,
+ .callback = SpriteCB_WaterDrop,
};
-static const union AnimCmd gUnknown_085E4D7C[] =
+static const union AnimCmd sAnim_PlayerBicycle_Fast[] =
{
ANIMCMD_FRAME(0, 4),
ANIMCMD_FRAME(64, 4),
@@ -535,7 +620,7 @@ static const union AnimCmd gUnknown_085E4D7C[] =
ANIMCMD_FRAME(192, 4),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E4D90[] =
+static const union AnimCmd sAnim_PlayerBicycle_Slow[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(64, 8),
@@ -543,30 +628,36 @@ static const union AnimCmd gUnknown_085E4D90[] =
ANIMCMD_FRAME(192, 8),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd gUnknown_085E4DA4[] =
+// The below two animations appear to be copied from the Credits version
+// of the player graphic, where additional frames are present to show
+// the player turning around to look at their rival.
+// They go unused here, and if they were used they'd overflow beyond
+// the player graphics data.
+// The above sAnim_PlayerBicycle_Slow, while valid, is likewise unused
+static const union AnimCmd sAnim_PlayerBicycle_LookBack[] =
{
ANIMCMD_FRAME(256, 4),
- ANIMCMD_FRAME(0x140, 4),
- ANIMCMD_FRAME(0x180, 4),
+ ANIMCMD_FRAME(320, 4),
+ ANIMCMD_FRAME(384, 4),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4DB4[] =
+static const union AnimCmd sAnim_PlayerBicycle_LookForward[] =
{
- ANIMCMD_FRAME(0x180, 16),
- ANIMCMD_FRAME(0x140, 16),
+ ANIMCMD_FRAME(384, 16),
+ ANIMCMD_FRAME(320, 16),
ANIMCMD_FRAME(256, 16),
ANIMCMD_END,
};
-static const union AnimCmd *const gIntroBicycleAnimationCommands[] =
+static const union AnimCmd *const sAnims_PlayerBicycle[] =
{
- gUnknown_085E4D7C,
- gUnknown_085E4D90,
- gUnknown_085E4DA4,
- gUnknown_085E4DB4,
+ sAnim_PlayerBicycle_Fast,
+ sAnim_PlayerBicycle_Slow,
+ sAnim_PlayerBicycle_LookBack,
+ sAnim_PlayerBicycle_LookForward,
};
-static const struct OamData gUnknown_085E4DD4 =
+static const struct OamData sOamData_GameFreakLetter =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -580,9 +671,9 @@ static const struct OamData gUnknown_085E4DD4 =
.paletteNum = 0,
.affineParam = 0,
};
-static const struct OamData gUnknown_085E4DDC =
+static const struct OamData sOamData_PresentsLetter =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -596,9 +687,9 @@ static const struct OamData gUnknown_085E4DDC =
.paletteNum = 0,
.affineParam = 0,
};
-static const struct OamData gUnknown_085E4DE4 =
+static const struct OamData sOamData_GameFreakLogo =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_DOUBLE,
.objMode = ST_OAM_OBJ_BLEND,
.mosaic = 0,
@@ -612,193 +703,232 @@ static const struct OamData gUnknown_085E4DE4 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4DEC[] =
+static const union AnimCmd sAnim_GameFreakLetter_G[] =
{
ANIMCMD_FRAME(80, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4DF4[] =
+static const union AnimCmd sAnim_GameFreakLetter_A[] =
{
ANIMCMD_FRAME(84, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4DFC[] =
+static const union AnimCmd sAnim_GameFreakLetter_M[] =
{
ANIMCMD_FRAME(88, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E04[] =
+static const union AnimCmd sAnim_GameFreakLetter_E[] =
{
ANIMCMD_FRAME(92, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E0C[] =
+static const union AnimCmd sAnim_GameFreakLetter_F[] =
{
ANIMCMD_FRAME(96, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E14[] =
+static const union AnimCmd sAnim_GameFreakLetter_R[] =
{
ANIMCMD_FRAME(100, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E1C[] =
+static const union AnimCmd sAnim_GameFreakLetter_K[] =
{
ANIMCMD_FRAME(104, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E24[] =
+static const union AnimCmd sAnim_PresentsLetter_P[] =
{
ANIMCMD_FRAME(112, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E2C[] =
+static const union AnimCmd sAnim_PresentsLetter_R[] =
{
ANIMCMD_FRAME(113, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E34[] =
+static const union AnimCmd sAnim_PresentsLetter_E[] =
{
ANIMCMD_FRAME(114, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E3C[] =
+static const union AnimCmd sAnim_PresentsLetter_S[] =
{
ANIMCMD_FRAME(115, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E44[] =
+static const union AnimCmd sAnim_PresentsLetter_N[] =
{
ANIMCMD_FRAME(116, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E4C[] =
+static const union AnimCmd sAnim_PresentsLetter_T[] =
{
ANIMCMD_FRAME(117, 8),
ANIMCMD_END,
};
-static const union AnimCmd gUnknown_085E4E54[] =
+static const union AnimCmd sAnim_GameFreakLogo[] =
{
ANIMCMD_FRAME(128, 8),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E4E5C[] =
-{
- gUnknown_085E4DEC,
- gUnknown_085E4DF4,
- gUnknown_085E4DFC,
- gUnknown_085E4E04,
- gUnknown_085E4E0C,
- gUnknown_085E4E14,
- gUnknown_085E4E1C,
-};
-static const union AnimCmd *const gUnknown_085E4E78[] =
-{
- gUnknown_085E4E24,
- gUnknown_085E4E2C,
- gUnknown_085E4E34,
- gUnknown_085E4E3C,
- gUnknown_085E4E44,
- gUnknown_085E4E4C,
-};
-static const union AnimCmd *const gUnknown_085E4E90[] =
-{
- gUnknown_085E4E54,
-};
-static const s16 gUnknown_085E4E94[][2] =
-{
- {0, -72},
- {1, -56},
- {2, -40},
- {3, -24},
- {4, 8},
- {5, 24},
- {3, 40},
- {1, 56},
- {6, 72},
- {0, -28},
- {1, -20},
- {2, -12},
- {3, -4},
- {2, 4},
- {4, 12},
- {5, 20},
- {3, 28},
-};
-static const union AffineAnimCmd gUnknown_085E4ED8[] =
+
+enum {
+ GAMEFREAK_G,
+ GAMEFREAK_A,
+ GAMEFREAK_M,
+ GAMEFREAK_E,
+ GAMEFREAK_F,
+ GAMEFREAK_R,
+ GAMEFREAK_K,
+};
+enum {
+ PRESENTS_P,
+ PRESENTS_R,
+ PRESENTS_E,
+ PRESENTS_S,
+ PRESENTS_N,
+ PRESENTS_T,
+};
+static const union AnimCmd *const sAnims_GameFreakLetter[] =
+{
+ [GAMEFREAK_G] = sAnim_GameFreakLetter_G,
+ [GAMEFREAK_A] = sAnim_GameFreakLetter_A,
+ [GAMEFREAK_M] = sAnim_GameFreakLetter_M,
+ [GAMEFREAK_E] = sAnim_GameFreakLetter_E,
+ [GAMEFREAK_F] = sAnim_GameFreakLetter_F,
+ [GAMEFREAK_R] = sAnim_GameFreakLetter_R,
+ [GAMEFREAK_K] = sAnim_GameFreakLetter_K,
+};
+static const union AnimCmd *const sAnims_PresentsLetter[] =
+{
+ [PRESENTS_P] = sAnim_PresentsLetter_P,
+ [PRESENTS_R] = sAnim_PresentsLetter_R,
+ [PRESENTS_E] = sAnim_PresentsLetter_E,
+ [PRESENTS_S] = sAnim_PresentsLetter_S,
+ [PRESENTS_N] = sAnim_PresentsLetter_N,
+ [PRESENTS_T] = sAnim_PresentsLetter_T,
+};
+static const union AnimCmd *const sAnims_GameFreakLogo[] =
+{
+ sAnim_GameFreakLogo,
+};
+#define NUM_GF_LETTERS 9 // Letters in "Game Freak"
+static const s16 sGameFreakLetterData[NUM_GF_LETTERS][2] =
+{
+ // Letter, x offset
+ {GAMEFREAK_G, -72},
+ {GAMEFREAK_A, -56},
+ {GAMEFREAK_M, -40},
+ {GAMEFREAK_E, -24},
+ {GAMEFREAK_F, 8},
+ {GAMEFREAK_R, 24},
+ {GAMEFREAK_E, 40},
+ {GAMEFREAK_A, 56},
+ {GAMEFREAK_K, 72},
+};
+static const s16 sPresentsLetterData[][2] =
+{
+ // Letter, x offset
+ {PRESENTS_P, -28},
+ {PRESENTS_R, -20},
+ {PRESENTS_E, -12},
+ {PRESENTS_S, -4},
+ {PRESENTS_E, 4},
+ {PRESENTS_N, 12},
+ {PRESENTS_T, 20},
+ {PRESENTS_S, 28},
+};
+static const union AffineAnimCmd sAffineAnim_GameFreak_Small[] =
{
AFFINEANIMCMD_FRAME(128, 128, 0, 0),
AFFINEANIMCMD_END,
};
-static const union AffineAnimCmd gUnknown_085E4EE8[] =
+static const union AffineAnimCmd sAffineAnim_GameFreak_GrowAndShrink[] =
{
AFFINEANIMCMD_FRAME(128, 128, 0, 0),
AFFINEANIMCMD_FRAME(16, 16, 0, 16),
AFFINEANIMCMD_FRAME(-16, -16, 0, 8),
AFFINEANIMCMD_END,
};
-static const union AffineAnimCmd gUnknown_085E4F08[] =
+static const union AffineAnimCmd sAffineAnim_GameFreak_GrowBig[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
AFFINEANIMCMD_FRAME(8, 8, 0, 48),
AFFINEANIMCMD_END,
};
-static const union AffineAnimCmd gUnknown_085E4F20[] =
+static const union AffineAnimCmd sAffineAnim_GameFreak_GrowMedium[] =
{
AFFINEANIMCMD_FRAME(256, 256, 0, 0),
AFFINEANIMCMD_FRAME(2, 2, 0, 48),
AFFINEANIMCMD_END,
};
-static const union AffineAnimCmd *const gUnknown_085E4F38[] =
+static const union AffineAnimCmd *const sAffineAnims_GameFreak[] =
{
- gUnknown_085E4ED8,
- gUnknown_085E4EE8,
- gUnknown_085E4F08,
- gUnknown_085E4F20,
+ sAffineAnim_GameFreak_Small, // Initialize letters while still invisible
+ sAffineAnim_GameFreak_GrowAndShrink, // For letters appearing. Logo does this too, but while it's invisible
+ sAffineAnim_GameFreak_GrowBig, // For letters disappearing
+ sAffineAnim_GameFreak_GrowMedium, // For logo disappearing
};
-static const u16 gUnknown_085E4F48[] =
+static const u16 sGameFreakLettersMoveSpeed[NUM_GF_LETTERS] =
{
- 0x100, 0xC0, 0x80, 0x40, 0x00, 0x40, 0x80, 0xC0, 0x100
+ 256, // G
+ 192, // A
+ 128, // M
+ 64, // E
+ 0, // F
+ 64, // R
+ 128, // E
+ 192, // A
+ 256 // K
};
-static void sub_816FB38(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4F5C =
+static const struct SpriteTemplate sSpriteTemplate_GameFreakLetter =
{
- .tileTag = 2000,
- .paletteTag = 2001,
- .oam = &gUnknown_085E4DD4,
- .anims = gUnknown_085E4E5C,
+ .tileTag = GFXTAG_DROPS_LOGO,
+ .paletteTag = PALTAG_LOGO,
+ .oam = &sOamData_GameFreakLetter,
+ .anims = sAnims_GameFreakLetter,
.images = NULL,
- .affineAnims = gUnknown_085E4F38,
- .callback = sub_816FB38,
+ .affineAnims = sAffineAnims_GameFreak,
+ .callback = SpriteCB_LogoLetter,
};
-static const struct SpriteTemplate gUnknown_085E4F74 =
+// Unused
+static const struct SpriteTemplate sSpriteTemplate_PresentsLetter =
{
- .tileTag = 2000,
- .paletteTag = 2001,
- .oam = &gUnknown_085E4DDC,
- .anims = gUnknown_085E4E78,
+ .tileTag = GFXTAG_DROPS_LOGO,
+ .paletteTag = PALTAG_LOGO,
+ .oam = &sOamData_PresentsLetter,
+ .anims = sAnims_PresentsLetter,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816FB38,
+ .callback = SpriteCB_LogoLetter,
};
-static void sub_816FD44(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4F8C =
+static const struct SpriteTemplate sSpriteTemplate_GameFreakLogo =
{
- .tileTag = 2000,
- .paletteTag = 2001,
- .oam = &gUnknown_085E4DE4,
- .anims = gUnknown_085E4E90,
+ .tileTag = GFXTAG_DROPS_LOGO,
+ .paletteTag = PALTAG_LOGO,
+ .oam = &sOamData_GameFreakLogo,
+ .anims = sAnims_GameFreakLogo,
.images = NULL,
- .affineAnims = gUnknown_085E4F38,
- .callback = sub_816FD44,
+ .affineAnims = sAffineAnims_GameFreak,
+ .callback = SpriteCB_GameFreakLogo,
};
-static const u8 gUnknown_085E4FA4[] =
+static const u8 sGameFreakLetterStartDelays[NUM_GF_LETTERS] =
{
- 0x00, 0x17, 0x17, 0x31, 0x3E, 0x24, 0x24, 0x0A, 0x0A
+ 0, // G
+ 23, // A
+ 23, // M
+ 49, // E
+ 62, // F
+ 36, // R
+ 36, // E
+ 10, // A
+ 10 // K
};
-static const struct OamData gUnknown_085E4FB0 =
+static const struct OamData sOamData_FlygonSilhouette =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -812,46 +942,45 @@ static const struct OamData gUnknown_085E4FB0 =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E4FB8[] =
+static const union AnimCmd sAnim_FlygonSilhouette[] =
{
ANIMCMD_FRAME(0, 10),
ANIMCMD_JUMP(0),
};
-static const union AnimCmd *const gUnknown_085E4FC0[] =
+static const union AnimCmd *const sAnims_FlygonSilhouette[] =
{
- gUnknown_085E4FB8,
+ sAnim_FlygonSilhouette,
};
-static void sub_816FEDC(struct Sprite *sprite);
-static const struct SpriteTemplate gUnknown_085E4FC4 =
+static const struct SpriteTemplate sSpriteTemplate_FlygonSilhouette =
{
- .tileTag = 2002,
- .paletteTag = 2002,
- .oam = &gUnknown_085E4FB0,
- .anims = gUnknown_085E4FC0,
+ .tileTag = TAG_FLYGON_SILHOUETTE,
+ .paletteTag = TAG_FLYGON_SILHOUETTE,
+ .oam = &sOamData_FlygonSilhouette,
+ .anims = sAnims_FlygonSilhouette,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_816FEDC,
+ .callback = SpriteCB_FlygonSilhouette,
};
-static const struct CompressedSpriteSheet gIntroSpriteSheet_WaterDropAndLogo[] =
+static const struct CompressedSpriteSheet sSpriteSheet_WaterDropsAndLogo[] =
{
- {gIntroTiles, 0x1400, 2000},
- {NULL},
+ {sIntroDropsLogo_Gfx, 0x1400, GFXTAG_DROPS_LOGO},
+ {},
};
-static const struct CompressedSpriteSheet gIntroSpriteSheet_Flygon[] =
+static const struct CompressedSpriteSheet sSpriteSheet_FlygonSilhouette[] =
{
- {gIntro1FlygonGfx, 0x400, 2002},
- {NULL},
+ {gIntroFlygonSilhouette_Gfx, 0x400, TAG_FLYGON_SILHOUETTE},
+ {},
};
-static const struct SpritePalette gIntroPalette_DropLogoFlygon[] =
+static const struct SpritePalette sSpritePalettes_Intro1[] =
{
- {gIntro1DropsPal, 2000},
- {gIntro1GFLogoPal, 2001},
- {gIntro1FlygonPalette, 2002},
- {NULL},
+ {sIntroDrops_Pal, PALTAG_DROPS},
+ {sIntroLogo_Pal, PALTAG_LOGO},
+ {sIntroFlygonSilhouette_Pal, TAG_FLYGON_SILHOUETTE},
+ {},
};
-static const struct OamData gUnknown_085E501C =
+static const struct OamData sOamData_RayquazaOrb =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.mosaic = 0,
@@ -865,86 +994,36 @@ static const struct OamData gUnknown_085E501C =
.paletteNum = 0,
.affineParam = 0,
};
-static const union AnimCmd gUnknown_085E5024[] =
+static const union AnimCmd sAnim_RayquazaOrb[] =
{
ANIMCMD_FRAME(16, 8),
ANIMCMD_END,
};
-static const union AnimCmd *const gUnknown_085E502C[] =
+static const union AnimCmd *const sAnims_RayquazaOrb[] =
{
- gUnknown_085E5024,
+ sAnim_RayquazaOrb,
};
-static void SpriteCB_IntroRayquazaHyperbeam(struct Sprite *sprite);
-static const struct SpriteTemplate gIntroRayquazaHyperbeamSprite =
+static const struct SpriteTemplate sSpriteTemplate_RayquazaOrb =
{
- .tileTag = 2003,
- .paletteTag = 2003,
- .oam = &gUnknown_085E501C,
- .anims = gUnknown_085E502C,
+ .tileTag = TAG_RAYQUAZA_ORB,
+ .paletteTag = TAG_RAYQUAZA_ORB,
+ .oam = &sOamData_RayquazaOrb,
+ .anims = sAnims_RayquazaOrb,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = SpriteCB_IntroRayquazaHyperbeam,
+ .callback = SpriteCB_RayquazaOrb,
};
-static const struct CompressedSpriteSheet gIntroRayquazaGlowSpriteSheet[] =
+static const struct CompressedSpriteSheet sSpriteSheet_RayquazaOrb[] =
{
- {gIntro3MiscTiles, 0xA00, 2003},
- {NULL},
+ {sIntroMisc_Gfx, 0xA00, TAG_RAYQUAZA_ORB},
+ {},
};
-static const struct SpritePalette gIntroRayquazaGlowPalette[] =
+static const struct SpritePalette sSpritePalette_RayquazaOrb[] =
{
- {gIntro3Misc1Palette, 2003},
- {NULL},
+ {sIntroRayquzaOrb_Pal, TAG_RAYQUAZA_ORB},
+ {},
};
-// this file's functions
-static void MainCB2_EndIntro(void);
-static void Task_IntroLoadPart1Graphics(u8);
-static u8 CreateWaterDrop(s16, s16, u16, u16, u16, u8);
-static void Task_IntroFadeIn(u8);
-static void intro_reset_and_hide_bgs(void);
-static void Task_IntroWaterDrops(u8);
-static void Task_IntroWaterDrops_1(u8);
-static void Task_IntroWaterDrops_2(u8);
-static void Task_IntroWaterDrops_3(u8);
-static void Task_IntroScrollDownAndShowFlygon(u8);
-static void Task_IntroWaitToSetupPart2(u8);
-static void Task_IntroLoadPart2Graphics(u8);
-static void Task_IntroStartBikeRide(u8);
-static void Task_IntroHandleBikeAndFlygonMovement(u8);
-static void Task_IntroWaitToSetupPart3(u8);
-static void Task_IntroLoadPart3Graphics(u8);
-static void Task_IntroSpinAndZoomPokeball(u8);
-static void Task_IntroWaitToSetupPart3LegendsFight(u8);
-static void Task_IntroLoadGroudonScene(u8);
-static void Task_IntroLoadPart3Graphics1(u8);
-static void Task_IntroLoadPart3Graphics2(u8);
-static void Task_IntroLoadPart3Graphics3(u8);
-static void Task_IntroLoadPart3Graphics4(u8);
-static void Task_IntroGroudonScene(u8);
-static void Task_IntroLoadKyogreScene(u8);
-static void Task_IntroKyogreScene(u8);
-static void Task_IntroLoadClouds1(u8);
-static void Task_IntroLoadClouds2(u8);
-static void Task_IntroLoadClouds3(u8);
-static void Task_IntroCloudScene(u8);
-static void Task_IntroLoadRayquazaLightningScene(u8);
-static void Task_IntroRayquazaLightningScene(u8);
-static void Task_IntroLoadRayquazaGlowScene(u8);
-static void Task_IntroRayquazaGlowScene_0(u8);
-static void Task_EndIntroMovie(u8);
-static void CreateGroudonRockSprites(u8);
-static void SpriteCB_IntroGroudonRocks(struct Sprite *);
-static void CreateKyogreBubbleSprites_0(u8);
-static void CreateKyogreBubbleSprites_1(void);
-static void Task_IntroRayquazaGlowScene_1(u8);
-static void sub_816F46C(struct Sprite *);
-static void sub_816F5B4(struct Sprite *);
-static void sub_816F660(struct Sprite *);
-static void SpriteCB_WaterDropFall(struct Sprite *);
-static void sub_816F318(struct Sprite *);
-static void SpriteCB_IntroGraphicsBicycle(struct Sprite *);
-static void SpriteCB_IntroGraphicsFlygon(struct Sprite *);
-static u8 CreatePart1Animations(s16, s16, s16);
static void VBlankCB_Intro(void)
{
@@ -976,7 +1055,7 @@ static void LoadCopyrightGraphics(u16 tilesetAddress, u16 tilemapAddress, u16 pa
{
LZ77UnCompVram(gIntroCopyright_Gfx, (void *)(VRAM + tilesetAddress));
LZ77UnCompVram(gIntroCopyright_Tilemap, (void *)(VRAM + tilemapAddress));
- LoadPalette(gIntroCopyright_Pal, paletteAddress, 0x20);
+ LoadPalette(gIntroCopyright_Pal, paletteAddress, 32);
}
static void SerialCB_CopyrightScreen(void)
@@ -993,7 +1072,7 @@ static u8 SetUpCopyrightScreen(void)
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
- *(u16 *)PLTT = 0x7FFF;
+ *(u16 *)PLTT = RGB_WHITE;
SetGpuReg(REG_OFFSET_DISPCNT, 0);
SetGpuReg(REG_OFFSET_BG0HOFS, 0);
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
@@ -1006,7 +1085,7 @@ static u8 SetUpCopyrightScreen(void)
ResetTasks();
ResetSpriteData();
FreeAllSpritePalettes();
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(0)
| BGCNT_SCREENBASE(7)
@@ -1026,24 +1105,24 @@ static u8 SetUpCopyrightScreen(void)
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
if (gMultibootProgramStruct.gcmb_field_2 != 1)
{
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_BLACK);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
gMain.state++;
}
break;
case 141:
if (UpdatePaletteFade())
break;
- CreateTask(Task_IntroLoadPart1Graphics, 0);
+ CreateTask(Task_Scene1_Load, 0);
SetMainCallback2(MainCB2_Intro);
if (gMultibootProgramStruct.gcmb_field_2 != 0)
{
if (gMultibootProgramStruct.gcmb_field_2 == 2)
{
// check the multiboot ROM header game code to see if we already did this
- if (*(u32 *)(EWRAM_START + 0xAC) == 0x65366347) // "Gc6e" in ASCII
+ if (*(u32 *)(EWRAM_START + 0xAC) == COLOSSEUM_GAME_CODE)
{
CpuCopy16(&gMultiBootProgram_PokemonColosseum_Start, (void *)EWRAM_START, sizeof(gMultiBootProgram_PokemonColosseum_Start));
- *(u32 *)(EWRAM_START + 0xAC) = 0x65366347;
+ *(u32 *)(EWRAM_START + 0xAC) = COLOSSEUM_GAME_CODE;
}
GameCubeMultiBoot_ExecuteProgram(&gMultibootProgramStruct);
}
@@ -1079,408 +1158,482 @@ void CB2_InitCopyrightScreenAfterTitleScreen(void)
SetUpCopyrightScreen();
}
-static void Task_IntroLoadPart1Graphics(u8 taskId)
+#define sBigDropSpriteId data[0]
+
+static void Task_Scene1_Load(u8 taskId)
{
SetVBlankCallback(NULL);
- gIntroCharacterGender = Random() & 1;
- intro_reset_and_hide_bgs();
+ sIntroCharacterGender = Random() & 1;
+ IntroResetGpuRegs();
SetGpuReg(REG_OFFSET_BG3VOFS, 0);
- SetGpuReg(REG_OFFSET_BG2VOFS, 0x50);
- SetGpuReg(REG_OFFSET_BG1VOFS, 0x18);
- SetGpuReg(REG_OFFSET_BG0VOFS, 0x28);
- LZ77UnCompVram(gIntro1BGLeavesGfx, (void *)VRAM);
- LZ77UnCompVram(gIntro1BG0_Tilemap, (void *)(BG_CHAR_ADDR(2)));
- DmaClear16(3, BG_SCREEN_ADDR(17), 0x800);
- LZ77UnCompVram(gIntro1BG1_Tilemap, (void *)(BG_SCREEN_ADDR(18)));
- DmaClear16(3, BG_SCREEN_ADDR(19), 0x800);
- LZ77UnCompVram(gIntro1BG2_Tilemap, (void *)(BG_SCREEN_ADDR(20)));
- DmaClear16(3, BG_SCREEN_ADDR(21), 0x800);
- LZ77UnCompVram(gIntro1BG3_Tilemap, (void *)(BG_SCREEN_ADDR(22)));
- DmaClear16(3, BG_SCREEN_ADDR(23), 0x800);
- LoadPalette(gIntro1BGPals, 0, sizeof(gIntro1BGPals));
+ SetGpuReg(REG_OFFSET_BG2VOFS, 80);
+ SetGpuReg(REG_OFFSET_BG1VOFS, 24);
+ SetGpuReg(REG_OFFSET_BG0VOFS, 40);
+ LZ77UnCompVram(sIntro1Bg_Gfx, (void *)VRAM);
+ LZ77UnCompVram(sIntro1Bg0_Tilemap, (void *)(BG_CHAR_ADDR(2)));
+ DmaClear16(3, BG_SCREEN_ADDR(17), BG_SCREEN_SIZE);
+ LZ77UnCompVram(sIntro1Bg1_Tilemap, (void *)(BG_SCREEN_ADDR(18)));
+ DmaClear16(3, BG_SCREEN_ADDR(19), BG_SCREEN_SIZE);
+ LZ77UnCompVram(sIntro1Bg2_Tilemap, (void *)(BG_SCREEN_ADDR(20)));
+ DmaClear16(3, BG_SCREEN_ADDR(21), BG_SCREEN_SIZE);
+ LZ77UnCompVram(sIntro1Bg3_Tilemap, (void *)(BG_SCREEN_ADDR(22)));
+ DmaClear16(3, BG_SCREEN_ADDR(23), BG_SCREEN_SIZE);
+ LoadPalette(sIntro1Bg_Pal, 0, sizeof(sIntro1Bg_Pal));
SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(22) | BGCNT_16COLOR | BGCNT_TXT256x512);
SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(20) | BGCNT_16COLOR | BGCNT_TXT256x512);
SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(18) | BGCNT_16COLOR | BGCNT_TXT256x512);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(16) | BGCNT_16COLOR | BGCNT_TXT256x512);
- LoadCompressedSpriteSheet(gIntroSpriteSheet_WaterDropAndLogo);
- LoadCompressedSpriteSheet(gIntroSpriteSheet_Flygon);
- LoadSpritePalettes(gIntroPalette_DropLogoFlygon);
- LoadCompressedSpriteSheet(gIntroSpriteSheet_Sparkle);
- LoadSpritePalettes(gIntroPalette_Lightning);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1F0, 0x20);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1E1, 0x1E);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1D2, 0x1C);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1C3, 0x1A);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1B4, 0x18);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x1A5, 0x16);
- CpuCopy16(gPlttBufferUnfaded + 0x100, gPlttBufferUnfaded + 0x196, 0x14);
- CreatePart1Animations(0x78, 0x50, 0);
- gTasks[taskId].data[0] = CreateWaterDrop(236, -14, 0x200, 1, 0x78, FALSE);
- gTasks[taskId].func = Task_IntroFadeIn;
-}
-
-static void Task_IntroFadeIn(u8 taskId)
+ LoadCompressedSpriteSheet(sSpriteSheet_WaterDropsAndLogo);
+ LoadCompressedSpriteSheet(sSpriteSheet_FlygonSilhouette);
+ LoadSpritePalettes(sSpritePalettes_Intro1);
+ LoadCompressedSpriteSheet(sSpriteSheet_Sparkle);
+ LoadSpritePalettes(sSpritePalette_Sparkle);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1F0], 0x20);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1E1], 0x1E);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1D2], 0x1C);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1C3], 0x1A);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1B4], 0x18);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x1A5], 0x16);
+ CpuCopy16(&gPlttBufferUnfaded[0x100], &gPlttBufferUnfaded[0x196], 0x14);
+ CreateGameFreakLogoSprites(120, 80, 0);
+ gTasks[taskId].sBigDropSpriteId = CreateWaterDrop(236, -14, 0x200, 1, 0x78, FALSE);
+ gTasks[taskId].func = Task_Scene1_FadeIn;
+}
+
+static void Task_Scene1_FadeIn(u8 taskId)
{
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
SetVBlankCallback(VBlankCB_Intro);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON);
- gTasks[taskId].func = Task_IntroWaterDrops;
+ gTasks[taskId].func = Task_Scene1_WaterDrops;
gIntroFrameCounter = 0;
m4aSongNumStart(MUS_INTRO);
ResetSerial();
}
-static void Task_IntroWaterDrops(u8 taskId)
+// Task data for Task_Scene1_PanUp
+#define tBg2PosHi data[1]
+#define tBg2PosLo data[2]
+#define tBg1PosHi data[3]
+#define tBg1PosLo data[4]
+#define tBg3PosHi data[5]
+#define tBg3PosLo data[6]
+
+static void Task_Scene1_WaterDrops(u8 taskId)
{
- //start moving rock
- if (gIntroFrameCounter == 76)
- gSprites[gTasks[taskId].data[0]].data[0] = 1;
+ if (gIntroFrameCounter == TIMER_BIG_DROP_START)
+ gSprites[gTasks[taskId].sBigDropSpriteId].sState = 1;
- if (gIntroFrameCounter == 128)
- CreateTask(Task_IntroWaterDrops_1, 0);
+ if (gIntroFrameCounter == TIMER_LOGO_APPEAR)
+ CreateTask(Task_BlendLogoIn, 0);
- //drop rock
- if (gIntroFrameCounter == 251)
- gSprites[gTasks[taskId].data[0]].data[0] = 2;
+ if (gIntroFrameCounter == TIMER_BIG_DROP_FALLS)
+ gSprites[gTasks[taskId].sBigDropSpriteId].sState = 2;
- if (gIntroFrameCounter == 256)
- CreateTask(Task_IntroWaterDrops_2, 0);
+ if (gIntroFrameCounter == TIMER_LOGO_BLEND_OUT)
+ CreateTask(Task_BlendLogoOut, 0);
- if (gIntroFrameCounter == 368)
+ if (gIntroFrameCounter == TIMER_SMALL_DROP_1)
CreateWaterDrop(48, 0, 0x400, 5, 0x70, TRUE);
- if (gIntroFrameCounter == 384)
+ if (gIntroFrameCounter == TIMER_SMALL_DROP_2)
CreateWaterDrop(200, 60, 0x400, 9, 0x80, TRUE);
- if (gIntroFrameCounter == 560)
- CreateTask(Task_IntroWaterDrops_3, 0);
+ if (gIntroFrameCounter == TIMER_SPARKLES)
+ CreateTask(Task_CreateSparkles, 0);
- if (gIntroFrameCounter > 560)
+ if (gIntroFrameCounter > TIMER_SPARKLES)
{
- gTasks[taskId].data[1] = 0x50;
- gTasks[taskId].data[2] = 0;
- gTasks[taskId].data[3] = 0x18;
- gTasks[taskId].data[4] = 0;
- gTasks[taskId].data[5] = 0x28;
- gTasks[taskId].data[6] = 0;
- gTasks[taskId].func = Task_IntroScrollDownAndShowFlygon;
+ gTasks[taskId].tBg2PosHi = 80;
+ gTasks[taskId].tBg2PosLo = 0;
+ gTasks[taskId].tBg1PosHi = 24;
+ gTasks[taskId].tBg1PosLo = 0;
+ gTasks[taskId].tBg3PosHi = 40;
+ gTasks[taskId].tBg3PosLo = 0;
+ gTasks[taskId].func = Task_Scene1_PanUp;
}
}
-static void Task_IntroWaterDrops_3(u8 taskId)
+#define tDelay data[1]
+#define tTimer data[2]
+#define tTimerSteps data[3]
+#define tNumSparkles data[4]
+
+static void Task_CreateSparkles(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- if (++data[2] & 1)
- data[3]++;
- switch (data[0])
+ if (++tTimer & 1)
+ tTimerSteps++;
+
+ switch (tState)
{
case 0:
- CreateSprite(&gUnknown_085E4AB8, gUnknown_085E4AD0[data[4]][0], gUnknown_085E4AD0[data[4]][1] + data[3], 0);
- data[0]++;
- data[1] = 0xC;
- data[4]++;
+ CreateSprite(&sSpriteTemplate_Sparkle, sSparkleCoords[tNumSparkles][0], sSparkleCoords[tNumSparkles][1] + tTimerSteps, 0);
+ tState++;
+ tDelay = 12;
+ tNumSparkles++;
break;
case 1:
- if (!--data[1])
- data[0] = 0;
+ if (--tDelay == 0)
+ tState = 0;
break;
}
- if (data[3] > 0x3C)
+ if (tTimerSteps > 60)
DestroyTask(taskId);
}
-static void sub_816D338(struct Sprite *sprite)
+#undef tDelay
+#undef tTimer
+#undef tTimerSteps
+#undef tNumSparkles
+
+#define sTimer data[0]
+static void SpriteCB_Sparkle(struct Sprite *sprite)
{
- if (++sprite->data[0] == 0xC)
+ if (++sprite->sTimer == 12)
DestroySprite(sprite);
}
+#undef sTimer
-static void Task_IntroScrollDownAndShowFlygon(u8 taskId)
+static void Task_Scene1_PanUp(u8 taskId)
{
- if (gIntroFrameCounter < 904)
+ if (gIntroFrameCounter < TIMER_END_PAN_UP)
{
- s32 r2;
-
- //slide backgrounds downward
- r2 = (gTasks[taskId].data[1] << 16) + (u16)gTasks[taskId].data[2];
- r2 -= 0x6000;
- gTasks[taskId].data[1] = r2 >> 16;
- gTasks[taskId].data[2] = r2;
- SetGpuReg(REG_OFFSET_BG2VOFS, gTasks[taskId].data[1]);
- r2 = (gTasks[taskId].data[3] << 16) + (u16)gTasks[taskId].data[4];
- r2 -= 0x8000;
- gTasks[taskId].data[3] = r2 >> 16;
- gTasks[taskId].data[4] = r2;
- SetGpuReg(REG_OFFSET_BG1VOFS, gTasks[taskId].data[3]);
- r2 = (gTasks[taskId].data[5] << 16) + (u16)gTasks[taskId].data[6];
- r2 -= 0xC000;
- gTasks[taskId].data[5] = r2 >> 16;
- gTasks[taskId].data[6] = r2;
- SetGpuReg(REG_OFFSET_BG0VOFS, gTasks[taskId].data[5]);
-
- //show Flygon sprite
- if (gIntroFrameCounter == 832)
- {
- u8 spriteId = CreateSprite(&gUnknown_085E4FC4, 120, 160, 10);
+ s32 offset;
+
+ // Slide bg 2 downward
+ offset = (gTasks[taskId].tBg2PosHi << 16) + (u16)gTasks[taskId].tBg2PosLo;
+ offset -= 0x6000;
+ gTasks[taskId].tBg2PosHi = offset >> 16;
+ gTasks[taskId].tBg2PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG2VOFS, gTasks[taskId].tBg2PosHi);
+
+ // Slide bg 1 downward
+ offset = (gTasks[taskId].tBg1PosHi << 16) + (u16)gTasks[taskId].tBg1PosLo;
+ offset -= 0x8000;
+ gTasks[taskId].tBg1PosHi = offset >> 16;
+ gTasks[taskId].tBg1PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG1VOFS, gTasks[taskId].tBg1PosHi);
+
+ // Slide bg 3 downward
+ offset = (gTasks[taskId].tBg3PosHi << 16) + (u16)gTasks[taskId].tBg3PosLo;
+ offset -= 0xC000;
+ gTasks[taskId].tBg3PosHi = offset >> 16;
+ gTasks[taskId].tBg3PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG0VOFS, gTasks[taskId].tBg3PosHi);
+
+ if (gIntroFrameCounter == TIMER_FLYGON_SILHOUETTE_APPEAR)
+ {
+ // Show Flygon silhouette
+ u8 spriteId = CreateSprite(&sSpriteTemplate_FlygonSilhouette, 120, DISPLAY_HEIGHT, 10);
gSprites[spriteId].invisible = TRUE;
}
}
else
{
- //fade to white
- if (gIntroFrameCounter > 1007)
+ if (gIntroFrameCounter > TIMER_END_SCENE_1)
{
+ // Fade to white
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA);
- gTasks[taskId].func = Task_IntroWaitToSetupPart2;
+ gTasks[taskId].func = Task_Scene1_End;
}
}
}
-static void Task_IntroWaitToSetupPart2(u8 taskId)
+static void Task_Scene1_End(u8 taskId)
{
- if (gIntroFrameCounter > 1026)
- gTasks[taskId].func = Task_IntroLoadPart2Graphics;
+ if (gIntroFrameCounter > TIMER_START_SCENE_2)
+ gTasks[taskId].func = Task_Scene2_Load;
}
-static void Task_IntroLoadPart2Graphics(u8 taskId)
+static void Task_Scene2_Load(u8 taskId)
{
- intro_reset_and_hide_bgs();
+ IntroResetGpuRegs();
SetVBlankCallback(NULL);
ResetSpriteData();
FreeAllSpritePalettes();
- gUnknown_0203BD24 = 0;
- gUnknown_0203BD26 = 0;
- gIntroGraphicsFlygonYOffset = 0;
- load_intro_part2_graphics(1);
- gTasks[taskId].func = Task_IntroStartBikeRide;
+ gIntroCredits_MovingSceneryVBase = 0;
+ gIntroCredits_MovingSceneryVOffset = 0;
+ sFlygonYOffset = 0;
+ LoadIntroPart2Graphics(1);
+ gTasks[taskId].func = Task_Scene2_CreateSprites;
}
-static void Task_IntroStartBikeRide(u8 taskId)
+#define tBgAnimTaskId data[0]
+#define tPlayerSpriteId data[1]
+#define tFlygonSpriteId data[2]
+#define tFlygonTimer data[3]
+
+static void Task_Scene2_CreateSprites(u8 taskId)
{
u8 spriteId;
- if (gIntroCharacterGender == 0)
- LoadCompressedSpriteSheet(gIntro2BrendanSpriteSheet);
+ // Load sprite sheets
+ if (sIntroCharacterGender == MALE)
+ LoadCompressedSpriteSheet(gSpriteSheet_IntroBrendan);
else
- LoadCompressedSpriteSheet(gIntro2MaySpriteSheet);
+ LoadCompressedSpriteSheet(gSpriteSheet_IntroMay);
- LoadCompressedSpriteSheet(gIntro2BicycleSpriteSheet);
- LoadCompressedSpriteSheet(gIntro2FlygonSpriteSheet);
+ LoadCompressedSpriteSheet(gSpriteSheet_IntroBicycle);
+ LoadCompressedSpriteSheet(gSpriteSheet_IntroFlygon);
- for (spriteId = 0; spriteId < 3; spriteId++)
- {
- LoadCompressedSpriteSheet(&gIntroPokemonRunningSpriteSheet[spriteId]);
- }
+ // Load sprite palettes
+ for (spriteId = 0; spriteId < ARRAY_COUNT(sSpriteSheet_RunningPokemon) - 1; spriteId++)
+ LoadCompressedSpriteSheet(&sSpriteSheet_RunningPokemon[spriteId]);
- LoadSpritePalettes(gIntroBikeAndFlygonPalette);
- LoadSpritePalettes(gIntroPokemonRunningPalette);
- CreateSprite(&gUnknown_085E4BDC, 0x110, 0x80, 0);
- CreateSprite(&gUnknown_085E4BA4, 0x120, 0x6E, 1);
+ LoadSpritePalettes(gSpritePalettes_IntroPlayerFlygon);
+ LoadSpritePalettes(sSpritePalettes_RunningPokemon);
- if (gIntroCharacterGender == 0)
- spriteId = intro_create_brendan_sprite(0x110, 100);
+ // Create Pokémon and player sprites
+ CreateSprite(&sSpriteTemplate_Manectric, DISPLAY_WIDTH + 32, 128, 0);
+ CreateSprite(&sSpriteTemplate_Torchic, DISPLAY_WIDTH + 48, 110, 1);
+
+ if (sIntroCharacterGender == MALE)
+ spriteId = CreateIntroBrendanSprite(DISPLAY_WIDTH + 32, 100);
else
- spriteId = intro_create_may_sprite(0x110, 100);
-
- gSprites[spriteId].callback = SpriteCB_IntroGraphicsBicycle;
- gSprites[spriteId].anims = gIntroBicycleAnimationCommands;
- gTasks[taskId].data[1] = spriteId;
- CreateSprite(&gUnknown_085E4B40, 0x110, 0x50, 0x4);
- spriteId = intro_create_flygon_sprite(-0x40, 0x3C);
- gSprites[spriteId].callback = SpriteCB_IntroGraphicsFlygon;
- gTasks[taskId].data[2] = spriteId;
+ spriteId = CreateIntroMaySprite(DISPLAY_WIDTH + 32, 100);
+
+ gSprites[spriteId].callback = SpriteCB_PlayerOnBicycle;
+ gSprites[spriteId].anims = sAnims_PlayerBicycle;
+ gTasks[taskId].tPlayerSpriteId = spriteId;
+ CreateSprite(&sSpriteTemplate_Volbeat, DISPLAY_WIDTH + 32, 80, 4);
+ spriteId = CreateIntroFlygonSprite(-64, 60);
+ gSprites[spriteId].callback = SpriteCB_Flygon;
+ gTasks[taskId].tFlygonSpriteId = spriteId;
+
+ // Fade in and start bike ride
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
SetVBlankCallback(VBlankCB_Intro);
- gTasks[taskId].data[0] = CreateBicycleAnimationTask(1, 0x4000, 0x400, 0x10);
- sub_817B150(1);
- gTasks[taskId].func = Task_IntroHandleBikeAndFlygonMovement;
+ gTasks[taskId].tBgAnimTaskId = CreateBicycleBgAnimationTask(1, 0x4000, 0x400, 0x10);
+ SetIntroPart2BgCnt(1);
+ gTasks[taskId].func = Task_Scene2_BikeRide;
}
-static void Task_IntroHandleBikeAndFlygonMovement(u8 taskId)
+static void Task_Scene2_BikeRide(u8 taskId)
{
u16 offset;
- if (gIntroFrameCounter == 1856)
+ if (gIntroFrameCounter == TIMER_TORCHIC_EXIT)
{
- gUnknown_0203BD28 = 2;
- // Destroys the CreateBicycleAnimationTask created earlier.
- DestroyTask(gTasks[taskId].data[0]);
+ // Stop the moving scenery/backgrounds, for when the camera fixes on Torchic
+ gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_FROZEN;
+ DestroyTask(gTasks[taskId].tBgAnimTaskId);
}
- if (gIntroFrameCounter > 1946)
+
+ if (gIntroFrameCounter > TIMER_END_SCENE_2)
{
+ // Fade out to next scene
BeginNormalPaletteFade(PALETTES_ALL, 8, 0, 16, RGB_WHITEALPHA);
- gTasks[taskId].func = Task_IntroWaitToSetupPart3;
+ gTasks[taskId].func = Task_Scene2_End;
}
- if (gIntroFrameCounter == 1109)
- gSprites[gTasks[taskId].data[1]].data[0] = 1;
- if (gIntroFrameCounter == 1214)
- gSprites[gTasks[taskId].data[1]].data[0] = 0;
- if (gIntroFrameCounter == 1394)
- gSprites[gTasks[taskId].data[2]].data[0] = 1;
- if (gIntroFrameCounter == 1398)
- gSprites[gTasks[taskId].data[1]].data[0] = 2;
- if (gIntroFrameCounter == 1576)
- gSprites[gTasks[taskId].data[1]].data[0] = 3;
- if (gIntroFrameCounter == 1727)
- gSprites[gTasks[taskId].data[1]].data[0] = 4;
-
- offset = Sin(gTasks[taskId].data[3] >> 2 & 0x7F, 48);
- gIntroGraphicsFlygonYOffset = offset;
- if (gTasks[taskId].data[3] < 512)
- gTasks[taskId].data[3]++;
- sub_817B540(0);
-}
-static void Task_IntroWaitToSetupPart3(u8 taskId)
-{
- if (gIntroFrameCounter > 2068)
- gTasks[taskId].func = Task_IntroLoadPart3Graphics;
-}
-
-static void sub_816D81C(struct Sprite *sprite)
-{
- sprite->data[3] += 4;
- switch (sprite->data[0])
+ // Check for updates to player/flygon sprites
+ // These states are for SpriteCB_PlayerOnBicycle and SpriteCB_Flygon respectively
+ if (gIntroFrameCounter == TIMER_PLAYER_DRIFT_BACK)
+ gSprites[gTasks[taskId].tPlayerSpriteId].sState = 1;
+ if (gIntroFrameCounter == TIMER_PLAYER_MOVE_FORWARD)
+ gSprites[gTasks[taskId].tPlayerSpriteId].sState = 0;
+ if (gIntroFrameCounter == TIMER_FLYGON_ENTER)
+ gSprites[gTasks[taskId].tFlygonSpriteId].sState = 1;
+ if (gIntroFrameCounter == TIMER_PLAYER_MOVE_BACKWARD)
+ gSprites[gTasks[taskId].tPlayerSpriteId].sState = 2;
+ if (gIntroFrameCounter == TIMER_PLAYER_HOLD_POSITION)
+ gSprites[gTasks[taskId].tPlayerSpriteId].sState = 3;
+ if (gIntroFrameCounter == TIMER_PLAYER_EXIT)
+ gSprites[gTasks[taskId].tPlayerSpriteId].sState = 4;
+
+ // Handle flygon's y movement
+ offset = Sin(gTasks[taskId].tFlygonTimer >> 2 & 0x7F, 48);
+ sFlygonYOffset = offset;
+ if (gTasks[taskId].tFlygonTimer < 512)
+ gTasks[taskId].tFlygonTimer++;
+
+ // Alternate colors of the trees
+ CycleSceneryPalette(0);
+}
+
+static void Task_Scene2_End(u8 taskId)
+{
+ if (gIntroFrameCounter > TIMER_START_SCENE_3)
+ gTasks[taskId].func = Task_Scene3_Load;
+}
+
+#define sStateDelay data[1]
+#define sNextState data[2]
+#define sCosYIdx data[3]
+#define sSinXIdx data[4]
+#define sSinYIdx data[5]
+#define sFig8Loops data[6]
+
+enum {
+ VOLBEAT_WAIT_ENTER,
+ VOLBEAT_ENTER,
+ VOLBEAT_ZIP_BACKWARD,
+ VOLBEAT_ZIP_DOWN,
+ VOLBEAT_ZIP_FORWARD,
+ VOLBEAT_INIT_FIGURE_8,
+ VOLBEAT_FIGURE_8,
+ VOLBEAT_EXIT,
+ VOLBEAT_WAIT_STATE
+};
+
+static void SpriteCB_Volbeat(struct Sprite *sprite)
+{
+ sprite->sCosYIdx += 4;
+ switch (sprite->sState)
{
- case 0:
- if (++sprite->data[1] < 180)
+ case VOLBEAT_WAIT_ENTER:
+ if (++sprite->sStateDelay < 180)
break;
- ++sprite->data[0];
- case 1:
+ sprite->sState++;
+ // fallthrough
+ case VOLBEAT_ENTER:
sprite->pos1.x -= 4;
- if (sprite->pos1.x == 0x3C)
+ if (sprite->pos1.x == 60)
{
- sprite->data[0] = 8;
- sprite->data[1] = 20;
- sprite->data[2] = 2;
+ sprite->sState = VOLBEAT_WAIT_STATE;
+ sprite->sStateDelay = 20;
+ sprite->sNextState = VOLBEAT_ZIP_BACKWARD;
}
break;
- case 2:
+ case VOLBEAT_ZIP_BACKWARD:
sprite->pos1.x += 8;
sprite->pos1.y -= 2;
- if (sprite->pos1.x == 0x7C)
+ if (sprite->pos1.x == 124)
{
- sprite->data[0] = 8;
- sprite->data[1] = 20;
- sprite->data[2] = 3;
+ sprite->sState = VOLBEAT_WAIT_STATE;
+ sprite->sStateDelay = 20;
+ sprite->sNextState = VOLBEAT_ZIP_DOWN;
}
break;
- case 3:
+ case VOLBEAT_ZIP_DOWN:
sprite->pos1.y += 4;
- if (sprite->pos1.y == 0x50)
+ if (sprite->pos1.y == 80)
{
- sprite->data[0] = 8;
- sprite->data[1] = 10;
- sprite->data[2] = 4;
+ sprite->sState = VOLBEAT_WAIT_STATE;
+ sprite->sStateDelay = 10;
+ sprite->sNextState = VOLBEAT_ZIP_FORWARD;
}
break;
- case 4:
+ case VOLBEAT_ZIP_FORWARD:
sprite->pos1.x -= 8;
sprite->pos1.y -= 2;
- if (sprite->pos1.x == 0x3C)
- {
- sprite->data[0] = 8;
- sprite->data[1] = 10;
- sprite->data[2] = 5;
- }
- break;
- case 5:
- sprite->pos1.x += 0x3C;
- sprite->data[4] = 0xC0;
- sprite->data[5] = 0x80;
- sprite->data[6] = 0x3;
- sprite->data[0]++;
- case 6:
- sprite->pos2.x = Sin((u8)sprite->data[4], 0x3C);
- sprite->pos2.y = Sin((u8)sprite->data[5], 0x14);
- sprite->data[4] += 2;
- sprite->data[5] += 4;
- if ((sprite->data[4] & 0xFF) == 0x40)
+ if (sprite->pos1.x == 60)
+ {
+ sprite->sState = VOLBEAT_WAIT_STATE;
+ sprite->sStateDelay = 10;
+ sprite->sNextState = VOLBEAT_INIT_FIGURE_8;
+ }
+ break;
+ case VOLBEAT_INIT_FIGURE_8:
+ sprite->pos1.x += 60;
+ sprite->sSinXIdx = 0xC0;
+ sprite->sSinYIdx = 0x80;
+ sprite->sFig8Loops = 3;
+ sprite->sState++;
+ // fallthrough
+ case VOLBEAT_FIGURE_8:
+ sprite->pos2.x = Sin((u8)sprite->sSinXIdx, 0x3C);
+ sprite->pos2.y = Sin((u8)sprite->sSinYIdx, 0x14);
+ sprite->sSinXIdx += 2;
+ sprite->sSinYIdx += 4;
+ if ((sprite->sSinXIdx & 0xFF) == 64)
{
sprite->hFlip = FALSE;
- if (!--sprite->data[6])
+ if (--sprite->sFig8Loops == 0)
{
sprite->pos1.x += sprite->pos2.x;
sprite->pos2.x = 0;
- sprite->data[0]++;
+ sprite->sState++;
}
}
break;
- case 7:
+ case VOLBEAT_EXIT:
sprite->pos1.x -= 2;
- sprite->pos2.y = Sin((u8)sprite->data[5], 0x14);
- sprite->data[5] += 4;
+ sprite->pos2.y = Sin((u8)sprite->sSinYIdx, 0x14);
+ sprite->sSinYIdx += 4;
if (sprite->pos1.x < -16)
DestroySprite(sprite);
break;
- case 8:
- sprite->pos2.y = Cos((u8)sprite->data[3], 2);
- if (!--sprite->data[1])
- sprite->data[0] = sprite->data[2];
+ case VOLBEAT_WAIT_STATE:
+ // Wait for state progression, fly idly until then
+ sprite->pos2.y = Cos((u8)sprite->sCosYIdx, 2);
+ if (!--sprite->sStateDelay)
+ sprite->sState = sprite->sNextState;
break;
}
}
-static void sub_816D9C0(struct Sprite *sprite)
+#undef sStateDelay
+#undef sNextState
+#undef sCosYIdx
+#undef sSinXIdx
+#undef sSinYIdx
+#undef sFig8Loops
+
+#define sMoveTimer data[1]
+#define sDelay data[2]
+
+static void SpriteCB_Torchic(struct Sprite *sprite)
{
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
- if (gIntroFrameCounter == 1224)
+ if (gIntroFrameCounter == TIMER_TORCHIC_ENTER)
{
- StartSpriteAnim(sprite, 1);
- sprite->data[0]++;
+ StartSpriteAnim(sprite, TORCHIC_ANIM_RUN);
+ sprite->sState++;
}
break;
case 1:
- if (gIntroFrameCounter == 1576)
+ if (gIntroFrameCounter == TIMER_PLAYER_HOLD_POSITION)
{
- StartSpriteAnim(sprite, 0);
- sprite->data[0]++;
+ StartSpriteAnim(sprite, TORCHIC_ANIM_WALK);
+ sprite->sState++;
}
else
{
- sprite->data[1] += 0x40;
- if (sprite->data[1] & 0xFF00)
+ sprite->sMoveTimer += 64;
+ if (sprite->sMoveTimer & 0xFF00)
{
sprite->pos1.x--;
- sprite->data[1] &= 0xFF;
+ sprite->sMoveTimer &= 0xFF;
}
}
break;
case 2:
- if (gIntroFrameCounter != 1735)
+ if (gIntroFrameCounter != TIMER_TORCHIC_SPEED_UP)
{
- sprite->data[1] += 0x20;
- if (sprite->data[1] & 0xFF00)
+ sprite->sMoveTimer += 32;
+ if (sprite->sMoveTimer & 0xFF00)
{
sprite->pos1.x++;
- sprite->data[1] &= 0xFF;
+ sprite->sMoveTimer &= 0xFF;
}
}
else
{
- StartSpriteAnim(sprite, 1);
- sprite->data[0]++;
- sprite->data[2] = 0x50;
+ StartSpriteAnim(sprite, TORCHIC_ANIM_RUN);
+ sprite->sState++;
+ sprite->sDelay = 80;
}
break;
case 3:
- if (--sprite->data[2])
+ if (--sprite->sDelay)
{
- sprite->data[1] += 0x40;
- if (sprite->data[1] & 0xFF00)
+ sprite->sMoveTimer += 64;
+ if (sprite->sMoveTimer & 0xFF00)
{
sprite->pos1.x--;
- sprite->data[1] &= 0xFF;
+ sprite->sMoveTimer &= 0xFF;
}
}
else
{
- StartSpriteAnim(sprite, 2);
- sprite->data[0]++;
+ StartSpriteAnim(sprite, TORCHIC_ANIM_TRIP);
+ sprite->sState++;
}
break;
case 4:
@@ -1489,129 +1642,155 @@ static void sub_816D9C0(struct Sprite *sprite)
if (sprite->pos1.x > 336)
{
- StartSpriteAnim(sprite, 1);
- sprite->data[0]++;
+ StartSpriteAnim(sprite, TORCHIC_ANIM_RUN);
+ sprite->sState++;
}
break;
case 5:
- if (gIntroFrameCounter > 1855)
+ if (gIntroFrameCounter >= TIMER_TORCHIC_EXIT)
sprite->pos1.x -= 2;
break;
}
}
-static void sub_816DAE8(struct Sprite *sprite)
+#undef sMoveTimer
+#undef sDelay
+
+#define sSinIdx data[1]
+#define sCosIdx data[2]
+
+static void SpriteCB_Manectric(struct Sprite *sprite)
{
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
- if (gIntroFrameCounter == 1088)
- sprite->data[0]++;
+ if (gIntroFrameCounter == TIMER_MANECTRIC_ENTER)
+ sprite->sState++;
break;
case 1:
sprite->pos1.x -= 2;
- if (gIntroFrameCounter != 1168)
+ if (gIntroFrameCounter != TIMER_MANECTRIC_RUN_CIRCULAR)
break;
+
+ // Initialize circular pattern running
sprite->pos1.y -= 12;
- sprite->data[1] = 0x80;
- sprite->data[2] = 0;
- sprite->data[0]++;
+ sprite->sSinIdx = 0x80;
+ sprite->sCosIdx = 0;
+ sprite->sState++;
+ // fallthrough
case 2:
- if (sprite->pos1.x + sprite->pos2.x <= -0x20)
+ if (sprite->pos1.x + sprite->pos2.x <= -32)
{
+ // Manectric is offscreen now, destroy it
DestroySprite(sprite);
}
else
{
- if ((sprite->data[1] & 0xFF) < 0x40)
+ // Run in circular pattern
+ if ((sprite->sSinIdx & 0xFF) < 64)
{
- sprite->pos2.x = Sin((u8)sprite->data[1], 0x10);
+ sprite->pos2.x = Sin((u8)sprite->sSinIdx, 16);
}
else
{
- if ((sprite->data[1] & 0xFF) == 0x40)
- sprite->pos1.x -= 0x30;
- sprite->pos2.x = Sin((u8)sprite->data[1], 0x40);
+ if ((sprite->sSinIdx & 0xFF) == 64)
+ sprite->pos1.x -= 48;
+ sprite->pos2.x = Sin((u8)sprite->sSinIdx, 64);
}
- sprite->data[1]++;
- sprite->pos2.y = Cos((u8)sprite->data[2], 0xC);
- sprite->data[2]++;
+ sprite->sSinIdx++;
+ sprite->pos2.y = Cos((u8)sprite->sCosIdx, 12);
+ sprite->sCosIdx++;
}
break;
}
}
-static void Task_IntroLoadPart3Graphics(u8 taskId)
+#undef sSinIdx
+#undef sCosIdx
+
+#define tAlpha data[0]
+#define tZoomDiv data[1]
+#define tZoomDivSpeed data[2]
+
+static void Task_Scene3_Load(u8 taskId)
{
- intro_reset_and_hide_bgs();
- LZ77UnCompVram(gIntro3Pokeball_Gfx, (void *)VRAM);
- LZ77UnCompVram(gIntro3Pokeball_Tilemap, (void *)(BG_CHAR_ADDR(1)));
- LoadPalette(gIntro3PokeballPal, 0, 0x200);
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].data[1] = 0;
- gTasks[taskId].data[2] = 0;
+ IntroResetGpuRegs();
+ LZ77UnCompVram(sIntroPokeball_Gfx, (void *)VRAM);
+ LZ77UnCompVram(sIntroPokeball_Tilemap, (void *)(BG_CHAR_ADDR(1)));
+ LoadPalette(sIntroPokeball_Pal, 0, sizeof(sIntroPokeball_Pal));
+ gTasks[taskId].tAlpha = 0;
+ gTasks[taskId].tZoomDiv = 0;
+ gTasks[taskId].tZoomDivSpeed = 0;
gTasks[taskId].data[3] = 0;
PanFadeAndZoomScreen(0x78, 0x50, 0, 0);
ResetSpriteData();
FreeAllSpritePalettes();
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(8) | BGCNT_256COLOR | BGCNT_AFF256x256);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON);
- gTasks[taskId].func = Task_IntroSpinAndZoomPokeball;
+ gTasks[taskId].func = Task_Scene3_SpinPokeball;
gIntroFrameCounter = 0;
m4aSongNumStart(MUS_INTRO_BATTLE);
}
-
-static void Task_IntroSpinAndZoomPokeball(u8 taskId)
+static void Task_Scene3_SpinPokeball(u8 taskId)
{
- gTasks[taskId].data[0] += 0x400;
+ gTasks[taskId].tAlpha += 0x400;
- if (gTasks[taskId].data[1] <= 0x6BF)
+ if (gTasks[taskId].tZoomDiv <= 0x6BF)
{
- gTasks[taskId].data[1] += gTasks[taskId].data[2];
- gTasks[taskId].data[2] += 2;
+ gTasks[taskId].tZoomDiv += gTasks[taskId].tZoomDivSpeed;
+ gTasks[taskId].tZoomDivSpeed += 2;
}
else
{
- gTasks[taskId].func = Task_IntroWaitToSetupPart3LegendsFight;
+ gTasks[taskId].func = Task_Scene3_WaitGroudon;
}
- PanFadeAndZoomScreen(0x78, 0x50, SAFE_DIV(0x10000, gTasks[taskId].data[1]), gTasks[taskId].data[0]);
+ PanFadeAndZoomScreen(0x78, 0x50, SAFE_DIV(0x10000, gTasks[taskId].tZoomDiv), gTasks[taskId].tAlpha);
- if (gIntroFrameCounter == 28)
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
+ if (gIntroFrameCounter == TIMER_POKEBALL_FADE)
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITEALPHA);
}
-static void Task_IntroWaitToSetupPart3LegendsFight(u8 taskId)
+#undef tAlpha
+#undef tZoomDiv
+#undef tZoomDivSpeed
+
+static void Task_Scene3_WaitGroudon(u8 taskId)
{
- if (gIntroFrameCounter > 43)
- gTasks[taskId].func = Task_IntroLoadGroudonScene;
+ if (gIntroFrameCounter > TIMER_START_LEGENDARIES)
+ gTasks[taskId].func = Task_Scene3_LoadGroudon;
}
-static void Task_IntroLoadGroudonScene(u8 taskId)
+static void Task_Scene3_LoadGroudon(u8 taskId)
{
if (!gPaletteFade.active)
{
- intro_reset_and_hide_bgs();
+ IntroResetGpuRegs();
ResetSpriteData();
FreeAllSpritePalettes();
gReservedSpritePaletteCount = 8;
- LZDecompressVram(gIntro3GroudonGfx, (void *)VRAM);
- LZDecompressVram(gIntro3GroudonTilemap, (void *)(BG_CHAR_ADDR(3)));
- LZDecompressVram(gIntro3LegendBgGfx, (void *)(BG_CHAR_ADDR(1)));
- LZDecompressVram(gIntro3GroudonBgTilemap, (void *)(BG_SCREEN_ADDR(28)));
+ LZDecompressVram(gIntroGroudon_Gfx, (void *)VRAM);
+ LZDecompressVram(gIntroGroudon_Tilemap, (void *)(BG_CHAR_ADDR(3)));
+ LZDecompressVram(gIntroLegendBg_Gfx, (void *)(BG_CHAR_ADDR(1)));
+ LZDecompressVram(gIntroGroudonBg_Tilemap, (void *)(BG_SCREEN_ADDR(28)));
LoadCompressedSpriteSheetUsingHeap(&gBattleAnimPicTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]);
LoadCompressedSpritePaletteUsingHeap(&gBattleAnimPaletteTable[GET_TRUE_SPRITE_INDEX(ANIM_TAG_ROCKS)]);
- CpuCopy16(gIntro3BgPal, gPlttBufferUnfaded, sizeof(gIntro3BgPal));
- gTasks[taskId].func = Task_IntroLoadPart3Graphics1;
+ CpuCopy16(gIntro3Bg_Pal, gPlttBufferUnfaded, sizeof(gIntro3Bg_Pal));
+ gTasks[taskId].func = Task_Scene3_InitGroudonBg;
}
}
-static void Task_IntroLoadPart3Graphics1(u8 taskId)
+#define tWinPos data[0]
+#define tScreenX data[1]
+#define tScreenY data[2]
+#define tZoom data[3]
+
+static void Task_Scene3_InitGroudonBg(u8 taskId)
{
- SetGpuReg(REG_OFFSET_WIN0H, 0xF0);
- SetGpuReg(REG_OFFSET_WIN0V, 0xA0);
- SetGpuReg(REG_OFFSET_WININ, 0x3F);
+ SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH);
+ SetGpuReg(REG_OFFSET_WIN0V, DISPLAY_HEIGHT);
+ SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_ALL);
SetGpuReg(REG_OFFSET_WINOUT, 0);
SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(0)
@@ -1630,185 +1809,220 @@ static void Task_IntroLoadPart3Graphics1(u8 taskId)
| DISPCNT_BG2_ON
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON);
- BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].data[1] = 0xFFA0;
- gTasks[taskId].data[2] = 0xFF51;
- gTasks[taskId].data[3] = 0x100;
- PanFadeAndZoomScreen(0xFFA0, 0xFF51, 0x100, 0);
- gTasks[taskId].func = Task_IntroLoadPart3Graphics2;
+ BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
+ gTasks[taskId].tWinPos = 0;
+ gTasks[taskId].tScreenX = 0xFFA0;
+ gTasks[taskId].tScreenY = 0xFF51;
+ gTasks[taskId].tZoom = 0x100;
+ PanFadeAndZoomScreen(gTasks[taskId].tScreenX, gTasks[taskId].tScreenY, gTasks[taskId].tZoom, 0);
+ gTasks[taskId].func = Task_Scene3_NarrowWindow;
}
-static void Task_IntroLoadPart3Graphics2(u8 taskId)
+// Before the Groudon scene starts, the black top/bottom edges of the screen
+// come inward for a more 'cinematic' look
+#define NARROW_HEIGHT 32
+static void Task_Scene3_NarrowWindow(u8 taskId)
{
- if (gTasks[taskId].data[0] != 32)
+ if (gTasks[taskId].tWinPos != NARROW_HEIGHT)
{
- gTasks[taskId].data[0] += 4;
- SetGpuReg(REG_OFFSET_WIN0V, (gTasks[taskId].data[0] * 256) - (gTasks[taskId].data[0] - 160));
+ gTasks[taskId].tWinPos += 4;
+ SetGpuReg(REG_OFFSET_WIN0V, (gTasks[taskId].tWinPos * 256) - (gTasks[taskId].tWinPos - DISPLAY_HEIGHT));
}
else
{
- SetGpuReg(REG_OFFSET_WIN0V, 0x2080);
- gTasks[taskId].func = Task_IntroLoadPart3Graphics3;
+ SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(NARROW_HEIGHT, DISPLAY_HEIGHT - NARROW_HEIGHT));
+ gTasks[taskId].func = Task_Scene3_EndNarrowWindow;
}
}
+#undef tWinPos
+#undef tScreenX
+#undef tScreenY
+#undef tZoom
-static void Task_IntroLoadPart3Graphics3(u8 taskId)
+static void Task_Scene3_EndNarrowWindow(u8 taskId)
{
- gTasks[taskId].func = Task_IntroLoadPart3Graphics4;
+ gTasks[taskId].func = Task_Scene3_StartGroudon;
}
-static void Task_IntroLoadPart3Graphics4(u8 taskId)
+static void Task_Scene3_StartGroudon(u8 taskId)
{
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].func = Task_IntroGroudonScene;
- ScanlineEffect_InitWave(0, 0xA0, 0x4, 4, 1, 4, 0);
+ gTasks[taskId].tState = 0;
+ gTasks[taskId].func = Task_Scene3_Groudon;
+ ScanlineEffect_InitWave(0, 160, 4, 4, 1, 4, 0);
}
-static void Task_IntroGroudonScene(u8 taskId)
+#define tScreenX data[1]
+#define tScreenY data[2]
+#define tZoom data[3]
+#define tYShake data[4]
+#define tTimer data[5]
+#define tDelay data[6]
+#define tTrigIdx data[6] // Re-used
+#define tPalIdx data[7]
+
+static void Task_Scene3_Groudon(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- data[5]++;
- if ((u16)(data[0] - 1) < 7 && data[5] % 2 == 0)
- data[4] ^= 3;
- PanFadeAndZoomScreen(data[1], data[2] + data[4], data[3], 0);
- switch (data[0])
+ tTimer++;
+ if ((u16)(tState - 1) < 7 && tTimer % 2 == 0)
+ tYShake ^= 3;
+ PanFadeAndZoomScreen(tScreenX, tScreenY + tYShake, tZoom, 0);
+ switch (tState)
{
case 0:
- data[1] += 0x10;
- if (data[1] == 0xA0)
+ tScreenX += 16;
+ if (tScreenX == 160)
{
- data[0]++;
- data[6] = 2;
- data[7] = 0x1E2;
+ tState++;
+ tDelay = 2;
+ tPalIdx = 0x1E2;
CreateGroudonRockSprites(taskId);
}
break;
case 1:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 2;
- CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[31], sizeof(u16));
- data[7] += 2;
- if (data[7] == 0x1EC)
- data[0]++;
+ tDelay = 2;
+ CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[31], sizeof(u16));
+ tPalIdx += 2;
+ if (tPalIdx == 0x1EC)
+ tState++;
}
break;
case 2:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 2;
- data[0]++;
+ tDelay = 2;
+ tState++;
}
break;
case 3:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 2;
- CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[31], sizeof(u16));
- data[7] -= 2;
- if (data[7] == 0x1E0)
+ tDelay = 2;
+ CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[31], sizeof(u16));
+ tPalIdx -= 2;
+ if (tPalIdx == 0x1E0)
{
- data[6] = 8;
- data[0]++;
+ tDelay = 8;
+ tState++;
}
}
break;
case 4:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[1] = -0x60;
- data[2] = 0xA9;
- data[6] = 3;
- data[0]++;
+ tScreenX = -96;
+ tScreenY = 169;
+ tDelay = 3;
+ tState++;
}
break;
case 5:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[1] = 0x50;
- data[2] = 0x29;
- data[6] = 0x10;
+ tScreenX = 80;
+ tScreenY = 41;
+ tDelay = 16;
PlayCryInternal(SPECIES_GROUDON, 0, 100, 10, 0);
- data[0]++;
+ tState++;
}
break;
case 6:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[1] = 0x50;
- data[2] = 0x28;
- data[0]++;
+ tScreenX = 80;
+ tScreenY = 40;
+ tState++;
}
break;
case 7:
- data[1] += 4;
- data[2] += 4;
- data[6] += 0x666;
- data[3] = Sin((data[6] & 0xFF00) >> 8, 0x40) + 0x100;
- if (data[1] == 0x78)
+ tScreenX += 4;
+ tScreenY += 4;
+ tTrigIdx += 0x666;
+ tZoom = Sin((tTrigIdx & 0xFF00) >> 8, 64) + 256;
+ if (tScreenX == 120)
{
BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE);
- data[3] = 0x100;
- data[4] = 0;
- data[0]++;
+ tZoom = 256;
+ tYShake = 0;
+ tState++;
}
break;
case 8:
- if (data[3])
- data[3] -= 8;
+ if (tZoom)
+ tZoom -= 8;
else
- data[0]++;
+ tState++;
break;
case 9:
if (!gPaletteFade.active)
{
- gTasks[taskId].func = Task_IntroLoadKyogreScene;
+ gTasks[taskId].func = Task_Scene3_LoadKyogre;
gScanlineEffect.state = 3;
}
break;
}
}
-static void CreateGroudonRockSprites(u8 a0)
+#undef tScreenX
+#undef tScreenY
+#undef tZoom
+#undef tYShake
+#undef tTimer
+#undef tDelay
+#undef tTrigIdx
+#undef tPalIdx
+
+#define sRockId data[1]
+#define sSpeed data[2]
+#define sTimer data[3]
+#define sTaskId data[4]
+
+static void CreateGroudonRockSprites(u8 taskId)
{
int i;
u8 spriteId;
- for (i = 0; i < 6; i++)
+ for (i = 0; i < (int)ARRAY_COUNT(sGroudonRockData); i++)
{
- spriteId = CreateSprite(gAncientPowerRockSpriteTemplate, gIntroGroudonRockData[i][0], 0xA0, i);
- gSprites[spriteId].callback = SpriteCB_IntroGroudonRocks;
+ spriteId = CreateSprite(gAncientPowerRockSpriteTemplate, sGroudonRockData[i][0], DISPLAY_HEIGHT, i);
+ gSprites[spriteId].callback = SpriteCB_GroudonRocks;
gSprites[spriteId].oam.priority = 0;
- gSprites[spriteId].data[1] = i;
- gSprites[spriteId].data[4] = a0;
- StartSpriteAnim(&gSprites[spriteId], gIntroGroudonRockData[i][1]);
+ gSprites[spriteId].sRockId = i;
+ gSprites[spriteId].sTaskId = taskId;
+ StartSpriteAnim(&gSprites[spriteId], sGroudonRockData[i][1]);
}
}
-static void SpriteCB_IntroGroudonRocks(struct Sprite *sprite)
+static void SpriteCB_GroudonRocks(struct Sprite *sprite)
{
- sprite->data[3]++;
- if (sprite->data[3] % 2 == 0)
+ // Introduce some wobble to the floating
+ sprite->sTimer++;
+ if (sprite->sTimer % 2 == 0)
sprite->pos2.y ^= 3;
- switch(sprite->data[0])
+ switch(sprite->sState)
{
case 0:
- sprite->data[2] += gIntroGroudonRockData[sprite->data[1]][2];
- sprite->pos1.y -= (sprite->data[2] & 0xFF00) >> 8;
- sprite->data[2] &= 0xFF;
- if (gTasks[sprite->data[4]].data[0] > 7)
- sprite->data[0]++;
+ // Rock floats up
+ sprite->sSpeed += sGroudonRockData[sprite->sRockId][2];
+ sprite->pos1.y -= (sprite->sSpeed & 0xFF00) >> 8;
+ sprite->sSpeed &= 0xFF;
+
+ // Check if Groudon scene is ending
+ if (gTasks[sprite->sTaskId].tState > 7)
+ sprite->sState++;
break;
case 1:
- if (sprite->pos1.x < 0x78)
+ // Scene zooms in, move rock offscreen
+ if (sprite->pos1.x < DISPLAY_WIDTH / 2)
sprite->pos1.x -= 2;
else
sprite->pos1.x += 2;
- if (sprite->pos1.y < 0x50)
+ if (sprite->pos1.y < DISPLAY_HEIGHT / 2)
sprite->pos1.y -= 2;
else
sprite->pos1.y += 2;
@@ -1816,237 +2030,294 @@ static void SpriteCB_IntroGroudonRocks(struct Sprite *sprite)
}
}
-static void Task_IntroLoadKyogreScene(u8 taskId)
+#undef sRockId
+#undef sSpeed
+#undef sTimer
+#undef sTaskId
+
+#define tScreenX data[1]
+#define tScreenY data[2]
+#define tZoom data[3]
+#define tDelay data[6]
+#define tTrigIdx data[6] // Re-used
+#define tPalIdx data[7]
+
+static void Task_Scene3_LoadKyogre(u8 taskId)
{
ResetSpriteData();
- LZDecompressVram(gIntro3KyogreGfx, (void *)VRAM);
- LZDecompressVram(gIntro3KyogreTilemap, (void *)(BG_CHAR_ADDR(3)));
- LZDecompressVram(gIntro3KyogreBgTilemap, (void *)(BG_SCREEN_ADDR(28)));
- LoadCompressedSpriteSheet(gUnknown_085E4C88);
- LoadSpritePalette(gUnknown_085E4C98);
- BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 0x10, 0, RGB_WHITEALPHA);
- gTasks[taskId].func = Task_IntroKyogreScene;
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].data[1] = 0x150;
- gTasks[taskId].data[2] = 0x50;
- gTasks[taskId].data[6] = 0x10;
- gTasks[taskId].data[3] = 0x100;
- PanFadeAndZoomScreen(0x150, 0x50, 0x100, 0);
+ LZDecompressVram(gIntroKyogre_Gfx, (void *)VRAM);
+ LZDecompressVram(gIntroKyogre_Tilemap, (void *)(BG_CHAR_ADDR(3)));
+ LZDecompressVram(gIntroKyogreBg_Tilemap, (void *)(BG_SCREEN_ADDR(28)));
+ LoadCompressedSpriteSheet(sSpriteSheet_Bubbles);
+ LoadSpritePalette(sSpritePalette_Bubbles);
+ BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 16, 0, RGB_WHITEALPHA);
+ gTasks[taskId].func = Task_Scene3_Kyogre;
+ gTasks[taskId].tState = 0;
+ gTasks[taskId].tScreenX = 336;
+ gTasks[taskId].tScreenY = 80;
+ gTasks[taskId].tDelay = 16;
+ gTasks[taskId].tZoom = 256;
+ PanFadeAndZoomScreen(gTasks[taskId].tScreenX, gTasks[taskId].tScreenY, gTasks[taskId].tZoom, 0);
ScanlineEffect_InitWave(0, 0xA0, 4, 4, 1, 6, 0);
}
-static void Task_IntroKyogreScene(u8 taskId)
+static void Task_Scene3_Kyogre(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- PanFadeAndZoomScreen(data[1], data[2], data[3], 0);
+ PanFadeAndZoomScreen(tScreenX, tScreenY, tZoom, 0);
- switch (data[0])
+ switch (tState)
{
case 0:
- if (--data[6] != 0)
+ if (--tDelay != 0)
break;
- data[0]++;
+ tState++;
case 1:
- data[6] += 4;
- gTasks[taskId].data[1] = 0x158 - Sin(data[6], 0x100);
- gTasks[taskId].data[2] = 0x54 - Cos(data[6], 0x40);
- if (data[6] == 0x40)
+ tTrigIdx += 4;
+ gTasks[taskId].tScreenX = 344 - Sin(tTrigIdx, 0x100);
+ gTasks[taskId].tScreenY = 84 - Cos(tTrigIdx, 0x40);
+ if (tTrigIdx == 64)
{
- data[6] = 0x19;
- data[7] = 1;
- data[0]++;
- CreateKyogreBubbleSprites_0(0);
+ tDelay = 0x19;
+ tPalIdx = 1;
+ tState++;
+ CreateKyogreBubbleSprites_Body(0);
}
break;
case 2:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- gTasks[taskId].data[1] += 0x100;
- gTasks[taskId].data[2] -= 0x102;
- data[6] = 8;
- data[0]++;
- CreateKyogreBubbleSprites_0(0);
- CreateKyogreBubbleSprites_1();
+ gTasks[taskId].tScreenX += 256;
+ gTasks[taskId].tScreenY -= 258;
+ tDelay = 8;
+ tState++;
+ CreateKyogreBubbleSprites_Body(0);
+ CreateKyogreBubbleSprites_Fins();
}
break;
case 3:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- gTasks[taskId].data[1] -= 0x100;
- gTasks[taskId].data[2] += 0x102;
- data[6] = 8;
- data[0]++;
+ gTasks[taskId].tScreenX -= 256;
+ gTasks[taskId].tScreenY += 258;
+ tDelay = 8;
+ tState++;
}
break;
case 4:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- gTasks[taskId].data[2] -= 0xFC;
- data[6] = 8;
- data[0]++;
+ gTasks[taskId].tScreenY -= 252;
+ tDelay = 8;
+ tState++;
}
break;
case 5:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- gTasks[taskId].data[2] += 0xFC;
- if (data[7] != 0)
+ gTasks[taskId].tScreenY += 252;
+ if (tPalIdx != 0)
{
- data[6] = 12;
- data[7]--;
- data[0] = 2;
+ tDelay = 12;
+ tPalIdx--;
+ tState = 2;
}
else
{
- data[6] = 1;
- data[0]++;
+ tDelay = 1;
+ tState++;
PlayCryInternal(SPECIES_KYOGRE, 0, 120, 10, 0);
}
}
break;
case 6:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 4;
- data[7] = 0x1EA;
- data[0]++;
+ tDelay = 4;
+ tPalIdx = 0x1EA;
+ tState++;
}
break;
case 7:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 4;
- CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[47], sizeof(u16));
- data[7] -= 2;
- if (data[7] == 0x1E0)
- data[0]++;
+ tDelay = 4;
+ CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[47], sizeof(u16));
+ tPalIdx -= 2;
+ if (tPalIdx == 0x1E0)
+ tState++;
}
break;
case 8:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 4;
- data[7] = 0x1E2;
- data[0]++;
+ tDelay = 4;
+ tPalIdx = 0x1E2;
+ tState++;
}
break;
case 9:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 4;
- CpuCopy16(&gIntro3BgPal[data[7]], &gPlttBufferFaded[47], sizeof(u16));
- data[7] += 2;
- if (data[7] == 0x1EE)
+ tDelay = 4;
+ CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[47], sizeof(u16));
+ tPalIdx += 2;
+ if (tPalIdx == 0x1EE)
{
- data[6] = 0x10;
- data[0]++;
+ tDelay = 16;
+ tState++;
}
}
break;
case 10:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- data[6] = 0;
- data[0]++;
- CreateKyogreBubbleSprites_0(taskId);
+ tTrigIdx = 0;
+ tState++;
+ CreateKyogreBubbleSprites_Body(taskId);
}
break;
case 11:
- data[6] += 4;
- data[3] -= 8;
- gTasks[taskId].data[1] = Sin(data[6], 0x3C) + 0x58;
- if (data[6] == 0x40)
+ tTrigIdx += 4;
+ tZoom -= 8;
+ gTasks[taskId].tScreenX = Sin(tTrigIdx, 0x3C) + 88;
+ if (tTrigIdx == 64)
{
BeginNormalPaletteFade(PALETTES_ALL & ~1, 3, 0, 16, RGB_WHITE);
- data[0]++;
+ tState++;
}
break;
case 12:
- data[6] += 4;
- data[3] -= 8;
- gTasks[taskId].data[1] = Sin(data[6], 0x14) + 0x80;
- if (data[6] == 0x80)
- data[0]++;
+ tTrigIdx += 4;
+ tZoom -= 8;
+ gTasks[taskId].tScreenX = Sin(tTrigIdx, 0x14) + 128;
+ if (tTrigIdx == 128)
+ tState++;
break;
case 13:
if (!gPaletteFade.active)
{
- gTasks[taskId].func = Task_IntroLoadClouds1;
+ gTasks[taskId].func = Task_Scene3_LoadClouds1;
gScanlineEffect.state = 3;
}
break;
}
}
-static void CreateKyogreBubbleSprites_0(u8 taskId)
+#undef tScreenX
+#undef tScreenY
+#undef tZoom
+#undef tDelay
+#undef tTrigIdx
+#undef tPalIdx
+
+#define sSinIdx data[1]
+#define sBaseY data[2]
+#define sTaskId data[5]
+#define sDelay data[6]
+#define sUnk data[7] // Never read
+
+// taskId is used inconsistently for these two functions.
+// The sprite callback for the bubbles will always read it, unless delay is 0 to
+// start (it never is), but the first function is often passed 0 instead of a
+// taskId, and the second function doesn't take/assign a taskId at all.
+// The only time an actual taskId is given is when it actually needs the
+// result of reading it, to zoom in at the end of the scene.
+
+// Creates bubbles at positions spread across Kyogre's body
+static void CreateKyogreBubbleSprites_Body(u8 taskId)
{
int i;
u8 spriteId;
- for (i = 0; i < 6; i++)
+ for (i = 0; i < NUM_BUBBLES_IN_SET; i++)
{
- spriteId = CreateSprite(&gUnknown_085E4D14, gIntroKyogreBubbleData[i][0], gIntroKyogreBubbleData[i][1], i);
+ spriteId = CreateSprite(&sSpriteTemplate_Bubbles,
+ sKyogreBubbleData[i][0],
+ sKyogreBubbleData[i][1],
+ i);
gSprites[spriteId].invisible = TRUE;
- gSprites[spriteId].data[5] = taskId;
- gSprites[spriteId].data[6] = gIntroKyogreBubbleData[i][2];
- gSprites[spriteId].data[7] = 0x40;
+ gSprites[spriteId].sTaskId = taskId;
+ gSprites[spriteId].sDelay = sKyogreBubbleData[i][2];
+ gSprites[spriteId].sUnk = 64;
}
}
-static void CreateKyogreBubbleSprites_1(void)
+// Creates bubbles at positions around Kyogre's fins, for when it's moving them
+static void CreateKyogreBubbleSprites_Fins(void)
{
int i;
u8 spriteId;
- for (i = 0; i < 6; i++)
+ for (i = 0; i < NUM_BUBBLES_IN_SET; i++)
{
- spriteId = CreateSprite(&gUnknown_085E4D14, gIntroKyogreBubbleData[i + 6][0], gIntroKyogreBubbleData[i + 6][1], i);
+ spriteId = CreateSprite(&sSpriteTemplate_Bubbles,
+ sKyogreBubbleData[i + NUM_BUBBLES_IN_SET][0],
+ sKyogreBubbleData[i + NUM_BUBBLES_IN_SET][1],
+ i);
gSprites[spriteId].invisible = TRUE;
- gSprites[spriteId].data[6] = gIntroKyogreBubbleData[i][2];
- gSprites[spriteId].data[7] = 0x40;
+#ifdef BUGFIX
+ gSprites[spriteId].sDelay = sKyogreBubbleData[i + NUM_BUBBLES_IN_SET][2];
+#else
+ gSprites[spriteId].sDelay = sKyogreBubbleData[i][2]; // Using the wrong set of delays here
+#endif
+ gSprites[spriteId].sUnk = 64;
}
}
-static void SpriteCB_IntroKyogreBubbles(struct Sprite *sprite)
+static void SpriteCB_KyogreBubbles(struct Sprite *sprite)
{
- switch(sprite->data[0])
+ switch(sprite->sState)
{
case 0:
- if (sprite->data[6] == 0)
+ if (sprite->sDelay == 0)
{
- sprite->data[1] = (sprite->data[1] + 11) & 0xFF;
- sprite->pos2.x = Sin(sprite->data[1], 4);
- sprite->data[2] += 0x30;
- sprite->pos2.y = -(sprite->data[2] >> 8);
+ // Animation has started, float bubbles up
+ sprite->sSinIdx = (sprite->sSinIdx + 11) & 0xFF;
+ sprite->pos2.x = Sin(sprite->sSinIdx, 4);
+ sprite->sBaseY += 48;
+ sprite->pos2.y = -(sprite->sBaseY >> 8);
if (sprite->animEnded)
DestroySprite(sprite);
}
- else if (--sprite->data[6] == 0)
+ else if (--sprite->sDelay == 0)
{
+ // Start bubble animation after delay has finished
StartSpriteAnim(sprite, 0);
sprite->invisible = FALSE;
}
- if (gTasks[sprite->data[5]].data[0] > 11)
- sprite->data[0]++;
+
+ // Check if Kyogre scene is ending
+ // For all but the last bubbles, sTaskId isn't actually set
+ if (gTasks[sprite->sTaskId].tState > 11)
+ sprite->sState++;
break;
case 1:
- if (sprite->pos1.x < 120)
+ // Scene zooms in, move bubbles offscreen
+ if (sprite->pos1.x < DISPLAY_WIDTH / 2)
sprite->pos1.x -= 3;
else
sprite->pos1.x += 3;
- if (sprite->pos1.y < 80)
+ if (sprite->pos1.y < DISPLAY_HEIGHT / 2)
sprite->pos1.y -= 3;
else
sprite->pos1.y += 3;
- if ((u16)(sprite->pos1.y - 20) > 140)
+
+ if ((u16)(sprite->pos1.y - 20) > DISPLAY_HEIGHT - 20)
DestroySprite(sprite);
break;
}
}
-static void Task_IntroLoadClouds1(u8 taskId)
+#undef sSinIdx
+#undef sBaseY
+#undef sTaskId
+#undef sDelay
+#undef sUnk
+
+static void Task_Scene3_LoadClouds1(u8 taskId)
{
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0
| BLDCNT_TGT1_BG1
@@ -2082,183 +2353,206 @@ static void Task_IntroLoadClouds1(u8 taskId)
SetGpuReg(REG_OFFSET_BG1VOFS, 0);
SetGpuReg(REG_OFFSET_BG2HOFS, 0);
SetGpuReg(REG_OFFSET_BG2VOFS, 0);
- LZDecompressVram(gIntro3CloudsGfx, (void *)VRAM);
- LZDecompressVram(gIntro3CloudsGfx, (void *)(BG_CHAR_ADDR(1)));
- LZDecompressVram(gIntro3Clouds3Tilemap, (void *)(BG_SCREEN_ADDR(28)));
- gTasks[taskId].func = Task_IntroLoadClouds2;
+ LZDecompressVram(gIntroClouds_Gfx, (void *)VRAM);
+ LZDecompressVram(gIntroClouds_Gfx, (void *)(BG_CHAR_ADDR(1)));
+ LZDecompressVram(gIntroCloudsSun_Tilemap, (void *)(BG_SCREEN_ADDR(28)));
+ gTasks[taskId].func = Task_Scene3_LoadClouds2;
}
-static void Task_IntroLoadClouds2(u8 taskId)
+static void Task_Scene3_LoadClouds2(u8 taskId)
{
- LZDecompressVram(gIntro3Clouds1Tilemap, (void *)(BG_CHAR_ADDR(3)));
- LZDecompressVram(gIntro3Clouds2Tilemap, (void *)(BG_SCREEN_ADDR(26)));
- gTasks[taskId].func = Task_IntroLoadClouds3;
+ LZDecompressVram(gIntroCloudsLeft_Tilemap, (void *)(BG_CHAR_ADDR(3)));
+ LZDecompressVram(gIntroCloudsRight_Tilemap, (void *)(BG_SCREEN_ADDR(26)));
+ gTasks[taskId].func = Task_Scene3_InitClouds;
}
-static void Task_IntroLoadClouds3(u8 taskId)
+#define tCloudPos data[6]
+
+static void Task_Scene3_InitClouds(u8 taskId)
{
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
- gTasks[taskId].func = Task_IntroCloudScene;
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].data[6] = 16;
+ gTasks[taskId].func = Task_Scene3_Clouds;
+ gTasks[taskId].tState = 0;
+ gTasks[taskId].tCloudPos = 16;
}
-static void Task_IntroCloudScene(u8 taskId)
+// Clouds coming in from the sides before Rayquaza appears
+static void Task_Scene3_Clouds(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- SetGpuReg(REG_OFFSET_BG0HOFS, (data[6] >> 8));
- SetGpuReg(REG_OFFSET_BG1HOFS, -(data[6] >> 8));
+ // Left clouds are on BG0, right clouds are on BG1
+ SetGpuReg(REG_OFFSET_BG0HOFS, (tCloudPos >> 8));
+ SetGpuReg(REG_OFFSET_BG1HOFS, -(tCloudPos >> 8));
- switch (data[0])
+ switch (tState)
{
case 0:
- if (--data[6] == 0)
+ // Cloud position is used briefly as a delay, before
+ // the scene has faded in from white
+ if (--tCloudPos == 0)
{
+ // Start fade in from white, set cloud starting positions
BeginNormalPaletteFade(PALETTES_ALL & ~1, 0, 16, 0, RGB_WHITEALPHA);
- data[6] = 0x5000;
- data[0]++;
+ tCloudPos = 80 << 8;
+ tState++;
}
break;
case 1:
- if (data[6] == 0x2800)
+ // Start fading out
+ if (tCloudPos == 40 << 8)
BeginNormalPaletteFade(PALETTES_BG & ~1, 3, 0, 16, RGB(9, 10, 10));
- if (data[6] != 0)
- data[6] -= 0x80;
+ // Move clouds inward toward each other
+ if (tCloudPos != 0)
+ tCloudPos -= 128;
else if (!gPaletteFade.active)
- gTasks[taskId].func = Task_IntroLoadRayquazaLightningScene;
+ gTasks[taskId].func = Task_Scene3_LoadLightning;
break;
}
}
+#undef tCloudPos
-static void Task_IntroLoadRayquazaLightningScene(u8 taskId)
+#define tDelay data[6]
+#define tTimer data[7]
+
+static void Task_Scene3_LoadLightning(u8 taskId)
{
- LZDecompressVram(gIntro3RayquazaTilemap, (void *)(BG_SCREEN_ADDR(28)));
- LZDecompressVram(gIntro3Clouds4Tilemap, (void *)(BG_CHAR_ADDR(3)));
- LZDecompressVram(gIntro3RayquazaGfx, (void *)(BG_CHAR_ADDR(1)));
- LZDecompressVram(gIntro3Clouds2Gfx, (void *)VRAM);
+ LZDecompressVram(gIntroRayquaza_Tilemap, (void *)(BG_SCREEN_ADDR(28)));
+ LZDecompressVram(gIntroRayquazaClouds_Tilemap, (void *)(BG_CHAR_ADDR(3)));
+ LZDecompressVram(gIntroRayquaza_Gfx, (void *)(BG_CHAR_ADDR(1)));
+ LZDecompressVram(gIntroRayquazaClouds_Gfx, (void *)VRAM);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0
| DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON
| DISPCNT_BG2_ON
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON);
- gTasks[taskId].func = Task_IntroRayquazaLightningScene;
- gTasks[taskId].data[0] = 0;
- gTasks[taskId].data[6] = 1;
- gTasks[taskId].data[7] = 0;
- LoadCompressedSpriteSheetUsingHeap(gIntroRayquazaLightningSpriteSheet);
- LoadSpritePalettes(gIntroRayquazaLightningPalette);
+ gTasks[taskId].func = Task_Scene3_Lightning;
+ gTasks[taskId].tState = 0;
+ gTasks[taskId].tDelay = 1;
+ gTasks[taskId].tTimer = 0;
+ LoadCompressedSpriteSheetUsingHeap(sSpriteSheet_Lightning);
+ LoadSpritePalettes(sSpritePalette_Lightning);
}
-static void Task_IntroRayquazaLightningScene(u8 taskId)
+static void Task_Scene3_Lightning(u8 taskId)
{
s16 *data = gTasks[taskId].data;
u8 spriteId;
- switch (data[0])
+ switch (tState)
{
case 0:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- CreateSprite(&gIntroLightningSprite, 200, 48, 0);
- spriteId = CreateSprite(&gIntroLightningSprite, 200, 80, 1);
+ // Do first lightning bolt
+ CreateSprite(&sSpriteTemplate_Lightning, 200, 48, 0);
+ spriteId = CreateSprite(&sSpriteTemplate_Lightning, 200, 80, 1);
StartSpriteAnim(&gSprites[spriteId], 1);
- spriteId = CreateSprite(&gIntroLightningSprite, 200, 112, 2);
+ spriteId = CreateSprite(&sSpriteTemplate_Lightning, 200, 112, 2);
StartSpriteAnim(&gSprites[spriteId], 2);
- data[0]++;
- data[6] = 72;
+ tState++;
+ tDelay = 72;
}
break;
case 1:
- if (--data[6] == 0)
+ if (--tDelay == 0)
{
- CreateSprite(&gIntroLightningSprite, 40, 48, 0);
- spriteId = CreateSprite(&gIntroLightningSprite, 40, 80, 1);
+ // Do second lightning bolt
+ CreateSprite(&sSpriteTemplate_Lightning, 40, 48, 0);
+ spriteId = CreateSprite(&sSpriteTemplate_Lightning, 40, 80, 1);
StartSpriteAnim(&gSprites[spriteId], 1);
- spriteId = CreateSprite(&gIntroLightningSprite, 40, 112, 2);
+ spriteId = CreateSprite(&sSpriteTemplate_Lightning, 40, 112, 2);
StartSpriteAnim(&gSprites[spriteId], 2);
- data[0]++;
- data[6] = 48;
+ tState++;
+ tDelay = 48;
}
break;
case 2:
- if (--data[6] == 0)
- gTasks[taskId].func = Task_IntroLoadRayquazaGlowScene;
+ if (--tDelay == 0)
+ gTasks[taskId].func = Task_Scene3_LoadRayquazaAttack;
break;
}
}
-static void SpriteCB_IntroRayquazaLightning(struct Sprite *sprite)
+#define sPalIdx data[1]
+#define sDelay data[2]
+
+static void SpriteCB_Lightning(struct Sprite *sprite)
{
if (sprite->animEnded)
sprite->invisible = TRUE;
- switch(sprite->data[0])
+ switch(sprite->sState)
{
case 0:
- sprite->data[1] = 0x1C2;
- sprite->data[0]++;
+ sprite->sPalIdx = 0x1C2;
+ sprite->sState++;
case 1:
- CpuCopy16(&gIntro3BgPal[sprite->data[1]], &gPlttBufferFaded[93], 2);
- sprite->data[1] += 2;
- if (sprite->data[1] != 0x1CE)
+ CpuCopy16(&gIntro3Bg_Pal[sprite->sPalIdx], &gPlttBufferFaded[93], 2);
+ sprite->sPalIdx += 2;
+ if (sprite->sPalIdx != 0x1CE)
break;
- sprite->data[1] = 0x1CC;
- sprite->data[2] = 4;
- sprite->data[0]++;
+ sprite->sPalIdx = 0x1CC;
+ sprite->sDelay = 4;
+ sprite->sState++;
case 2:
- if (--sprite->data[2] == 0)
+ if (--sprite->sDelay == 0)
{
- sprite->data[2] = 4;
- CpuCopy16(&gIntro3BgPal[sprite->data[1]], &gPlttBufferFaded[93], 2);
- sprite->data[1] -= 2;
- if (sprite->data[1] == 0x1C0)
+ sprite->sDelay = 4;
+ CpuCopy16(&gIntro3Bg_Pal[sprite->sPalIdx], &gPlttBufferFaded[93], 2);
+ sprite->sPalIdx -= 2;
+ if (sprite->sPalIdx == 0x1C0)
DestroySprite(sprite);
}
break;
}
}
-static void Task_IntroLoadRayquazaGlowScene(u8 taskId)
+#undef sPalIdx
+#undef sDelay
+
+#define tRayquazaTaskId data[4]
+
+static void Task_Scene3_LoadRayquazaAttack(u8 taskId)
{
- u8 newTaskId;
+ u8 attackTaskId;
- LoadCompressedSpriteSheet(gIntroRayquazaGlowSpriteSheet);
- LoadSpritePalettes(gIntroRayquazaGlowPalette);
+ LoadCompressedSpriteSheet(sSpriteSheet_RayquazaOrb);
+ LoadSpritePalettes(sSpritePalette_RayquazaOrb);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0
| DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON
| DISPCNT_BG2_ON
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON);
- gTasks[taskId].func = Task_IntroRayquazaGlowScene_0;
+ gTasks[taskId].func = Task_Scene3_Rayquaza;
BeginNormalPaletteFade(PALETTES_BG & ~(0x21), 0, 16, 0, RGB(9, 10, 10));
- gTasks[taskId].data[0] = 0;
+ gTasks[taskId].tState = 0;
gTasks[taskId].data[1] = 0xA8;
gTasks[taskId].data[2] = -0x10;
gTasks[taskId].data[3] = -0x88;
gTasks[taskId].data[4] = -0x10;
- newTaskId = CreateTask(Task_IntroRayquazaGlowScene_1, 0);
- gTasks[newTaskId].data[4] = taskId;
+ attackTaskId = CreateTask(Task_RayquazaAttack, 0);
+ gTasks[attackTaskId].tRayquazaTaskId = taskId;
}
-static void Task_IntroRayquazaGlowScene_0(u8 taskId)
+static void Task_Scene3_Rayquaza(u8 taskId)
{
s16 *data = gTasks[taskId].data;
- if (data[7] % 2 == 0)
+ if (tTimer % 2 == 0)
data[6] ^= 2;
- data[7]++;
+ tTimer++;
- switch(data[0])
+ switch(tState)
{
case 0:
- if ((data[7] & 1) != 0)
+ if ((tTimer & 1) != 0)
{
data[1] -= 2;
data[2]++;
@@ -2267,12 +2561,12 @@ static void Task_IntroRayquazaGlowScene_0(u8 taskId)
}
if (data[1] == 0x68)
{
- data[0]++;
+ tState++;
data[5] = 1;
}
break;
case 1:
- data[0]++;
+ tState++;
data[5] = 4;
break;
case 2:
@@ -2283,7 +2577,7 @@ static void Task_IntroRayquazaGlowScene_0(u8 taskId)
if (!gPaletteFade.active)
{
data[5] = 0x8C;
- data[0]++;
+ tState++;
}
break;
case 3:
@@ -2292,6 +2586,8 @@ static void Task_IntroRayquazaGlowScene_0(u8 taskId)
break;
}
}
+#undef tDelay
+#undef tTimer
static void Task_EndIntroMovie(u8 taskId)
{
@@ -2299,24 +2595,23 @@ static void Task_EndIntroMovie(u8 taskId)
SetMainCallback2(MainCB2_EndIntro);
}
-static void Task_IntroRayquazaGlowScene_1(u8 taskId)
+static void Task_RayquazaAttack(u8 taskId)
{
- // Note: data[4] contains the taskId of Task_IntroRayquazaGlowScene_0
u8 spriteId;
s16 *data = gTasks[taskId].data;
data[2]++;
- switch(data[0])
+ switch(tState)
{
case 0:
if ((data[2] & 1) != 0)
{
- CpuCopy16(&gIntro3BgPal[0x1A2 + data[1] * 2], &gPlttBufferFaded[94], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x1A2 + data[1] * 2], &gPlttBufferFaded[94], 2);
data[1]++;
}
if (data[1] == 6)
{
- data[0]++;
+ tState++;
data[1] = 0;
data[3] = 10;
}
@@ -2326,12 +2621,12 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
{
if ((data[2] & 1) != 0)
{
- CpuCopy16(&gIntro3BgPal[0x1A2 + data[1] * 2], &gPlttBufferFaded[88], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x1A2 + data[1] * 2], &gPlttBufferFaded[88], 2);
data[1]++;
}
if (data[1] == 6)
{
- data[0]++;
+ tState++;
data[3] = 10;
}
}
@@ -2345,16 +2640,16 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
{
if ((data[2] & 1) != 0)
{
- CpuCopy16(&gIntro3BgPal[0x182 + data[1] * 2], &gPlttBufferFaded[92], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x182 + data[1] * 2], &gPlttBufferFaded[92], 2);
data[1]++;
}
if (data[1] == 6)
{
- spriteId = CreateSprite(&gIntroRayquazaHyperbeamSprite, 120, 88, 15);
+ spriteId = CreateSprite(&sSpriteTemplate_RayquazaOrb, 120, 88, 15);
PlaySE(SE_INTRO_BLAST);
gSprites[spriteId].invisible = TRUE;
- gSprites[spriteId].data[3] = data[4];
- data[0]++;
+ gSprites[spriteId].data[3] = tRayquazaTaskId;
+ tState++;
data[3] = 16;
}
}
@@ -2369,13 +2664,13 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
if (--data[3] != 0)
{
BlendPalette(0x50, 16, data[3], RGB(9, 10, 10));
- CpuCopy16(&gIntro3BgPal[0x1AC], &gPlttBufferFaded[94], 2);
- CpuCopy16(&gIntro3BgPal[0x1AC], &gPlttBufferFaded[88], 2);
- CpuCopy16(&gIntro3BgPal[0x18C], &gPlttBufferFaded[92], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x1AC], &gPlttBufferFaded[94], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x1AC], &gPlttBufferFaded[88], 2);
+ CpuCopy16(&gIntro3Bg_Pal[0x18C], &gPlttBufferFaded[92], 2);
}
else
{
- data[0]++;
+ tState++;
data[3] = 53;
}
}
@@ -2384,7 +2679,7 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
if (--data[3] == 0)
{
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_WHITE);
- data[0]++;
+ tState++;
}
break;
case 5:
@@ -2394,7 +2689,7 @@ static void Task_IntroRayquazaGlowScene_1(u8 taskId)
}
}
-static void intro_reset_and_hide_bgs(void)
+static void IntroResetGpuRegs(void)
{
SetGpuReg(REG_OFFSET_DISPCNT, 0);
SetGpuReg(REG_OFFSET_BG3HOFS, 0);
@@ -2410,9 +2705,9 @@ static void intro_reset_and_hide_bgs(void)
SetGpuReg(REG_OFFSET_BLDY, 0);
}
-static void Task_IntroWaterDrops_1(u8 taskId)
+static void Task_BlendLogoIn(u8 taskId)
{
- switch (gTasks[taskId].data[0])
+ switch (gTasks[taskId].tState)
{
case 0:
default:
@@ -2423,10 +2718,10 @@ static void Task_IntroWaterDrops_1(u8 taskId)
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[31]);
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[31]);
SetGpuReg(REG_OFFSET_BLDY, 0);
- gTasks[taskId].data[1] = 0x40;
- gTasks[taskId].data[0]++;
+ gTasks[taskId].data[1] = ARRAY_COUNT(gTitleScreenAlphaBlend);
+ gTasks[taskId].tState++;
break;
case 1:
if (gTasks[taskId].data[1] != 0)
@@ -2435,13 +2730,13 @@ static void Task_IntroWaterDrops_1(u8 taskId)
gTasks[taskId].data[1]--;
tmp = gTasks[taskId].data[1] / 2;
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[tmp]);
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[tmp]);
}
else
{
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[0]);
- gTasks[taskId].data[1] = 0x10;
- gTasks[taskId].data[0]++;
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[0]);
+ gTasks[taskId].data[1] = ARRAY_COUNT(gTitleScreenAlphaBlend) / 4;
+ gTasks[taskId].tState++;
}
break;
case 2:
@@ -2453,9 +2748,9 @@ static void Task_IntroWaterDrops_1(u8 taskId)
}
}
-static void Task_IntroWaterDrops_2(u8 taskId)
+static void Task_BlendLogoOut(u8 taskId)
{
- switch (gTasks[taskId].data[0])
+ switch (gTasks[taskId].tState)
{
case 0:
default:
@@ -2466,25 +2761,25 @@ static void Task_IntroWaterDrops_2(u8 taskId)
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[0]);
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[0]);
SetGpuReg(REG_OFFSET_BLDY, 0);
gTasks[taskId].data[1] = 0;
- gTasks[taskId].data[0]++;
+ gTasks[taskId].tState++;
break;
case 1:
- if (gTasks[taskId].data[1] < 62)
+ if (gTasks[taskId].data[1] < (int)ARRAY_COUNT(gTitleScreenAlphaBlend) - 2)
{
u8 tmp;
gTasks[taskId].data[1]++;
tmp = gTasks[taskId].data[1] / 2;
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[tmp]);
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[tmp]);
}
else
{
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[31]);
- gTasks[taskId].data[1] = 0x10;
- gTasks[taskId].data[0]++;
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[31]);
+ gTasks[taskId].data[1] = ARRAY_COUNT(gTitleScreenAlphaBlend) / 4;
+ gTasks[taskId].tState++;
}
break;
case 2:
@@ -2526,9 +2821,9 @@ void PanFadeAndZoomScreen(u16 screenX, u16 screenY, u16 zoom, u16 alpha)
SetGpuReg(REG_OFFSET_BG2Y_H, dest.dy >> 16);
}
-static void sub_816F318(struct Sprite *sprite)
+static void SpriteCB_WaterDrop_Ripple(struct Sprite *sprite)
{
- u8 r0;
+ u8 palNum;
if (sprite->data[2] >= 192)
{
@@ -2541,10 +2836,10 @@ static void sub_816F318(struct Sprite *sprite)
sprite->invisible = FALSE;
SetOamMatrix(sprite->data[1], sprite->data[2], 0, 0, sprite->data[2]);
sprite->data[2] = (sprite->data[2] * 95) / 100;
- r0 = (sprite->data[2] - 192) / 128 + 9;
- if (r0 > 15)
- r0 = 15;
- sprite->oam.paletteNum = r0;
+ palNum = (sprite->data[2] - 192) / 128 + 9;
+ if (palNum > 15)
+ palNum = 15;
+ sprite->oam.paletteNum = palNum;
}
}
else
@@ -2553,17 +2848,17 @@ static void sub_816F318(struct Sprite *sprite)
}
}
-static void sub_816F3A4(struct Sprite *sprite)
+static void SpriteCB_WaterDropHalf(struct Sprite *sprite)
{
if (gSprites[sprite->data[7]].data[7] != 0)
{
sprite->invisible = TRUE;
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
- StartSpriteAnim(sprite, 3);
+ StartSpriteAnim(sprite, DROP_ANIM_RIPPLE);
sprite->data[2] = 1024;
sprite->data[3] = 8 * (sprite->data[1] & 3);
- sprite->callback = sub_816F318;
+ sprite->callback = SpriteCB_WaterDrop_Ripple;
sprite->oam.shape = SPRITE_SHAPE(64x32);
sprite->oam.size = SPRITE_SIZE(64x32);
CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE);
@@ -2577,13 +2872,14 @@ static void sub_816F3A4(struct Sprite *sprite)
}
}
-static void sub_816F454(struct Sprite *sprite)
+static void SpriteCB_WaterDrop(struct Sprite *sprite)
{
- if (sprite->data[0] != 0)
- sprite->callback = sub_816F46C;
+ // Wait for sState to be modified by Task_Scene1_WaterDrops
+ if (sprite->sState != 0)
+ sprite->callback = SpriteCB_WaterDrop_Slide;
}
-static void sub_816F46C(struct Sprite *sprite)
+static void SpriteCB_WaterDrop_Slide(struct Sprite *sprite)
{
if (sprite->pos1.x <= 116)
{
@@ -2592,7 +2888,7 @@ static void sub_816F46C(struct Sprite *sprite)
sprite->pos1.x += 4;
sprite->pos2.x = -4;
sprite->data[4] = 128;
- sprite->callback = sub_816F5B4;
+ sprite->callback = SpriteCB_WaterDrop_ReachLeafEnd;
}
else
{
@@ -2632,28 +2928,27 @@ static void sub_816F46C(struct Sprite *sprite)
}
}
-static void sub_816F5B4(struct Sprite *sprite)
+static void SpriteCB_WaterDrop_ReachLeafEnd(struct Sprite *sprite)
{
SetOamMatrix(sprite->data[1], sprite->data[6] + 64, 0, 0, sprite->data[6] + 64);
SetOamMatrix(sprite->data[1] + 1, sprite->data[6] + 64, 0, 0, sprite->data[6] + 64);
SetOamMatrix(sprite->data[1] + 2, sprite->data[6] + 64, 0, 0, sprite->data[6] + 64);
if (sprite->data[4] != 64)
{
- u16 data4;
-
+ u16 sinIdx;
sprite->data[4] -= 8;
- data4 = sprite->data[4];
- sprite->pos2.x = gSineTable[(u8)(data4 + 64)] / 64;
- sprite->pos2.y = gSineTable[(u8)data4] / 64;
+ sinIdx = sprite->data[4];
+ sprite->pos2.x = gSineTable[(u8)(sinIdx + 64)] / 64;
+ sprite->pos2.y = gSineTable[(u8)sinIdx] / 64;
}
else
{
sprite->data[4] = 0;
- sprite->callback = sub_816F660;
+ sprite->callback = SpriteCB_WaterDrop_DangleFromLeaf;
}
}
-static void sub_816F660(struct Sprite *sprite)
+static void SpriteCB_WaterDrop_DangleFromLeaf(struct Sprite *sprite)
{
if (sprite->data[0] != 2)
{
@@ -2666,11 +2961,11 @@ static void sub_816F660(struct Sprite *sprite)
}
else
{
- sprite->callback = SpriteCB_WaterDropFall;
+ sprite->callback = SpriteCB_WaterDrop_Fall;
}
}
-static void SpriteCB_WaterDropFall(struct Sprite *sprite)
+static void SpriteCB_WaterDrop_Fall(struct Sprite *sprite)
{
if (sprite->pos1.y < sprite->data[5])
{
@@ -2682,18 +2977,19 @@ static void SpriteCB_WaterDropFall(struct Sprite *sprite)
sprite->invisible = TRUE;
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
- StartSpriteAnim(sprite, 3);
+ StartSpriteAnim(sprite, DROP_ANIM_RIPPLE);
sprite->data[2] = 1024;
sprite->data[3] = 8 * (sprite->data[1] & 3);
- sprite->callback = sub_816F318;
+ sprite->callback = SpriteCB_WaterDrop_Ripple;
sprite->oam.shape = SPRITE_SHAPE(64x32);
sprite->oam.size = SPRITE_SIZE(64x32);
CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE);
}
}
-//Duplicate function
-static void SpriteCB_WaterDropFall_2(struct Sprite *sprite)
+// Identical to SpriteCB_WaterDrop_Fall
+// Used by the 2nd and 3rd water drops to skip the leaf slide
+static void SpriteCB_WaterDropShort(struct Sprite *sprite)
{
if (sprite->pos1.y < sprite->data[5])
{
@@ -2705,10 +3001,10 @@ static void SpriteCB_WaterDropFall_2(struct Sprite *sprite)
sprite->invisible = TRUE;
sprite->pos1.x += sprite->pos2.x;
sprite->pos1.y += sprite->pos2.y;
- StartSpriteAnim(sprite, 3);
+ StartSpriteAnim(sprite, DROP_ANIM_RIPPLE);
sprite->data[2] = 1024;
sprite->data[3] = 8 * (sprite->data[1] & 3);
- sprite->callback = sub_816F318;
+ sprite->callback = SpriteCB_WaterDrop_Ripple;
sprite->oam.shape = SPRITE_SHAPE(64x32);
sprite->oam.size = SPRITE_SIZE(64x32);
CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_ERASE);
@@ -2720,7 +3016,8 @@ static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately)
u8 spriteId;
u8 oldSpriteId;
- spriteId = CreateSprite(&gIntroWaterDropSprite, x, y, 1);
+ // Create water drop reflection
+ spriteId = CreateSprite(&sSpriteTemplate_WaterDrop, x, y, 1);
gSprites[spriteId].data[0] = 0;
gSprites[spriteId].data[7] = 0;
gSprites[spriteId].data[1] = d;
@@ -2731,29 +3028,32 @@ static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately)
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
gSprites[spriteId].oam.matrixNum = d;
CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE);
- StartSpriteAnim(&gSprites[spriteId], 2);
+ StartSpriteAnim(&gSprites[spriteId], DROP_ANIM_REFLECTION);
if (!fallImmediately)
- gSprites[spriteId].callback = sub_816F454;
+ gSprites[spriteId].callback = SpriteCB_WaterDrop; // Do full anim, for 1st drop that slides along the leaf
else
- gSprites[spriteId].callback = SpriteCB_WaterDropFall_2;
+ gSprites[spriteId].callback = SpriteCB_WaterDropShort; // Skip to drop falling into the water, for 2nd and 3rd drops
oldSpriteId = spriteId;
- spriteId = CreateSprite(&gIntroWaterDropSprite, x, y, 1);
+ // Create water drop upper half
+ // Implicitly anim number 0, DROP_ANIM_UPPER_HALF
+ spriteId = CreateSprite(&sSpriteTemplate_WaterDrop, x, y, 1);
gSprites[spriteId].data[7] = oldSpriteId;
gSprites[spriteId].data[1] = d + 1;
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
gSprites[spriteId].oam.matrixNum = d + 1;
CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE);
- gSprites[spriteId].callback = sub_816F3A4;
+ gSprites[spriteId].callback = SpriteCB_WaterDropHalf;
- spriteId = CreateSprite(&gIntroWaterDropSprite, x, y, 1);
+ // Create water drop lower half
+ spriteId = CreateSprite(&sSpriteTemplate_WaterDrop, x, y, 1);
gSprites[spriteId].data[7] = oldSpriteId;
gSprites[spriteId].data[1] = d + 2;
- StartSpriteAnim(&gSprites[spriteId], 1);
+ StartSpriteAnim(&gSprites[spriteId], DROP_ANIM_LOWER_HALF);
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
gSprites[spriteId].oam.matrixNum = d + 2;
CalcCenterToCornerVec(&gSprites[spriteId], SPRITE_SHAPE(32x32), SPRITE_SIZE(32x32), ST_OAM_AFFINE_ERASE);
- gSprites[spriteId].callback = sub_816F3A4;
+ gSprites[spriteId].callback = SpriteCB_WaterDropHalf;
SetOamMatrix(d, c + 32, 0, 0, c + 32);
SetOamMatrix(d + 1, c + 32, 0, 0, c + 32);
@@ -2762,39 +3062,51 @@ static u8 CreateWaterDrop(s16 x, s16 y, u16 c, u16 d, u16 e, u8 fallImmediately)
return oldSpriteId;
}
-static void SpriteCB_IntroGraphicsBicycle(struct Sprite *sprite)
+// State is handled by Task_Scene2_BikeRide
+static void SpriteCB_PlayerOnBicycle(struct Sprite *sprite)
{
- switch (sprite->data[0])
+ // Adjust x position
+ switch (sprite->sState)
{
case 0:
+ // Move forwards
StartSpriteAnimIfDifferent(sprite, 0);
sprite->pos1.x--;
break;
case 1:
+ // Drift backwards slowly
StartSpriteAnimIfDifferent(sprite, 0);
if (gIntroFrameCounter & 7)
return;
sprite->pos1.x++;
break;
case 2:
+ // Move backwards
if (sprite->pos1.x <= 120 || gIntroFrameCounter & 7)
sprite->pos1.x++;
break;
case 3:
+ // Bike in place
break;
case 4:
+ // Exit to the left
if (sprite->pos1.x > -32)
sprite->pos1.x -= 2;
break;
}
+
if (gIntroFrameCounter & 7)
return;
+
+ // Adjust y position
if (sprite->pos2.y != 0)
{
+ // Return to neutral after wobble
sprite->pos2.y = 0;
}
else
{
+ // Random wobble on y axis
switch (Random() & 3)
{
case 0:
@@ -2811,115 +3123,136 @@ static void SpriteCB_IntroGraphicsBicycle(struct Sprite *sprite)
}
}
-static void SpriteCB_IntroGraphicsFlygon(struct Sprite *sprite)
+#define sSinIdx data[1]
+
+// Movement is started by setting state to 1 in Task_Scene2_BikeRide
+static void SpriteCB_Flygon(struct Sprite *sprite)
{
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
break;
case 1:
- if (sprite->pos2.x + sprite->pos1.x < 304)
+ if (sprite->pos2.x + sprite->pos1.x < DISPLAY_WIDTH + 64)
sprite->pos2.x += 8;
else
- sprite->data[0] = 2;
+ sprite->sState = 2;
break;
case 2:
if (sprite->pos2.x + sprite->pos1.x > 120)
sprite->pos2.x -= 1;
else
- sprite->data[0] = 3;
+ sprite->sState = 3;
break;
case 3:
if (sprite->pos2.x > 0)
sprite->pos2.x -= 2;
break;
}
- sprite->pos2.y = Sin((u8)sprite->data[1], 8) - gIntroGraphicsFlygonYOffset;
- sprite->data[1] += 4;
+ sprite->pos2.y = Sin((u8)sprite->sSinIdx, 8) - sFlygonYOffset;
+ sprite->sSinIdx += 4;
}
-static void sub_816FB38(struct Sprite *sprite)
+#undef sSinIdx
+
+#define sTimer data[1]
+#define sLetterId data[2]
+#define sColorDelay data[3]
+#define sLetterX data[3] // Re-used
+
+#define COLOR_CHANGES 9 // Number of stages for changing the letter color
+
+// For the letters in "Game Freak"
+// Also intended for the letters in "Presents", which is never shown
+static void SpriteCB_LogoLetter(struct Sprite *sprite)
{
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
- if (sprite->data[1] != 0)
+ if (sprite->sTimer != 0)
{
- sprite->data[1]--;
+ sprite->sTimer--;
}
else
{
+ // Start the grow and shrink appearance animation
sprite->invisible = FALSE;
StartSpriteAffineAnim(sprite, 1);
- sprite->data[0]++;
+ sprite->sState++;
}
break;
case 1:
- if (gIntroFrameCounter == 0x90)
+ if (gIntroFrameCounter == TIMER_LOGO_LETTERS_COLOR)
{
- sprite->data[0]++;
- sprite->data[1] = 9;
- sprite->data[3] = 2;
+ // Initialize color fade
+ sprite->sState++;
+ sprite->sTimer = COLOR_CHANGES;
+ sprite->sColorDelay = 2;
}
break;
case 2:
- if (sprite->data[3] == 0)
+ // Fade letters to blue
+ if (sprite->sColorDelay == 0)
{
- sprite->data[3] = 2;
- if (sprite->data[1] != 0)
+ sprite->sColorDelay = 2;
+ if (sprite->sTimer != 0)
{
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2);
- sprite->data[1]--;
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer], &gPlttBufferFaded[0x11F], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 16], &gPlttBufferFaded[0x114], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 32], &gPlttBufferFaded[0x11A], 2);
+ sprite->sTimer--;
}
else
{
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2);
- sprite->data[0]++;
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer], &gPlttBufferFaded[0x11F], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 16], &gPlttBufferFaded[0x114], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 32], &gPlttBufferFaded[0x11A], 2);
+ sprite->sState++;
}
}
else
{
- sprite->data[3]--;
+ sprite->sColorDelay--;
}
break;
case 3:
- if (sprite->data[3] != 0)
+ // Fade letters back to white
+ if (sprite->sColorDelay != 0)
{
- sprite->data[3]--;
+ sprite->sColorDelay--;
}
else
{
- sprite->data[3] = 2;
- if (sprite->data[1] < 10)
+ sprite->sColorDelay = 2;
+ if (sprite->sTimer <= COLOR_CHANGES)
{
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1]], &gPlttBufferFaded[0x11F], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x10], &gPlttBufferFaded[0x114], 2);
- CpuCopy16(&gIntro1GameFreakTextFadePal[sprite->data[1] + 0x20], &gPlttBufferFaded[0x11A], 2);
- sprite->data[1]++;
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer], &gPlttBufferFaded[0x11F], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 16], &gPlttBufferFaded[0x114], 2);
+ CpuCopy16(&gIntroGameFreakTextFade_Pal[sprite->sTimer + 32], &gPlttBufferFaded[0x11A], 2);
+ sprite->sTimer++;
}
else
{
- sprite->data[0]++;
+ sprite->sState++;
}
}
break;
case 4:
- if (gIntroFrameCounter == 0x110)
+ if (gIntroFrameCounter == TIMER_LOGO_DISAPPEAR)
{
+ // Start the grow disappearance animation
StartSpriteAffineAnim(sprite, 2);
sprite->oam.objMode = ST_OAM_OBJ_BLEND;
- sprite->data[0]++;
+ sprite->sState++;
}
break;
case 5:
- sprite->data[3] += gUnknown_085E4F48[sprite->data[2]];
- sprite->pos2.x = (sprite->data[3] & 0xFF00) >> 8;
- if (sprite->data[2] < 4)
+ // Spread the letters out as they grow
+ sprite->sLetterX += sGameFreakLettersMoveSpeed[sprite->sLetterId];
+ sprite->pos2.x = (sprite->sLetterX & 0xFF00) >> 8;
+ if (sprite->sLetterId < 4)
{
+ // Is in first 4 letters, i.e. "Game"
s16 temp = sprite->pos2.x;
sprite->pos2.x = -temp;
}
@@ -2929,22 +3262,23 @@ static void sub_816FB38(struct Sprite *sprite)
}
}
-static void sub_816FD44(struct Sprite *sprite)
+static void SpriteCB_GameFreakLogo(struct Sprite *sprite)
{
- switch(sprite->data[0])
+ switch(sprite->sState)
{
case 0:
- if (gIntroFrameCounter == 0x80)
+ if (gIntroFrameCounter == TIMER_LOGO_APPEAR)
{
sprite->invisible = FALSE;
- sprite->data[0]++;
+ sprite->sState++;
}
break;
case 1:
- if (gIntroFrameCounter == 0x110)
+ if (gIntroFrameCounter == TIMER_LOGO_DISAPPEAR)
{
+ // Start the grow disappearance animation
StartSpriteAffineAnim(sprite, 3);
- sprite->data[0]++;
+ sprite->sState++;
}
break;
case 2:
@@ -2954,35 +3288,45 @@ static void sub_816FD44(struct Sprite *sprite)
}
}
-static u8 CreatePart1Animations(s16 a0, s16 a1, s16 a2)
+static u8 CreateGameFreakLogoSprites(s16 x, s16 y, s16 unused)
{
u16 i;
u8 spriteId;
- for (i = 0; i < 9; i++)
+ // Create "Game Freak" letters
+ for (i = 0; i < NUM_GF_LETTERS; i++)
{
- spriteId = CreateSprite(&gUnknown_085E4F5C, gUnknown_085E4E94[i][1] + a0, a1 - 4, 0);
- gSprites[spriteId].data[0] = 0;
- gSprites[spriteId].data[1] = gUnknown_085E4FA4[i];
- gSprites[spriteId].data[2] = i;
+ spriteId = CreateSprite(&sSpriteTemplate_GameFreakLetter, sGameFreakLetterData[i][1] + x, y - 4, 0);
+ gSprites[spriteId].sState = 0;
+ gSprites[spriteId].sTimer = sGameFreakLetterStartDelays[i];
+ gSprites[spriteId].sLetterId = i;
gSprites[spriteId].invisible = TRUE;
gSprites[spriteId].oam.matrixNum = i + 12;
- StartSpriteAnim(&gSprites[spriteId], gUnknown_085E4E94[i][0]);
+ StartSpriteAnim(&gSprites[spriteId], sGameFreakLetterData[i][0]);
StartSpriteAffineAnim(&gSprites[spriteId], 0);
}
- spriteId = CreateSprite(&gUnknown_085E4F8C, 120, a1 - 6, 0);
- gSprites[spriteId].data[0] = 0;
+
+ // Create Game Freak logo
+ spriteId = CreateSprite(&sSpriteTemplate_GameFreakLogo, 120, y - 6, 0);
+ gSprites[spriteId].sState = 0;
gSprites[spriteId].invisible = TRUE;
gSprites[spriteId].oam.matrixNum = i + 12;
StartSpriteAffineAnim(&gSprites[spriteId], 1);
+
return spriteId;
}
-static void sub_816FEDC(struct Sprite *sprite)
+#undef sTimer
+#undef sLetterId
+#undef sColorDelay
+#undef sLetterX
+#undef COLOR_CHANGES
+
+static void SpriteCB_FlygonSilhouette(struct Sprite *sprite)
{
sprite->data[7]++;
- if (sprite->data[0] != 0)
+ if (sprite->sState != 0)
{
s16 sin1;
s16 sin2;
@@ -3000,7 +3344,7 @@ static void sub_816FEDC(struct Sprite *sprite)
SetOamMatrix(1, a, b, c, d);
}
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
default:
@@ -3008,7 +3352,7 @@ static void sub_816FEDC(struct Sprite *sprite)
sprite->oam.matrixNum = 1;
CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x32), SPRITE_SIZE(64x32), ST_OAM_AFFINE_DOUBLE);
sprite->invisible = FALSE;
- sprite->data[0] = 1;
+ sprite->sState = 1;
sprite->data[1] = 0x80;
sprite->data[2] = 0;
sprite->data[3] = 0;
@@ -3021,7 +3365,7 @@ static void sub_816FEDC(struct Sprite *sprite)
if (sprite->pos1.x + sprite->pos2.x <= -16)
{
sprite->oam.priority = 3;
- sprite->data[0]++;
+ sprite->sState++;
sprite->pos1.x = 20;
sprite->pos1.y = 40;
sprite->data[1] = 0x200;
@@ -3039,13 +3383,10 @@ static void sub_816FEDC(struct Sprite *sprite)
}
}
-static void SpriteCB_IntroRayquazaHyperbeam(struct Sprite *sprite)
+static void SpriteCB_RayquazaOrb(struct Sprite *sprite)
{
u16 foo;
-
- //I'm not sure why a switch statement was used here.
- //if (sprite->data[0] != 1) would have been more appropriate.
- switch (sprite->data[0])
+ switch (sprite->sState)
{
case 0:
default:
@@ -3054,7 +3395,7 @@ static void SpriteCB_IntroRayquazaHyperbeam(struct Sprite *sprite)
sprite->oam.matrixNum = 18;
CalcCenterToCornerVec(sprite, SPRITE_SHAPE(64x64), SPRITE_SIZE(64x64), ST_OAM_AFFINE_DOUBLE);
sprite->data[1] = 0;
- sprite->data[0] = 1;
+ sprite->sState = 1;
//fall through
case 1:
sprite->data[7]++;
diff --git a/src/intro_credits_graphics.c b/src/intro_credits_graphics.c
index 45cc24e5c..1f196b268 100644
--- a/src/intro_credits_graphics.c
+++ b/src/intro_credits_graphics.c
@@ -6,6 +6,25 @@
#include "task.h"
#include "main.h"
#include "graphics.h"
+#include "constants/rgb.h"
+
+/*
+ The graphics here are used by both the second scene of the intro
+ and the credit sequence, where the player bikes along a grassy path.
+
+ These graphics are placed in graphics/intro/scene_2 to keep
+ all of the intro graphics files together, though it includes
+ the related graphics that are used only by the credits.
+*/
+
+#define TAG_BICYCLE 1001
+#define TAG_BRENDAN 1002
+#define TAG_MAY 1003
+#define TAG_FLYGON_LATIOS 1004
+#define TAG_FLYGON_LATIAS 1005
+
+// Used for the Clouds/Trees/Houses sprites that pass by in the background
+#define TAG_MOVING_SCENERY 2000
struct IntroCreditsSpriteMetadata
{
@@ -18,99 +37,99 @@ struct IntroCreditsSpriteMetadata
u16 xOff;
};
-static const u16 gUnknown_085F06E0[] = INCBIN_U16("graphics/intro/intro2_grass.gbapal");
-static const u16 gUnknown_085F0700[] = INCBIN_U16("graphics/intro/intro2_grass_afternoon.gbapal");
-static const u16 gUnknown_085F0720[] = INCBIN_U16("graphics/intro/intro2_grass_night.gbapal");
-static const u32 gUnknown_085F0740[] = INCBIN_U32("graphics/intro/intro2_grass.4bpp.lz");
-static const u32 gUnknown_085F0BC0[] = INCBIN_U32("graphics/intro/intro2_grass_map.bin.lz");
-static const u16 gUnknown_085F0CFC[] = INCBIN_U16("graphics/intro/85F0CFC.gbapal");
-static const u16 gUnknown_085F0D5C[] = INCBIN_U16("graphics/intro/85F0D5C.gbapal");
-static const u32 gUnknown_085F0DBC[] = INCBIN_U32("graphics/intro/intro2_bgclouds.4bpp.lz");
-static const u32 gUnknown_085F1398[] = INCBIN_U32("graphics/intro/intro2_bgclouds_map.bin.lz");
-static const u16 gUnknown_085F1668[] = INCBIN_U16("graphics/intro/intro2_bgclouds.gbapal");
-static const u16 gUnknown_085F1688[] = INCBIN_U16("graphics/intro/intro2_bgclouds_afternoon.gbapal");
-static const u32 gUnknown_085F16A8[] = INCBIN_U32("graphics/intro/intro2_bgclouds2.4bpp.lz");
-static const u16 gUnknown_085F17E4[] = INCBIN_U16("graphics/intro/intro2_bgtrees2.gbapal");
-static const u16 gUnknown_085F1804[] = INCBIN_U16("graphics/intro/intro2_bgtrees2_afternoon.gbapal");
-static const u32 gUnknown_085F1824[] = INCBIN_U32("graphics/intro/intro2_bgtrees.4bpp.lz");
-static const u32 gUnknown_085F1EAC[] = INCBIN_U32("graphics/intro/intro2_bgtrees_map.bin.lz");
-static const u16 gUnknown_085F21B0[] = INCBIN_U16("graphics/intro/intro2_bgtrees.gbapal");
-static const u32 gIntro2TreeTiles[] = INCBIN_U32("graphics/intro/intro2_bgtreessmall.4bpp.lz");
-static const u16 gUnknown_085F231C[] = INCBIN_U16("graphics/intro/85F231C.gbapal");
-static const u32 gUnknown_085F235C[] = INCBIN_U32("graphics/intro/intro2_bgnight.4bpp.lz");
-static const u16 gUnknown_085F2548[] = INCBIN_U16("graphics/intro/intro2_bgnight.gbapal");
-static const u32 gUnknown_085F2568[] = INCBIN_U32("graphics/intro/intro2_bgnight_map.bin.lz");
-static const u32 gIntro2NightTiles[] = INCBIN_U32("graphics/intro/intro2_night.4bpp.lz");
-static const u16 gIntro2BrendanPalette[] = INCBIN_U16("graphics/intro/intro2_brendan.gbapal");
-static const u32 gIntro2BrendanTiles[] = INCBIN_U32("graphics/intro/intro2_brendan.4bpp.lz");
-static const u16 gIntro2MayPalette[] = INCBIN_U16("graphics/intro/intro2_may.gbapal");
-static const u16 gUnknown_085F3490[0xF0] = {0};
-static const u32 gIntro2MayTiles[] = INCBIN_U32("graphics/intro/intro2_may.4bpp.lz");
-static const u32 gIntro2BicycleTiles[] = INCBIN_U32("graphics/intro/intro2_bicycle.4bpp.lz");
-static const u16 gIntro2LatiosPalette[] = INCBIN_U16("graphics/intro/intro2_latios.gbapal");
-static const u32 gIntro2LatiosTiles[] = INCBIN_U32("graphics/intro/intro2_latios.4bpp.lz");
-static const u16 gIntro2LatiasPalette[] = INCBIN_U16("graphics/intro/intro2_latias.gbapal");
-static const u32 gIntro2LatiasTiles[] = INCBIN_U32("graphics/intro/intro2_latias.4bpp.lz");
-
-static void sub_817B62C(struct Sprite *sprite);
-static void nullsub_65(struct Sprite *sprite);
-static void sub_817B7C4(struct Sprite *sprite);
-static void nullsub_66(struct Sprite *sprite);
-
-static const struct SpriteTemplate gUnknown_085F504C =
-{
- .tileTag = 2000,
+static const u16 sGrass_Pal[] = INCBIN_U16("graphics/intro/scene_2/grass.gbapal");
+static const u16 sGrassSunset_Pal[] = INCBIN_U16("graphics/intro/scene_2/grass_sunset.gbapal");
+static const u16 sGrassNight_Pal[] = INCBIN_U16("graphics/intro/scene_2/grass_night.gbapal");
+static const u32 sGrass_Gfx[] = INCBIN_U32("graphics/intro/scene_2/grass.4bpp.lz");
+static const u32 sGrass_Tilemap[] = INCBIN_U32("graphics/intro/scene_2/grass_map.bin.lz");
+static const u16 sCloudsBg_Pal[] = INCBIN_U16("graphics/intro/scene_2/clouds_bg.gbapal");
+static const u16 sCloudsBgSunset_Pal[] = INCBIN_U16("graphics/intro/scene_2/clouds_bg_sunset.gbapal");
+static const u32 sCloudsBg_Gfx[] = INCBIN_U32("graphics/intro/scene_2/clouds_bg.4bpp.lz");
+static const u32 sCloudsBg_Tilemap[] = INCBIN_U32("graphics/intro/scene_2/clouds_bg_map.bin.lz");
+static const u16 sClouds_Pal[] = INCBIN_U16("graphics/intro/scene_2/clouds.gbapal");
+static const u16 sCloudsSunset_Pal[] = INCBIN_U16("graphics/intro/scene_2/clouds_sunset.gbapal");
+static const u32 sClouds_Gfx[] = INCBIN_U32("graphics/intro/scene_2/clouds.4bpp.lz");
+static const u16 sTrees_Pal[] = INCBIN_U16("graphics/intro/scene_2/trees.gbapal");
+static const u16 sTreesSunset_Pal[] = INCBIN_U16("graphics/intro/scene_2/trees_sunset.gbapal");
+static const u32 sTrees_Gfx[] = INCBIN_U32("graphics/intro/scene_2/trees.4bpp.lz");
+static const u32 sTrees_Tilemap[] = INCBIN_U32("graphics/intro/scene_2/trees_map.bin.lz");
+static const u16 sTreesSmall_Pal[] = INCBIN_U16("graphics/intro/scene_2/trees_small.gbapal");
+static const u32 sTreesSmall_Gfx[] = INCBIN_U32("graphics/intro/scene_2/trees_small.4bpp.lz");
+static const u16 sHouses_Pal[] = INCBIN_U16("graphics/intro/scene_2/houses.gbapal");
+static const u32 sHouses_Gfx[] = INCBIN_U32("graphics/intro/scene_2/houses.4bpp.lz");
+static const u16 sHouseSilhouette_Pal[] = INCBIN_U16("graphics/intro/scene_2/house_silhouette.gbapal");
+static const u32 sHouses_Tilemap[] = INCBIN_U32("graphics/intro/scene_2/houses_map.bin.lz");
+static const u32 sHouseSilhouette_Gfx[] = INCBIN_U32("graphics/intro/scene_2/house_silhouette.4bpp.lz");
+static const u16 sBrendanCredits_Pal[] = INCBIN_U16("graphics/intro/scene_2/brendan_credits.gbapal");
+static const u32 sBrendanCredits_Gfx[] = INCBIN_U32("graphics/intro/scene_2/brendan_credits.4bpp.lz");
+static const u16 sMayCredits_Pal[] = INCBIN_U16("graphics/intro/scene_2/may_credits.gbapal");
+static const u16 sUnused[0xF0] = {0};
+static const u32 sMayCredits_Gfx[] = INCBIN_U32("graphics/intro/scene_2/may_credits.4bpp.lz");
+static const u32 sBicycle_Gfx[] = INCBIN_U32("graphics/intro/scene_2/bicycle.4bpp.lz");
+static const u16 sLatios_Pal[] = INCBIN_U16("graphics/intro/scene_2/latios.gbapal");
+static const u32 sLatios_Gfx[] = INCBIN_U32("graphics/intro/scene_2/latios.4bpp.lz");
+static const u16 sLatias_Pal[] = INCBIN_U16("graphics/intro/scene_2/latias.gbapal");
+static const u32 sLatias_Gfx[] = INCBIN_U32("graphics/intro/scene_2/latias.4bpp.lz");
+
+static void SpriteCB_MovingScenery(struct Sprite *sprite);
+static void SpriteCB_Player(struct Sprite *sprite);
+static void SpriteCB_Bicycle(struct Sprite *sprite);
+static void SpriteCB_FlygonLeftHalf(struct Sprite *sprite);
+
+static const struct SpriteTemplate sSpriteTemplate_MovingScenery =
+{
+ .tileTag = TAG_MOVING_SCENERY,
.paletteTag = 0xFFFF,
.oam = &gDummyOamData,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_817B62C
+ .callback = SpriteCB_MovingScenery
};
-static const struct CompressedSpriteSheet gUnknown_085F5064[] =
+static const struct CompressedSpriteSheet sSpriteSheet_Clouds[] =
{
{
- .data = gUnknown_085F16A8,
+ .data = sClouds_Gfx,
.size = 0x400,
- .tag = 2000
+ .tag = TAG_MOVING_SCENERY
},
{}
};
-static const union AnimCmd gUnknown_085F5074[] =
+static const union AnimCmd sAnim_Cloud_Largest[] =
{
ANIMCMD_FRAME( 0, 30),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F507C[] =
+static const union AnimCmd sAnim_Cloud_Large[] =
{
ANIMCMD_FRAME(16, 30),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F5084[] =
+static const union AnimCmd sAnim_Cloud_Small[] =
{
ANIMCMD_FRAME(20, 30),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F508C[] =
+static const union AnimCmd sAnim_Cloud_Smallest[] =
{
ANIMCMD_FRAME(22, 30),
ANIMCMD_END
};
-static const union AnimCmd *const gUnknown_085F5094[] =
+static const union AnimCmd *const sAnims_Clouds[] =
{
- gUnknown_085F5074,
- gUnknown_085F507C,
- gUnknown_085F5084,
- gUnknown_085F508C
+ sAnim_Cloud_Largest,
+ sAnim_Cloud_Large,
+ sAnim_Cloud_Small,
+ sAnim_Cloud_Smallest
};
-static const struct IntroCreditsSpriteMetadata gUnknown_085F50A4[] =
+static const struct IntroCreditsSpriteMetadata sSpriteMetadata_Clouds[] =
{
{
.animNum = 0,
@@ -195,42 +214,42 @@ static const struct IntroCreditsSpriteMetadata gUnknown_085F50A4[] =
},
};
-static const struct CompressedSpriteSheet gUnknown_085F50EC[] =
+static const struct CompressedSpriteSheet sSpriteSheet_TreesSmall[] =
{
{
- .data = gIntro2TreeTiles,
+ .data = sTreesSmall_Gfx,
.size = 0x400,
- .tag = 2000
+ .tag = TAG_MOVING_SCENERY
},
{}
};
-static const union AnimCmd gUnknown_085F50FC[] =
+static const union AnimCmd sAnim_Trees_0[] =
{
ANIMCMD_FRAME( 0, 30),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F5104[] =
+static const union AnimCmd sAnim_Trees_1[] =
{
ANIMCMD_FRAME(16, 30),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F510C[] =
+static const union AnimCmd sAnim_Trees_2[] =
{
ANIMCMD_FRAME(24, 30),
ANIMCMD_END
};
-static const union AnimCmd *const gUnknown_085F5114[] =
+static const union AnimCmd *const sAnims_Trees[] =
{
- gUnknown_085F50FC,
- gUnknown_085F5104,
- gUnknown_085F510C
+ sAnim_Trees_0,
+ sAnim_Trees_1,
+ sAnim_Trees_2
};
-static const struct IntroCreditsSpriteMetadata gUnknown_085F5120[] =
+static const struct IntroCreditsSpriteMetadata sSpriteMetadata_Trees[] =
{
{
.animNum = 0,
@@ -342,28 +361,28 @@ static const struct IntroCreditsSpriteMetadata gUnknown_085F5120[] =
}
};
-static const struct CompressedSpriteSheet gUnknown_085F5180[] =
+static const struct CompressedSpriteSheet sSpriteSheet_HouseSilhouette[] =
{
{
- .data = gIntro2NightTiles,
+ .data = sHouseSilhouette_Gfx,
.size = 0x400,
- .tag = 2000
+ .tag = TAG_MOVING_SCENERY
},
{}
};
-static const union AnimCmd gUnknown_085F5190[] =
+static const union AnimCmd sAnim_HouseSilhouette[] =
{
ANIMCMD_FRAME(0, 30),
ANIMCMD_END
};
-static const union AnimCmd *const gUnknown_085F5198[] =
+static const union AnimCmd *const sAnims_HouseSilhouette[] =
{
- gUnknown_085F5190
+ sAnim_HouseSilhouette
};
-static const struct IntroCreditsSpriteMetadata gUnknown_085F519C[] =
+static const struct IntroCreditsSpriteMetadata sSpriteMetadata_HouseSilhouette[] =
{
{
.animNum = 0,
@@ -421,15 +440,15 @@ static const struct IntroCreditsSpriteMetadata gUnknown_085F519C[] =
}
};
-static const struct OamData gOamData_85F51CC =
+static const struct OamData sOamData_Player =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.shape = SPRITE_SHAPE(64x64),
.size = SPRITE_SIZE(64x64),
.priority = 1
};
-static const union AnimCmd gUnknown_085F51D4[] =
+static const union AnimCmd sAnim_Player[] =
{
ANIMCMD_FRAME( 0, 8),
ANIMCMD_FRAME( 64, 8),
@@ -438,42 +457,42 @@ static const union AnimCmd gUnknown_085F51D4[] =
ANIMCMD_JUMP(0)
};
-static const union AnimCmd *const gUnknown_085F51E8[] =
+static const union AnimCmd *const sAnims_Player[] =
{
- gUnknown_085F51D4
+ sAnim_Player
};
-static const struct SpriteTemplate gUnknown_085F51EC =
+static const struct SpriteTemplate sSpriteTemplate_Brendan =
{
- .tileTag = 1002,
- .paletteTag = 1002,
- .oam = &gOamData_85F51CC,
- .anims = gUnknown_085F51E8,
+ .tileTag = TAG_BRENDAN,
+ .paletteTag = TAG_BRENDAN,
+ .oam = &sOamData_Player,
+ .anims = sAnims_Player,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = nullsub_65
+ .callback = SpriteCB_Player
};
-static const struct SpriteTemplate gUnknown_085F5204 =
+static const struct SpriteTemplate sSpriteTemplate_May =
{
- .tileTag = 1003,
- .paletteTag = 1003,
- .oam = &gOamData_85F51CC,
- .anims = gUnknown_085F51E8,
+ .tileTag = TAG_MAY,
+ .paletteTag = TAG_MAY,
+ .oam = &sOamData_Player,
+ .anims = sAnims_Player,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = nullsub_65
+ .callback = SpriteCB_Player
};
-static const struct OamData gUnknown_085F521C =
+static const struct OamData sOamData_Bicycle =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.shape = SPRITE_SHAPE(64x32),
.size = SPRITE_SIZE(64x32),
.priority = 1
};
-static const union AnimCmd gUnknown_085F5224[] =
+static const union AnimCmd sAnim_Bicycle[] =
{
ANIMCMD_FRAME( 0, 8),
ANIMCMD_FRAME( 32, 8),
@@ -482,261 +501,267 @@ static const union AnimCmd gUnknown_085F5224[] =
ANIMCMD_JUMP(0)
};
-static const union AnimCmd *const gUnknown_085F5238[] =
+static const union AnimCmd *const sAnims_Bicycle[] =
{
- gUnknown_085F5224
+ sAnim_Bicycle
};
-static const struct SpriteTemplate gUnknown_085F523C =
+static const struct SpriteTemplate sSpriteTemplate_BrendanBicycle =
{
- .tileTag = 1001,
- .paletteTag = 1002,
- .oam = &gUnknown_085F521C,
- .anims = gUnknown_085F5238,
+ .tileTag = TAG_BICYCLE,
+ .paletteTag = TAG_BRENDAN,
+ .oam = &sOamData_Bicycle,
+ .anims = sAnims_Bicycle,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_817B7C4
+ .callback = SpriteCB_Bicycle
};
-static const struct SpriteTemplate gUnknown_085F5254 =
+static const struct SpriteTemplate sSpriteTemplate_MayBicycle =
{
- .tileTag = 1001,
- .paletteTag = 1003,
- .oam = &gUnknown_085F521C,
- .anims = gUnknown_085F5238,
+ .tileTag = TAG_BICYCLE,
+ .paletteTag = TAG_MAY,
+ .oam = &sOamData_Bicycle,
+ .anims = sAnims_Bicycle,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = sub_817B7C4
+ .callback = SpriteCB_Bicycle
};
-static const struct OamData gUnknown_085F526C =
+static const struct OamData sOamData_Flygon =
{
- .y = 160,
+ .y = DISPLAY_HEIGHT,
.shape = SPRITE_SHAPE(64x64),
.size = SPRITE_SIZE(64x64),
.priority = 1
};
-static const union AnimCmd gUnknown_085F5274[] =
+static const union AnimCmd sAnim_FlygonLeft[] =
{
- ANIMCMD_FRAME( 0, 16),
+ ANIMCMD_FRAME(0, 16),
ANIMCMD_END
};
-static const union AnimCmd gUnknown_085F527C[] =
+static const union AnimCmd sAnim_FlygonRight[] =
{
- ANIMCMD_FRAME( 64, 16),
+ ANIMCMD_FRAME(64, 16),
ANIMCMD_END
};
-static const union AnimCmd *const gUnknown_085F5284[] =
+static const union AnimCmd *const sAnims_Flygon[] =
{
- gUnknown_085F5274,
- gUnknown_085F527C
+ sAnim_FlygonLeft,
+ sAnim_FlygonRight
};
-static const struct SpriteTemplate gUnknown_085F528C =
+static const struct SpriteTemplate sSpriteTemplate_FlygonLatios =
{
- .tileTag = 1004,
- .paletteTag = 1004,
- .oam = &gUnknown_085F526C,
- .anims = gUnknown_085F5284,
+ .tileTag = TAG_FLYGON_LATIOS,
+ .paletteTag = TAG_FLYGON_LATIOS,
+ .oam = &sOamData_Flygon,
+ .anims = sAnims_Flygon,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = nullsub_66
+ .callback = SpriteCB_FlygonLeftHalf
};
-static const struct SpriteTemplate gUnknown_085F52A4 =
+static const struct SpriteTemplate sSpriteTemplate_FlygonLatias =
{
- .tileTag = 1005,
- .paletteTag = 1005,
- .oam = &gUnknown_085F526C,
- .anims = gUnknown_085F5284,
+ .tileTag = TAG_FLYGON_LATIAS,
+ .paletteTag = TAG_FLYGON_LATIAS,
+ .oam = &sOamData_Flygon,
+ .anims = sAnims_Flygon,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
- .callback = nullsub_66
+ .callback = SpriteCB_FlygonLeftHalf
};
-const struct CompressedSpriteSheet gIntro2BrendanSpriteSheet[] =
+const struct CompressedSpriteSheet gSpriteSheet_IntroBrendan[] =
{
{
- .data = gIntro2BrendanNoTurnGfx,
+ .data = gIntroBrendan_Gfx,
.size = 0x2000,
- .tag = 1002
+ .tag = TAG_BRENDAN
},
{}
};
-const struct CompressedSpriteSheet gIntro2MaySpriteSheet[] =
+const struct CompressedSpriteSheet gSpriteSheet_IntroMay[] =
{
{
- .data = gIntro2MayNoTurnGfx,
+ .data = gIntroMay_Gfx,
.size = 0x2000,
- .tag = 1003
+ .tag = TAG_MAY
},
{}
};
-const struct CompressedSpriteSheet gIntro2BicycleSpriteSheet[] =
+const struct CompressedSpriteSheet gSpriteSheet_IntroBicycle[] =
{
{
- .data = gIntro2BicycleTiles,
+ .data = sBicycle_Gfx,
.size = 0x1000,
- .tag = 1001
+ .tag = TAG_BICYCLE
},
{}
};
-static const struct CompressedSpriteSheet gUnknown_085F52EC[] =
+// In RS these were Latios/Latias. In Emerald both are replaced with Flygon and now only 1 is used
+static const struct CompressedSpriteSheet sSpriteSheet_IntroFlygon_Unused[] =
{
{
- .data = gIntro2FlygonGfx,
+ .data = gIntroFlygon_Gfx,
.size = 0x1000,
- .tag = 1004
+ .tag = TAG_FLYGON_LATIOS
},
{}
};
-const struct CompressedSpriteSheet gIntro2FlygonSpriteSheet[] =
+const struct CompressedSpriteSheet gSpriteSheet_IntroFlygon[] =
{
{
- .data = gIntro2FlygonGfx,
+ .data = gIntroFlygon_Gfx,
.size = 0x1000,
- .tag = 1005
+ .tag = TAG_FLYGON_LATIAS
},
{}
};
-const struct SpritePalette gIntroBikeAndFlygonPalette[] =
+const struct SpritePalette gSpritePalettes_IntroPlayerFlygon[] =
{
- { .data = gIntro2BrendanNoTurnPal, .tag = 1002 },
- { .data = gIntro2BrendanNoTurnPal, .tag = 1003 },
- { .data = gIntro2FlygonPal, .tag = 1004 },
- { .data = gIntro2FlygonPal, .tag = 1005 },
+ { .data = gIntroPlayer_Pal, .tag = TAG_BRENDAN },
+ { .data = gIntroPlayer_Pal, .tag = TAG_MAY },
+ { .data = gIntroFlygon_Pal, .tag = TAG_FLYGON_LATIOS },
+ { .data = gIntroFlygon_Pal, .tag = TAG_FLYGON_LATIAS },
{}
};
-const struct CompressedSpriteSheet gUnknown_085F5334[] =
+const struct CompressedSpriteSheet gSpriteSheet_CreditsBrendan[] =
{
{
- .data = gIntro2BrendanTiles,
+ .data = sBrendanCredits_Gfx,
.size = 0x3800,
- .tag = 1002
+ .tag = TAG_BRENDAN
},
{}
};
-const struct CompressedSpriteSheet gUnknown_085F5344[] =
+const struct CompressedSpriteSheet gSpriteSheet_CreditsMay[] =
{
{
- .data = gIntro2MayTiles,
+ .data = sMayCredits_Gfx,
.size = 0x3800,
- .tag = 1003
+ .tag = TAG_MAY
},
{}
};
-const struct CompressedSpriteSheet gUnknown_085F5354[] =
+const struct CompressedSpriteSheet gSpriteSheet_CreditsBicycle[] =
{
{
- .data = gIntro2BicycleTiles,
+ .data = sBicycle_Gfx,
.size = 0x1000,
- .tag = 1001
+ .tag = TAG_BICYCLE
},
{}
};
-static const struct CompressedSpriteSheet gUnknown_085F5364[] =
+// Unused
+static const struct CompressedSpriteSheet sSpriteSheet_Latios[] =
{
{
- .data = gIntro2LatiosTiles,
+ .data = sLatios_Gfx,
.size = 0x1000,
- .tag = 1004
+ .tag = TAG_FLYGON_LATIOS
},
{}
};
-static const struct CompressedSpriteSheet gUnknown_085F5374[] =
+// Unused
+static const struct CompressedSpriteSheet sSpriteSheet_Latias[] =
{
{
- .data = gIntro2LatiasTiles,
+ .data = sLatias_Gfx,
.size = 0x1000,
- .tag = 1005
+ .tag = TAG_FLYGON_LATIAS
},
{}
};
-const struct SpritePalette gUnknown_085F5384[] =
+const struct SpritePalette gSpritePalettes_Credits[] =
{
- { .data = gIntro2BrendanPalette, .tag = 1002 },
- { .data = gIntro2MayPalette, .tag = 1003 },
- { .data = gIntro2LatiosPalette, .tag = 1004 },
- { .data = gIntro2LatiasPalette, .tag = 1005 },
+ { .data = sBrendanCredits_Pal, .tag = TAG_BRENDAN },
+ { .data = sMayCredits_Pal, .tag = TAG_MAY },
+ { .data = sLatios_Pal, .tag = TAG_FLYGON_LATIOS },
+ { .data = sLatias_Pal, .tag = TAG_FLYGON_LATIAS },
{}
};
-const struct CompressedSpriteSheet gUnknown_085F53AC[] =
+const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalBrendan[] =
{
{
- .data = gIntro2BrendanTiles,
+ .data = sBrendanCredits_Gfx,
.size = 0x2000,
- .tag = 1002
+ .tag = TAG_BRENDAN
},
{}
};
-const struct CompressedSpriteSheet gUnknown_085F53BC[] =
+const struct CompressedSpriteSheet gSpriteSheet_CreditsRivalMay[] =
{
{
- .data = gIntro2MayTiles,
+ .data = sMayCredits_Gfx,
.size = 0x2000,
- .tag = 1003
+ .tag = TAG_MAY
},
{}
};
-EWRAM_DATA u16 gUnknown_0203BD24 = 0;
-EWRAM_DATA s16 gUnknown_0203BD26 = 0;
-EWRAM_DATA s16 gUnknown_0203BD28 = 0;
+EWRAM_DATA u16 gIntroCredits_MovingSceneryVBase = 0;
+EWRAM_DATA s16 gIntroCredits_MovingSceneryVOffset = 0;
+EWRAM_DATA s16 gIntroCredits_MovingSceneryState = 0;
-static void sub_817B76C(void);
-static void sub_817B788(void);
-static void sub_817B7A4(void);
-static void sub_817B458(u8);
+static void CreateCloudSprites(void);
+static void CreateTreeSprites(void);
+static void CreateHouseSprites(void);
+static void Task_BicycleBgAnimation(u8);
-void load_intro_part2_graphics(u8 a)
+void LoadIntroPart2Graphics(u8 scenery)
{
- LZ77UnCompVram(gUnknown_085F0740, (void *)(BG_CHAR_ADDR(1)));
- LZ77UnCompVram(gUnknown_085F0BC0, (void *)(BG_SCREEN_ADDR(15)));
- LoadPalette(&gUnknown_085F06E0, 240, 32);
- switch (a)
+ LZ77UnCompVram(sGrass_Gfx, (void *)(BG_CHAR_ADDR(1)));
+ LZ77UnCompVram(sGrass_Tilemap, (void *)(BG_SCREEN_ADDR(15)));
+ LoadPalette(&sGrass_Pal, 240, sizeof(sGrass_Pal));
+ switch (scenery)
{
case 0:
default:
- LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F1398, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F0CFC, 0, 96);
- LoadCompressedSpriteSheet(gUnknown_085F5064);
- LoadPalette(&gUnknown_085F1668, 256, 32);
- sub_817B76C();
+ // Never reached, only called with an argument of 1
+ // Clouds are never used in this part of the intro
+ LZ77UnCompVram(sCloudsBg_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sCloudsBg_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sCloudsBg_Pal, 0, sizeof(sCloudsBg_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_Clouds);
+ LoadPalette(&sClouds_Pal, 256, sizeof(sClouds_Pal));
+ CreateCloudSprites();
break;
case 1:
- LZ77UnCompVram(gUnknown_085F1824, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F1EAC, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F17E4, 0, 32);
- LoadCompressedSpriteSheet(gUnknown_085F50EC);
- LoadPalette(&gUnknown_085F21B0, 256, 32);
- sub_817B788();
+ LZ77UnCompVram(sTrees_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sTrees_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sTrees_Pal, 0, sizeof(sTrees_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_TreesSmall);
+ LoadPalette(&sTreesSmall_Pal, 256, sizeof(sTreesSmall_Pal));
+ CreateTreeSprites();
break;
}
- gUnknown_0203BD28 = 0;
+ gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_NORMAL;
gReservedSpritePaletteCount = 8;
}
// Note: This is only called with a=1.
-void sub_817B150(u8 a)
+void SetIntroPart2BgCnt(u8 scenery)
{
- switch (a)
+ // Only called with scenery = 1
+ switch (scenery)
{
default:
case 0:
@@ -811,58 +836,58 @@ void sub_817B150(u8 a)
}
}
-void sub_817B1C8(u8 a)
+void LoadCreditsSceneGraphics(u8 scene)
{
- LZ77UnCompVram(gUnknown_085F0740, (void *)(BG_CHAR_ADDR(1)));
- LZ77UnCompVram(gUnknown_085F0BC0, (void *)(BG_SCREEN_ADDR(15)));
- switch (a)
+ LZ77UnCompVram(sGrass_Gfx, (void *)(BG_CHAR_ADDR(1)));
+ LZ77UnCompVram(sGrass_Tilemap, (void *)(BG_SCREEN_ADDR(15)));
+ switch (scene)
{
- case 0:
+ case SCENE_OCEAN_MORNING:
default:
- LoadPalette(&gUnknown_085F06E0, 240, 32);
- LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F1398, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F0CFC, 0, 96);
- LoadCompressedSpriteSheet(gUnknown_085F5064);
- LZ77UnCompVram(gUnknown_085F16A8, (void *)(OBJ_VRAM0));
- LoadPalette(&gUnknown_085F1668, 256, 32);
- sub_817B76C();
+ LoadPalette(&sGrass_Pal, 240, sizeof(sGrass_Pal));
+ LZ77UnCompVram(sCloudsBg_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sCloudsBg_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sCloudsBg_Pal, 0, sizeof(sCloudsBg_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_Clouds);
+ LZ77UnCompVram(sClouds_Gfx, (void *)(OBJ_VRAM0));
+ LoadPalette(&sClouds_Pal, 256, sizeof(sClouds_Pal));
+ CreateCloudSprites();
break;
- case 1:
- LoadPalette(&gUnknown_085F0700, 240, 32);
- LZ77UnCompVram(gUnknown_085F0DBC, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F1398, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F0D5C, 0, 96);
- LoadCompressedSpriteSheet(gUnknown_085F5064);
- LZ77UnCompVram(gUnknown_085F16A8, (void *)(OBJ_VRAM0));
- LoadPalette(&gUnknown_085F1688, 256, 32);
- sub_817B76C();
+ case SCENE_OCEAN_SUNSET:
+ LoadPalette(&sGrassSunset_Pal, 240, sizeof(sGrassSunset_Pal));
+ LZ77UnCompVram(sCloudsBg_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sCloudsBg_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sCloudsBgSunset_Pal, 0, sizeof(sCloudsBgSunset_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_Clouds);
+ LZ77UnCompVram(sClouds_Gfx, (void *)(OBJ_VRAM0));
+ LoadPalette(&sCloudsSunset_Pal, 256, sizeof(sCloudsSunset_Pal));
+ CreateCloudSprites();
break;
- case 2:
- case 3:
- LoadPalette(&gUnknown_085F0700, 240, 32);
- LZ77UnCompVram(gUnknown_085F1824, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F1EAC, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F1804, 0, 32);
- LoadCompressedSpriteSheet(gUnknown_085F50EC);
- LoadPalette(&gUnknown_085F1804, 256, 32);
- sub_817B788();
+ case SCENE_FOREST_RIVAL_ARRIVE:
+ case SCENE_FOREST_CATCH_RIVAL:
+ LoadPalette(&sGrassSunset_Pal, 240, sizeof(sGrassSunset_Pal));
+ LZ77UnCompVram(sTrees_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sTrees_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sTreesSunset_Pal, 0, sizeof(sTreesSunset_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_TreesSmall);
+ LoadPalette(&sTreesSunset_Pal, 256, sizeof(sTreesSunset_Pal));
+ CreateTreeSprites();
break;
- case 4:
- LoadPalette(&gUnknown_085F0720, 240, 32);
- LZ77UnCompVram(gUnknown_085F235C, (void *)(VRAM));
- LZ77UnCompVram(gUnknown_085F2568, (void *)(BG_SCREEN_ADDR(6)));
- LoadPalette(&gUnknown_085F231C, 0, 64);
- LoadCompressedSpriteSheet(gUnknown_085F5180);
- LoadPalette(&gUnknown_085F2548, 256, 32);
- sub_817B7A4();
+ case SCENE_CITY_NIGHT:
+ LoadPalette(&sGrassNight_Pal, 240, sizeof(sGrassNight_Pal));
+ LZ77UnCompVram(sHouses_Gfx, (void *)(VRAM));
+ LZ77UnCompVram(sHouses_Tilemap, (void *)(BG_SCREEN_ADDR(6)));
+ LoadPalette(&sHouses_Pal, 0, sizeof(sHouses_Pal));
+ LoadCompressedSpriteSheet(sSpriteSheet_HouseSilhouette);
+ LoadPalette(&sHouseSilhouette_Pal, 256, sizeof(sHouseSilhouette_Pal));
+ CreateHouseSprites();
break;
}
gReservedSpritePaletteCount = 8;
- gUnknown_0203BD28 = 0;
+ gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_NORMAL;
}
-void sub_817B3A8(u8 a)
+void SetCreditsSceneBgCnt(u8 scene)
{
SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3)
| BGCNT_CHARBASE(0)
@@ -885,69 +910,84 @@ void sub_817B3A8(u8 a)
| DISPCNT_OBJ_ON);
}
-u8 CreateBicycleAnimationTask(u8 a, u16 b, u16 c, u16 d)
-{
- u8 taskId = CreateTask(&sub_817B458, 0);
-
- gTasks[taskId].data[0] = a;
- gTasks[taskId].data[1] = b;
- gTasks[taskId].data[2] = 0;
- gTasks[taskId].data[3] = 0;
- gTasks[taskId].data[4] = c;
- gTasks[taskId].data[5] = 0;
- gTasks[taskId].data[6] = 0;
- gTasks[taskId].data[7] = d;
- gTasks[taskId].data[8] = 8;
- gTasks[taskId].data[9] = 0;
- sub_817B458(taskId);
+#define tMode data[0] // Can be 0-2, but only != 0 matters. Determines vertical movement for bg2
+#define tBg1Speed data[1]
+#define tBg1PosHi data[2]
+#define tBg1PosLo data[3]
+#define tBg2Speed data[4]
+#define tBg2PosHi data[5]
+#define tBg2PosLo data[6]
+#define tBg3Speed data[7]
+#define tBg3PosHi data[8]
+#define tBg3PosLo data[9]
+
+// Create task that manages the moving backgrounds during the bicycle ride
+u8 CreateBicycleBgAnimationTask(u8 mode, u16 bg1Speed, u16 bg2Speed, u16 bg3Speed)
+{
+ u8 taskId = CreateTask(Task_BicycleBgAnimation, 0);
+
+ gTasks[taskId].tMode = mode;
+ gTasks[taskId].tBg1Speed = bg1Speed;
+ gTasks[taskId].tBg1PosHi = 0;
+ gTasks[taskId].tBg1PosLo = 0;
+ gTasks[taskId].tBg2Speed = bg2Speed;
+ gTasks[taskId].tBg2PosHi = 0;
+ gTasks[taskId].tBg2PosLo = 0;
+ gTasks[taskId].tBg3Speed = bg3Speed;
+ gTasks[taskId].tBg3PosHi = 8;
+ gTasks[taskId].tBg3PosLo = 0;
+ Task_BicycleBgAnimation(taskId);
return taskId;
}
-static void sub_817B458(u8 taskId)
+static void Task_BicycleBgAnimation(u8 taskId)
{
- s16 data1;
- s16 data4;
- s16 data7;
- s32 r2;
+ s16 bg1Speed;
+ s16 bg2Speed;
+ s16 bg3Speed;
+ s32 offset;
- data1 = gTasks[taskId].data[1];
- if (data1 != 0)
+ // Move BG1
+ bg1Speed = gTasks[taskId].tBg1Speed;
+ if (bg1Speed != 0)
{
- r2 = (gTasks[taskId].data[2] << 16) + (u16)gTasks[taskId].data[3];
- r2 -= (u16)data1 << 4;
- gTasks[taskId].data[2] = r2 >> 16;
- gTasks[taskId].data[3] = r2;
- SetGpuReg(REG_OFFSET_BG1HOFS, gTasks[taskId].data[2]);
- SetGpuReg(REG_OFFSET_BG1VOFS, gUnknown_0203BD24 + gUnknown_0203BD26);
+ offset = (gTasks[taskId].tBg1PosHi << 16) + (u16)gTasks[taskId].tBg1PosLo;
+ offset -= (u16)bg1Speed << 4;
+ gTasks[taskId].tBg1PosHi = offset >> 16;
+ gTasks[taskId].tBg1PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG1HOFS, gTasks[taskId].tBg1PosHi);
+ SetGpuReg(REG_OFFSET_BG1VOFS, gIntroCredits_MovingSceneryVBase + gIntroCredits_MovingSceneryVOffset);
}
- data4 = gTasks[taskId].data[4];
- if (data4 != 0)
+ // Move BG2
+ bg2Speed = gTasks[taskId].tBg2Speed;
+ if (bg2Speed != 0)
{
- r2 = (gTasks[taskId].data[5] << 16) + (u16)gTasks[taskId].data[6];
- r2 -= (u16)data4 << 4;
- gTasks[taskId].data[5] = r2 >> 16;
- gTasks[taskId].data[6] = r2;
- SetGpuReg(REG_OFFSET_BG2HOFS, gTasks[taskId].data[5]);
- if (gTasks[taskId].data[0] != 0)
- SetGpuReg(REG_OFFSET_BG2VOFS, gUnknown_0203BD24 + gUnknown_0203BD26);
+ offset = (gTasks[taskId].tBg2PosHi << 16) + (u16)gTasks[taskId].tBg2PosLo;
+ offset -= (u16)bg2Speed << 4;
+ gTasks[taskId].tBg2PosHi = offset >> 16;
+ gTasks[taskId].tBg2PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG2HOFS, gTasks[taskId].tBg2PosHi);
+ if (gTasks[taskId].tMode != 0)
+ SetGpuReg(REG_OFFSET_BG2VOFS, gIntroCredits_MovingSceneryVBase + gIntroCredits_MovingSceneryVOffset);
else
- SetGpuReg(REG_OFFSET_BG2VOFS, gUnknown_0203BD24);
+ SetGpuReg(REG_OFFSET_BG2VOFS, gIntroCredits_MovingSceneryVBase);
}
- data7 = gTasks[taskId].data[7];
- if (data7 != 0)
+ // Move BG3
+ bg3Speed = gTasks[taskId].tBg3Speed;
+ if (bg3Speed != 0)
{
- r2 = (gTasks[taskId].data[8] << 16) + (u16)gTasks[taskId].data[9];
- r2 -= (u16)data7 << 4;
- gTasks[taskId].data[8] = r2 >> 16;
- gTasks[taskId].data[9] = r2;
- SetGpuReg(REG_OFFSET_BG3HOFS, gTasks[taskId].data[8]);
- SetGpuReg(REG_OFFSET_BG3VOFS, gUnknown_0203BD24);
+ offset = (gTasks[taskId].tBg3PosHi << 16) + (u16)gTasks[taskId].tBg3PosLo;
+ offset -= (u16)bg3Speed << 4;
+ gTasks[taskId].tBg3PosHi = offset >> 16;
+ gTasks[taskId].tBg3PosLo = offset;
+ SetGpuReg(REG_OFFSET_BG3HOFS, gTasks[taskId].tBg3PosHi);
+ SetGpuReg(REG_OFFSET_BG3VOFS, gIntroCredits_MovingSceneryVBase);
}
}
-void sub_817B540(u8 mode)
+void CycleSceneryPalette(u8 mode)
{
u16 x;
u16 y;
@@ -955,7 +995,6 @@ void sub_817B540(u8 mode)
{
case 0:
default:
- /* stuff */
if (gMain.vblankCounter1 & 3 || gPaletteFade.active)
break;
if (gMain.vblankCounter1 & 4)
@@ -968,149 +1007,167 @@ void sub_817B540(u8 mode)
x = gPlttBufferUnfaded[10];
y = gPlttBufferUnfaded[9];
}
- LoadPalette(&x, 9, 2);
- LoadPalette(&y, 10, 2);
+ LoadPalette(&x, 9, sizeof(x));
+ LoadPalette(&y, 10, sizeof(y));
break;
case 2:
if (gMain.vblankCounter1 & 3 || gPaletteFade.active)
break;
if (gMain.vblankCounter1 & 4)
{
- x = 0x3D27;
- y = 0x295;
+ x = RGB(7, 9, 15);
+ y = RGB(21, 20, 0);
}
else
{
- x = 0x31C;
- y = 0x3D27;
+ x = RGB(28, 24, 0);
+ y = RGB(7, 9, 15);
}
- LoadPalette(&x, 12, 2);
- LoadPalette(&y, 13, 2);
+ LoadPalette(&x, 12, sizeof(x));
+ LoadPalette(&y, 13, sizeof(y));
break;
case 1:
break;
}
}
-static void sub_817B62C(struct Sprite *sprite)
+#define tHasVerticalMove data[0]
+#define tXOffset data[1]
+#define tXPos data[2]
+
+static void SpriteCB_MovingScenery(struct Sprite *sprite)
{
- s32 var;
- s16 var2 = gUnknown_0203BD28;
+ s32 x;
+ s16 state = gIntroCredits_MovingSceneryState;
- if (var2 != 2)
+ if (state != INTROCRED_SCENERY_FROZEN)
{
- switch (var2)
+ switch (state)
{
- default:
+ default: // INTROCRED_SCENERY_DESTROY
DestroySprite(sprite);
break;
- case 0:
- var = ((sprite->pos1.x << 16) | (u16)sprite->data[2]) + (u16)sprite->data[1];
- sprite->pos1.x = var >> 16;
- sprite->data[2] = var;
- if (sprite->pos1.x > 0xFF)
- sprite->pos1.x = -0x20;
- if (sprite->data[0])
- sprite->pos2.y = -(gUnknown_0203BD24 + gUnknown_0203BD26);
+ case INTROCRED_SCENERY_NORMAL:
+ x = ((sprite->pos1.x << 16) | (u16)sprite->tXPos) + (u16)sprite->tXOffset;
+ sprite->pos1.x = x >> 16;
+ sprite->tXPos = x;
+ if (sprite->pos1.x > 255)
+ sprite->pos1.x = -32;
+ if (sprite->tHasVerticalMove)
+ sprite->pos2.y = -(gIntroCredits_MovingSceneryVBase + gIntroCredits_MovingSceneryVOffset);
else
- sprite->pos2.y = -gUnknown_0203BD24;
+ sprite->pos2.y = -gIntroCredits_MovingSceneryVBase;
break;
}
}
}
-static void sub_817B698(u8 a, const struct IntroCreditsSpriteMetadata *b, const union AnimCmd *const *c, u8 d)
+static void CreateMovingScenerySprites(bool8 hasVerticalMove, const struct IntroCreditsSpriteMetadata *metadata, const union AnimCmd *const *anims, u8 numSprites)
{
u8 i;
- for(i = 0; i < d; i++)
+ for(i = 0; i < numSprites; i++)
{
- u8 sprite = CreateSprite(&gUnknown_085F504C, b[i].x, b[i].y, b[i].subpriority);
- CalcCenterToCornerVec(&gSprites[sprite], b[i].shape, b[i].size, ST_OAM_AFFINE_OFF);
+ u8 sprite = CreateSprite(&sSpriteTemplate_MovingScenery, metadata[i].x, metadata[i].y, metadata[i].subpriority);
+ CalcCenterToCornerVec(&gSprites[sprite], metadata[i].shape, metadata[i].size, ST_OAM_AFFINE_OFF);
gSprites[sprite].oam.priority = 3;
- gSprites[sprite].oam.shape = b[i].shape;
- gSprites[sprite].oam.size = b[i].size;
+ gSprites[sprite].oam.shape = metadata[i].shape;
+ gSprites[sprite].oam.size = metadata[i].size;
gSprites[sprite].oam.paletteNum = 0;
- gSprites[sprite].anims = c;
- StartSpriteAnim(&gSprites[sprite], b[i].animNum);
- gSprites[sprite].data[0] = a;
- gSprites[sprite].data[1] = b[i].xOff;
- gSprites[sprite].data[2] = 0;
+ gSprites[sprite].anims = anims;
+ StartSpriteAnim(&gSprites[sprite], metadata[i].animNum);
+ gSprites[sprite].tHasVerticalMove = hasVerticalMove;
+ gSprites[sprite].tXOffset = metadata[i].xOff;
+ gSprites[sprite].tXPos = 0;
}
}
-static void sub_817B76C(void)
+#undef tHasVerticalMove
+#undef tXOffset
+#undef tXPos
+
+static void CreateCloudSprites(void)
{
- sub_817B698(0, gUnknown_085F50A4, gUnknown_085F5094, 9);
+ CreateMovingScenerySprites(FALSE, sSpriteMetadata_Clouds, sAnims_Clouds, 9);
}
-static void sub_817B788(void)
+static void CreateTreeSprites(void)
{
- sub_817B698(1, gUnknown_085F5120, gUnknown_085F5114, 12);
+ CreateMovingScenerySprites(TRUE, sSpriteMetadata_Trees, sAnims_Trees, 12);
}
-static void sub_817B7A4(void)
+static void CreateHouseSprites(void)
{
- sub_817B698(1, gUnknown_085F519C, gUnknown_085F5198, 6);
+ CreateMovingScenerySprites(TRUE, sSpriteMetadata_HouseSilhouette, sAnims_HouseSilhouette, 6);
}
-static void nullsub_65(struct Sprite *sprite)
+static void SpriteCB_Player(struct Sprite *sprite)
{
}
-static void sub_817B7C4(struct Sprite* sprite)
+#define sPlayerSpriteId data[0]
+
+static void SpriteCB_Bicycle(struct Sprite* sprite)
{
- sprite->invisible = gSprites[sprite->data[0]].invisible;
- sprite->pos1.x = gSprites[sprite->data[0]].pos1.x;
- sprite->pos1.y = gSprites[sprite->data[0]].pos1.y + 8;
- sprite->pos2.x = gSprites[sprite->data[0]].pos2.x;
- sprite->pos2.y = gSprites[sprite->data[0]].pos2.y;
+ sprite->invisible = gSprites[sprite->sPlayerSpriteId].invisible;
+ sprite->pos1.x = gSprites[sprite->sPlayerSpriteId].pos1.x;
+ sprite->pos1.y = gSprites[sprite->sPlayerSpriteId].pos1.y + 8;
+ sprite->pos2.x = gSprites[sprite->sPlayerSpriteId].pos2.x;
+ sprite->pos2.y = gSprites[sprite->sPlayerSpriteId].pos2.y;
}
-u8 intro_create_brendan_sprite(s16 a, s16 b)
+u8 CreateIntroBrendanSprite(s16 x, s16 y)
{
- u8 sprite = CreateSprite(&gUnknown_085F51EC, a, b, 2);
- u8 brendan = CreateSprite(&gUnknown_085F523C, a, b + 8, 3);
- gSprites[brendan].data[0] = sprite;
- return sprite;
+ u8 playerSpriteId = CreateSprite(&sSpriteTemplate_Brendan, x, y, 2);
+ u8 bicycleSpriteId = CreateSprite(&sSpriteTemplate_BrendanBicycle, x, y + 8, 3);
+ gSprites[bicycleSpriteId].sPlayerSpriteId = playerSpriteId;
+ return playerSpriteId;
}
-u8 intro_create_may_sprite(s16 a, s16 b)
+u8 CreateIntroMaySprite(s16 x, s16 y)
{
- u8 sprite = CreateSprite(&gUnknown_085F5204, a, b, 2);
- u8 may = CreateSprite(&gUnknown_085F5254, a, b + 8, 3);
- gSprites[may].data[0] = sprite;
- return sprite;
+ u8 playerSpriteId = CreateSprite(&sSpriteTemplate_May, x, y, 2);
+ u8 bicycleSpriteId = CreateSprite(&sSpriteTemplate_MayBicycle, x, y + 8, 3);
+ gSprites[bicycleSpriteId].sPlayerSpriteId = playerSpriteId;
+ return playerSpriteId;
}
-static void nullsub_66(struct Sprite *sprite)
+#undef sPlayerSpriteId
+
+static void SpriteCB_FlygonLeftHalf(struct Sprite *sprite)
{
}
-static void sub_817B8E8(struct Sprite* sprite)
+#define sLeftSpriteId data[0]
+
+static void SpriteCB_FlygonRightHalf(struct Sprite* sprite)
{
- sprite->invisible = gSprites[sprite->data[0]].invisible;
- sprite->pos1.y = gSprites[sprite->data[0]].pos1.y;
- sprite->pos2.x = gSprites[sprite->data[0]].pos2.x;
- sprite->pos2.y = gSprites[sprite->data[0]].pos2.y;
+ sprite->invisible = gSprites[sprite->sLeftSpriteId].invisible;
+ sprite->pos1.y = gSprites[sprite->sLeftSpriteId].pos1.y;
+ sprite->pos2.x = gSprites[sprite->sLeftSpriteId].pos2.x;
+ sprite->pos2.y = gSprites[sprite->sLeftSpriteId].pos2.y;
}
-static u8 sub_817B948(s16 a, s16 b)
+// In RS these were for Latios/Latias. In Emerald both are replaced with Flygon and now only 1 is used
+static u8 CreateIntroFlygonSprite_Unused(s16 x, s16 y)
{
- u8 sprite = CreateSprite(&gUnknown_085F528C, a - 32, b, 5);
- u8 latios = CreateSprite(&gUnknown_085F528C, a + 32, b, 6);
- gSprites[latios].data[0] = sprite;
- StartSpriteAnim(&gSprites[latios], 1);
- gSprites[latios].callback = &sub_817B8E8;
- return sprite;
+ u8 leftSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatios, x - 32, y, 5);
+ u8 rightSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatios, x + 32, y, 6);
+ gSprites[rightSpriteId].sLeftSpriteId = leftSpriteId;
+ StartSpriteAnim(&gSprites[rightSpriteId], 1);
+ gSprites[rightSpriteId].callback = &SpriteCB_FlygonRightHalf;
+ return leftSpriteId;
}
-u8 intro_create_flygon_sprite(s16 a, s16 b)
+
+u8 CreateIntroFlygonSprite(s16 x, s16 y)
{
- u8 sprite = CreateSprite(&gUnknown_085F52A4, a - 32, b, 5);
- u8 flygon = CreateSprite(&gUnknown_085F52A4, a + 32, b, 6);
- gSprites[flygon].data[0] = sprite;
- StartSpriteAnim(&gSprites[flygon], 1);
- gSprites[flygon].callback = &sub_817B8E8;
- return sprite;
+ u8 leftSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatias, x - 32, y, 5);
+ u8 rightSpriteId = CreateSprite(&sSpriteTemplate_FlygonLatias, x + 32, y, 6);
+ gSprites[rightSpriteId].sLeftSpriteId = leftSpriteId;
+ StartSpriteAnim(&gSprites[rightSpriteId], 1);
+ gSprites[rightSpriteId].callback = &SpriteCB_FlygonRightHalf;
+ return leftSpriteId;
}
+
+#undef sLeftSpriteId
diff --git a/src/menu_specialized.c b/src/menu_specialized.c
index 8eda1621e..687324612 100644
--- a/src/menu_specialized.c
+++ b/src/menu_specialized.c
@@ -1150,7 +1150,7 @@ static const union AnimCmd *const sAnims_ConditionSelectionIcon[] =
// Just loads the generic data, up to the caller to load the actual sheet/pal for the specific mon
void LoadConditionMonPicTemplate(struct SpriteSheet *sheet, struct SpriteTemplate *template, struct SpritePalette *pal)
{
- struct SpriteSheet dataSheet = {NULL, 0x800, TAG_CONDITION_MON};
+ struct SpriteSheet dataSheet = {NULL, MON_PIC_SIZE, TAG_CONDITION_MON};
struct SpriteTemplate dataTemplate =
{
diff --git a/src/mystery_gift.c b/src/mystery_gift.c
index a23f159b2..1e00a5788 100644
--- a/src/mystery_gift.c
+++ b/src/mystery_gift.c
@@ -394,10 +394,10 @@ bool32 HandleMysteryGiftOrEReaderSetup(s32 mg_or_ereader)
ChangeBgX(3, 0, 0);
ChangeBgY(3, 0, 0);
- SetBgTilemapBuffer(3, Alloc(0x800));
- SetBgTilemapBuffer(2, Alloc(0x800));
- SetBgTilemapBuffer(1, Alloc(0x800));
- SetBgTilemapBuffer(0, Alloc(0x800));
+ SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(2, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(1, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(0, Alloc(BG_SCREEN_SIZE));
bgid_upload_textbox_1(3);
InitWindows(sMainWindows);
diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c
index 33f08f590..a1b7d36aa 100755
--- a/src/pokemon_jump.c
+++ b/src/pokemon_jump.c
@@ -2715,7 +2715,7 @@ static void CreateJumpMonSprite(struct PokemonJumpGfx *jumpGfx, struct PokemonJu
spriteTemplate = sSpriteTemplate_JumpMon;
buffer = Alloc(0x2000);
- unusedBuffer = Alloc(0x800);
+ unusedBuffer = Alloc(MON_PIC_SIZE);
if (multiplayerId == GetPokeJumpMultiplayerId())
subpriority = 3;
else
@@ -2731,7 +2731,7 @@ static void CreateJumpMonSprite(struct PokemonJumpGfx *jumpGfx, struct PokemonJu
spriteSheet.data = buffer;
spriteSheet.tag = multiplayerId;
- spriteSheet.size = 0x800;
+ spriteSheet.size = MON_PIC_SIZE;
LoadSpriteSheet(&spriteSheet);
spritePalette.data = GetMonSpritePalFromSpeciesAndPersonality(monInfo->species, monInfo->otId, monInfo->personality);
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c
index 3d6dc331c..d249381d8 100644
--- a/src/pokemon_storage_system.c
+++ b/src/pokemon_storage_system.c
@@ -4049,11 +4049,11 @@ static void LoadCursorMonSprite(void)
u16 tileStart;
u8 palSlot;
u8 spriteId;
- struct SpriteSheet sheet = {sPSSData->field_22C4, 0x800, TAG_TILE_2};
+ struct SpriteSheet sheet = {sPSSData->field_22C4, MON_PIC_SIZE, TAG_TILE_2};
struct SpritePalette palette = {sPSSData->field_2244, TAG_PAL_DAC6};
struct SpriteTemplate template = sSpriteTemplate_CursorMon;
- for (i = 0; i < 0x800; i++)
+ for (i = 0; i < MON_PIC_SIZE; i++)
sPSSData->field_22C4[i] = 0;
for (i = 0; i < 0x10; i++)
sPSSData->field_2244[i] = 0;
@@ -4095,7 +4095,7 @@ static void LoadCursorMonGfx(u16 species, u32 pid)
{
LoadSpecialPokePic(&gMonFrontPicTable[species], sPSSData->field_22C4, species, pid, TRUE);
LZ77UnCompWram(sPSSData->cursorMonPalette, sPSSData->field_2244);
- CpuCopy32(sPSSData->field_22C4, sPSSData->field_223C, 0x800);
+ CpuCopy32(sPSSData->field_22C4, sPSSData->field_223C, MON_PIC_SIZE);
LoadPalette(sPSSData->field_2244, sPSSData->field_223A, 0x20);
sPSSData->cursorMonSprite->invisible = FALSE;
}
diff --git a/src/pokenav_conditions_1.c b/src/pokenav_conditions_1.c
index 0545ff1c1..ebe870f80 100644
--- a/src/pokenav_conditions_1.c
+++ b/src/pokenav_conditions_1.c
@@ -17,7 +17,7 @@ struct PokenavSub11
{
u32 monPal[3][0x20];
u8 fill[0x180];
- u32 monPicGfx[3][0x800];
+ u32 monPicGfx[3][MON_PIC_SIZE];
u8 searchMode;
s16 monIndex;
u32 (*callback)(struct PokenavSub11 *);
diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c
index 26607926b..dc07dd44c 100644
--- a/src/pokenav_conditions_2.c
+++ b/src/pokenav_conditions_2.c
@@ -828,7 +828,7 @@ void CreateConditionMonPic(u8 id)
}
else
{
- DmaCopy16Defvars(3, GetConditionMonPicGfx(id), structPtr->unk181C, 0x800);
+ DmaCopy16Defvars(3, GetConditionMonPicGfx(id), structPtr->unk181C, MON_PIC_SIZE);
LoadPalette(GetConditionMonPal(id), structPtr->monPalIndex, 0x20);
}
}
diff --git a/src/title_screen.c b/src/title_screen.c
index f86a0b0b3..f2c609fec 100644
--- a/src/title_screen.c
+++ b/src/title_screen.c
@@ -64,7 +64,9 @@ static const u32 sTitleScreenCloudsGfx[] = INCBIN_U32("graphics/title_screen/clo
-const u16 gIntroWaterDropAlphaBlend[] =
+// Used to blend "Emerald Version" as it passes over over the Pokémon banner.
+// Also used by the intro to blend the Game Freak name/logo in and out as they appear and disappear
+const u16 gTitleScreenAlphaBlend[64] =
{
BLDALPHA_BLEND(16, 0),
BLDALPHA_BLEND(16, 1),
@@ -364,7 +366,7 @@ static void SpriteCB_VersionBannerLeft(struct Sprite *sprite)
sprite->pos1.y++;
if (sprite->data[0] != 0)
sprite->data[0]--;
- SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[sprite->data[0]]);
+ SetGpuReg(REG_OFFSET_BLDALPHA, gTitleScreenAlphaBlend[sprite->data[0]]);
}
}
@@ -388,7 +390,7 @@ static void SpriteCB_PressStartCopyrightBanner(struct Sprite *sprite)
{
sprite->data[1]++;
// Alternate between hidden and shown every 16th frame
- if (sprite->data[1] & 0x10)
+ if (sprite->data[1] & 16)
sprite->invisible = FALSE;
else
sprite->invisible = TRUE;
diff --git a/src/trade.c b/src/trade.c
index 0e5110a58..f423b20af 100644
--- a/src/trade.c
+++ b/src/trade.c
@@ -2890,9 +2890,9 @@ static void InitTradeBgInternal(void)
InitBgsFromTemplates(0, sTradeSequenceBgTemplates, ARRAY_COUNT(sTradeSequenceBgTemplates));
ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0);
- SetBgTilemapBuffer(0, Alloc(0x800));
- SetBgTilemapBuffer(1, Alloc(0x800));
- SetBgTilemapBuffer(3, Alloc(0x800));
+ SetBgTilemapBuffer(0, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(1, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE));
DeactivateAllTextPrinters();
DecompressAndLoadBgGfxUsingHeap(0, gBattleTextboxTiles, 0, 0, 0);
LZDecompressWram(gBattleTextboxTilemap, gDecompressionBuffer);
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c
index 5d8f5ce24..cfaec6f18 100644
--- a/src/use_pokeblock.c
+++ b/src/use_pokeblock.c
@@ -1241,7 +1241,7 @@ static void UpdateMonPic(u8 loadId)
}
else
{
- Dma3CopyLarge16_(sMenu->partySheets[loadId], sMenu->curMonTileStart, 0x800);
+ Dma3CopyLarge16_(sMenu->partySheets[loadId], sMenu->curMonTileStart, MON_PIC_SIZE);
LoadPalette(sMenu->partyPalettes[loadId], sMenu->curMonPalette, 32);
}
}
diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c
index 23d63832f..72557aefd 100644
--- a/src/wireless_communication_status_screen.c
+++ b/src/wireless_communication_status_screen.c
@@ -174,8 +174,8 @@ static void CB2_InitWirelessCommunicationScreen(void)
SetVBlankCallback(NULL);
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
- SetBgTilemapBuffer(1, Alloc(0x800));
- SetBgTilemapBuffer(0, Alloc(0x800));
+ SetBgTilemapBuffer(1, Alloc(BG_SCREEN_SIZE));
+ SetBgTilemapBuffer(0, Alloc(BG_SCREEN_SIZE));
DecompressAndLoadBgGfxUsingHeap(1, sBgTiles_Gfx, 0, 0, 0);
CopyToBgTilemapBuffer(1, sBgTiles_Tilemap, 0, 0);
InitWindows(sWindowTemplates);