[intro] refactor expansion intro
@ -1,7 +1,7 @@
|
||||
JASC-PAL
|
||||
0100
|
||||
256
|
||||
198 231 214
|
||||
0 0 0
|
||||
255 255 255
|
||||
222 222 222
|
||||
222 222 214
|
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@ -74,6 +74,6 @@
|
||||
#define GEN_LATEST GEN_8
|
||||
|
||||
// General settings
|
||||
#define RHH_COPYRIGHT_INTRO TRUE // If TRUE, a custom RHH intro will play instead of the vanilla copyright screen.
|
||||
#define EXPANSION_INTRO TRUE // If TRUE, a custom RHH intro will play after the vanilla copyright screen.
|
||||
|
||||
#endif // GUARD_CONFIG_H
|
||||
|
9
include/expansion_intro.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef GUARD_EXPANSION_INTRO_H
|
||||
#define GUARD_EXPANSION_INTRO_H
|
||||
|
||||
#if EXPANSION_INTRO == TRUE
|
||||
void CB2_ExpansionIntro(void);
|
||||
void Task_HandleExpansionIntro(u8 taskId);
|
||||
#endif
|
||||
|
||||
#endif /* GUARD_EXPANSION_INTRO_H */
|
@ -9,5 +9,8 @@
|
||||
void CB2_InitCopyrightScreenAfterBootup(void);
|
||||
void CB2_InitCopyrightScreenAfterTitleScreen(void);
|
||||
void PanFadeAndZoomScreen(u16, u16, u16, u16);
|
||||
void MainCB2_Intro(void);
|
||||
void Task_Scene1_Load(u8);
|
||||
|
||||
|
||||
#endif // GUARD_INTRO_H
|
||||
|
@ -1,13 +0,0 @@
|
||||
#ifndef GUARD_RHH_COPYRIGHT_H
|
||||
#define GUARD_RHH_COPYRIGHT_H
|
||||
|
||||
#if RHH_COPYRIGHT_INTRO == TRUE
|
||||
void RhhIntro_InitCopyrightBgs();
|
||||
void RhhIntro_LoadCopyrightBgGraphics();
|
||||
void RhhIntro_ShowRhhCredits();
|
||||
void RhhIntro_LoadCopyrightSpriteGraphics();
|
||||
void RhhIntro_CreateCopyRightSprites();
|
||||
void RhhIntro_DestroyRhhCreditSprites();
|
||||
#endif
|
||||
|
||||
#endif /* GUARD_RHH_COPYRIGHT_H */
|
@ -343,7 +343,7 @@ SECTIONS {
|
||||
src/battle_transition_frontier.o(.text);
|
||||
src/international_string_util.o(.text);
|
||||
src/pokemon_debug.o(.text);
|
||||
src/rhh_copyright.o(.text);
|
||||
src/expansion_intro.o(.text);
|
||||
} =0
|
||||
|
||||
script_data :
|
||||
@ -710,7 +710,7 @@ SECTIONS {
|
||||
src/m4a_tables.o(.rodata);
|
||||
data/sound_data.o(.rodata);
|
||||
src/pokemon_debug.o(.rodata);
|
||||
src/rhh_copyright.o(.rodata);
|
||||
src/expansion_intro.o(.rodata);
|
||||
} =0
|
||||
|
||||
song_data :
|
||||
|
@ -8,23 +8,13 @@
|
||||
#include "task.h"
|
||||
#include "gpu_regs.h"
|
||||
#include "trig.h"
|
||||
#include "rhh_copyright.h"
|
||||
#include "main.h"
|
||||
#include "intro.h"
|
||||
#include "expansion_intro.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#if RHH_COPYRIGHT_INTRO == TRUE
|
||||
|
||||
static const u32 sBgTiles_PoweredBy[] = INCBIN_U32("graphics/rhh_copyright/powered_by.4bpp.lz");
|
||||
static const u32 sBgTiles_RhhCredits[] = INCBIN_U32("graphics/rhh_copyright/rhh_credits.8bpp.lz");
|
||||
static const u32 sBgMap_PoweredBy[] = INCBIN_U32("graphics/rhh_copyright/powered_by.bin.lz");
|
||||
static const u32 sBgMap_RhhCredits[] = INCBIN_U32("graphics/rhh_copyright/rhh_credits.bin.lz");
|
||||
static const u32 sBgPal_Credits[] = INCBIN_U32("graphics/rhh_copyright/credits.gbapal.lz");
|
||||
static const u32 sSpriteTiles_DizzyEgg[] = INCBIN_U32("graphics/rhh_copyright/sprites/dizzy_egg.4bpp.lz");
|
||||
static const u32 sSpriteTiles_Porygon[] = INCBIN_U32("graphics/rhh_copyright/sprites/porygon.4bpp.lz");
|
||||
static const u16 sSpritePal_DizzyEgg[] = INCBIN_U16("graphics/rhh_copyright/sprites/dizzy_egg.gbapal");
|
||||
static const u16 sSpritePal_Porygon[] = INCBIN_U16("graphics/rhh_copyright/sprites/porygon.gbapal");
|
||||
static const u16 sSpritePal_PorygonShiny[] = INCBIN_U16("graphics/rhh_copyright/sprites/shiny.gbapal");
|
||||
|
||||
#if EXPANSION_INTRO == TRUE
|
||||
|
||||
#define TAG_DIZZY 20000
|
||||
#define TAG_PORYGON 20001
|
||||
@ -43,10 +33,47 @@ static const u16 sSpritePal_PorygonShiny[] = INCBIN_U16("graphics/rhh_copyright/
|
||||
#define DIZZY_ANIM_SPEED 4
|
||||
#define DIZZY_STARS_SPEED 12
|
||||
|
||||
static void SpriteCallbacK_DizzyWalking(struct Sprite* sprite);
|
||||
static void SpriteCallback_PorygonFlying(struct Sprite* sprite);
|
||||
enum
|
||||
{
|
||||
EXPANSION_INTRO_BG2,
|
||||
EXPANSION_INTRO_BG3
|
||||
};
|
||||
|
||||
static const union AnimCmd sAnimCmd_DizzyWalking[] = {
|
||||
enum
|
||||
{
|
||||
ANIM_PORY_IDLE,
|
||||
ANIM_PORY_HIT,
|
||||
ANIM_PORY_GO_UP
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ANIM_DIZZY_WALKING,
|
||||
ANIM_DIZZY_DIZZY
|
||||
};
|
||||
|
||||
static const u32 sBgTiles_PoweredBy[] = INCBIN_U32("graphics/expansion_intro/powered_by.4bpp.lz");
|
||||
static const u32 sBgTiles_RhhCredits[] = INCBIN_U32("graphics/expansion_intro/rhh_credits.8bpp.lz");
|
||||
static const u32 sBgMap_PoweredBy[] = INCBIN_U32("graphics/expansion_intro/powered_by.bin.lz");
|
||||
static const u32 sBgMap_RhhCredits[] = INCBIN_U32("graphics/expansion_intro/rhh_credits.bin.lz");
|
||||
static const u32 sBgPal_Credits[] = INCBIN_U32("graphics/expansion_intro/credits.gbapal.lz");
|
||||
static const u32 sSpriteTiles_DizzyEgg[] = INCBIN_U32("graphics/expansion_intro/sprites/dizzy_egg.4bpp.lz");
|
||||
static const u32 sSpriteTiles_Porygon[] = INCBIN_U32("graphics/expansion_intro/sprites/porygon.4bpp.lz");
|
||||
static const u16 sSpritePal_DizzyEgg[] = INCBIN_U16("graphics/expansion_intro/sprites/dizzy_egg.gbapal");
|
||||
static const u16 sSpritePal_Porygon[] = INCBIN_U16("graphics/expansion_intro/sprites/porygon.gbapal");
|
||||
static const u16 sSpritePal_PorygonShiny[] = INCBIN_U16("graphics/expansion_intro/sprites/shiny.gbapal");
|
||||
|
||||
static void SpriteCallback_DizzyWalking(struct Sprite* sprite);
|
||||
static void SpriteCallback_PorygonFlying(struct Sprite* sprite);
|
||||
static void Task_ExpansionIntro_HandleBlend(u8 taskId);
|
||||
static void VBlankCB_ExpansionIntro(void);
|
||||
static void ExpansionIntro_InitBgs();
|
||||
static void ExpansionIntro_StartBlend();
|
||||
static void ExpansionIntro_LoadGraphics();
|
||||
static void ExpansionIntro_CreateSprites();
|
||||
|
||||
static const union AnimCmd sAnimCmd_DizzyWalking[] =
|
||||
{
|
||||
ANIMCMD_FRAME(32, DIZZY_ANIM_SPEED),
|
||||
ANIMCMD_FRAME(16, DIZZY_ANIM_SPEED),
|
||||
ANIMCMD_FRAME(0, DIZZY_ANIM_SPEED),
|
||||
@ -58,7 +85,8 @@ static const union AnimCmd sAnimCmd_DizzyWalking[] = {
|
||||
ANIMCMD_JUMP(0),
|
||||
};
|
||||
|
||||
static const union AnimCmd sAnimCmd_DizzyisDizzy[] = {
|
||||
static const union AnimCmd sAnimCmd_DizzyisDizzy[] =
|
||||
{
|
||||
ANIMCMD_FRAME(80, DIZZY_STARS_SPEED),
|
||||
ANIMCMD_FRAME(96, DIZZY_STARS_SPEED),
|
||||
ANIMCMD_FRAME(112, DIZZY_STARS_SPEED),
|
||||
@ -66,69 +94,77 @@ static const union AnimCmd sAnimCmd_DizzyisDizzy[] = {
|
||||
ANIMCMD_JUMP(0),
|
||||
};
|
||||
|
||||
enum {ANIM_DIZZY_WALKING, ANIM_DIZZY_DIZZY};
|
||||
|
||||
static const union AnimCmd *const sAnimCmdTable_DizzyEgg[] = {
|
||||
static const union AnimCmd *const sAnimCmdTable_DizzyEgg[] =
|
||||
{
|
||||
[ANIM_DIZZY_WALKING] = sAnimCmd_DizzyWalking,
|
||||
[ANIM_DIZZY_DIZZY] = sAnimCmd_DizzyisDizzy,
|
||||
};
|
||||
|
||||
static const union AnimCmd sAnimCmd_PorygonIdle[] = {
|
||||
static const union AnimCmd sAnimCmd_PorygonIdle[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd sAnimCmd_PorygonHitted[] = {
|
||||
static const union AnimCmd sAnimCmd_PorygonHitted[] =
|
||||
{
|
||||
ANIMCMD_FRAME(64, 0),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd sAnimCmd_PorygonGoUp[] = {
|
||||
static const union AnimCmd sAnimCmd_PorygonGoUp[] =
|
||||
{
|
||||
ANIMCMD_FRAME(64, 20),
|
||||
ANIMCMD_FRAME(128, 10),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
enum {ANIM_PORY_IDLE, ANIM_PORY_HIT, ANIM_PORY_GO_UP};
|
||||
|
||||
static const union AnimCmd *const sAnimCmdTable_Porygon[] = {
|
||||
static const union AnimCmd *const sAnimCmdTable_Porygon[] =
|
||||
{
|
||||
[ANIM_PORY_IDLE] = sAnimCmd_PorygonIdle,
|
||||
[ANIM_PORY_HIT] = sAnimCmd_PorygonHitted,
|
||||
[ANIM_PORY_GO_UP] = sAnimCmd_PorygonGoUp,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sAffineAnimCmd_PorygonScale[] = {
|
||||
static const union AffineAnimCmd sAffineAnimCmd_PorygonScale[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd *const sAffineAnimCmdTable_Porygon[] = {
|
||||
static const union AffineAnimCmd *const sAffineAnimCmdTable_Porygon[] =
|
||||
{
|
||||
sAffineAnimCmd_PorygonScale,
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_DizzyEgg = {
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_DizzyEgg =
|
||||
{
|
||||
.data = sSpriteTiles_DizzyEgg,
|
||||
.size = 0x1000,
|
||||
.tag = TAG_DIZZY,
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_Porygon = {
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_Porygon =
|
||||
{
|
||||
.data = sSpriteTiles_Porygon,
|
||||
.size = 0x2800,
|
||||
.tag = PAL_TAG_PORYGON,
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_DizzyEgg = {
|
||||
static const struct SpritePalette sSpritePalette_DizzyEgg =
|
||||
{
|
||||
.data = sSpritePal_DizzyEgg,
|
||||
.tag = PAL_TAG_DIZZY,
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_Porygon = {
|
||||
static const struct SpritePalette sSpritePalette_Porygon =
|
||||
{
|
||||
.data = sSpritePal_Porygon,
|
||||
.tag = PAL_TAG_PORYGON,
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_DizzyEgg = {
|
||||
static const struct OamData sOamData_DizzyEgg =
|
||||
{
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
@ -138,7 +174,8 @@ static const struct OamData sOamData_DizzyEgg = {
|
||||
.priority = 0,
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_Porygon = {
|
||||
static const struct OamData sOamData_Porygon =
|
||||
{
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
@ -148,17 +185,19 @@ static const struct OamData sOamData_Porygon = {
|
||||
.priority = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_DizzyEgg = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_DizzyEgg =
|
||||
{
|
||||
.tileTag = TAG_DIZZY,
|
||||
.paletteTag = PAL_TAG_DIZZY,
|
||||
.oam = &sOamData_DizzyEgg,
|
||||
.anims = sAnimCmdTable_DizzyEgg,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbacK_DizzyWalking,
|
||||
.callback = SpriteCallback_DizzyWalking,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_Porygon = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_Porygon =
|
||||
{
|
||||
.tileTag = TAG_PORYGON,
|
||||
.paletteTag = PAL_TAG_PORYGON,
|
||||
.oam = &sOamData_Porygon,
|
||||
@ -168,53 +207,75 @@ static const struct SpriteTemplate sSpriteTemplate_Porygon = {
|
||||
.callback = SpriteCallback_PorygonFlying,
|
||||
};
|
||||
|
||||
enum {BG_0, BG_1, BG_2, BG_3};
|
||||
|
||||
static const struct BgTemplate sBgTemplates_RhhCopyrightScreen[] = {
|
||||
[BG_0] = {
|
||||
.bg = BG_0,
|
||||
.charBaseIndex = 3,
|
||||
.mapBaseIndex = 24,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0,
|
||||
},
|
||||
[BG_1] = {
|
||||
.bg = BG_1,
|
||||
.charBaseIndex = 3,
|
||||
.mapBaseIndex = 24,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0,
|
||||
},
|
||||
[BG_2] = {
|
||||
.bg = BG_2,
|
||||
static const struct BgTemplate sBgTemplates_RhhCopyrightScreen[] =
|
||||
{
|
||||
[EXPANSION_INTRO_BG2] = {
|
||||
.bg = 2,
|
||||
.charBaseIndex = 1,
|
||||
.mapBaseIndex = 20,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 1,
|
||||
.priority = 0,
|
||||
.baseTile = 0,
|
||||
.paletteMode = 1
|
||||
},
|
||||
[BG_3] = {
|
||||
.bg = BG_3,
|
||||
.charBaseIndex = 0,
|
||||
[EXPANSION_INTRO_BG3] = {
|
||||
.bg = 3,
|
||||
.mapBaseIndex = 22,
|
||||
.screenSize = 2,
|
||||
.paletteMode = 0,
|
||||
.priority = 0,
|
||||
.baseTile = 0,
|
||||
.screenSize = 2
|
||||
},
|
||||
};
|
||||
|
||||
static EWRAM_DATA u8 sDizzyId = 0;
|
||||
static EWRAM_DATA u8 sPoryId = 0;
|
||||
void CB2_ExpansionIntro(void)
|
||||
{
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
static void Task_ShowRhhCredits(u8 taskId);
|
||||
#define tState gTasks[taskId].data[0]
|
||||
#define tFrameCounter gTasks[taskId].data[1]
|
||||
void Task_HandleExpansionIntro(u8 taskId)
|
||||
{
|
||||
switch (tState)
|
||||
{
|
||||
case 0:
|
||||
SetVBlankCallback(VBlankCB_ExpansionIntro);
|
||||
ExpansionIntro_InitBgs();
|
||||
ExpansionIntro_LoadGraphics();
|
||||
CpuFastFill16(RGB_BLACK, gPlttBufferFaded, 32);
|
||||
ShowBg(3);
|
||||
BeginNormalPaletteFade(1, 0, 16, 0, RGB_BLACK);
|
||||
ExpansionIntro_StartBlend();
|
||||
ExpansionIntro_CreateSprites();
|
||||
tState++;
|
||||
break;
|
||||
case 1:
|
||||
if (!gPaletteFade.active)
|
||||
tState++;
|
||||
break;
|
||||
case 2:
|
||||
if (tFrameCounter == 208 || gMain.newKeys != 0)
|
||||
tState++;
|
||||
else
|
||||
tFrameCounter++;
|
||||
break;
|
||||
case 3:
|
||||
ResetSpriteData();
|
||||
DestroyTask(taskId);
|
||||
CreateTask(Task_Scene1_Load, 0);
|
||||
SetMainCallback2(MainCB2_Intro);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#undef tState
|
||||
|
||||
void RhhIntro_InitCopyrightBgs()
|
||||
static void VBlankCB_ExpansionIntro(void)
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
}
|
||||
|
||||
static void ExpansionIntro_InitBgs(void)
|
||||
{
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sBgTemplates_RhhCopyrightScreen, ARRAY_COUNT(sBgTemplates_RhhCopyrightScreen));
|
||||
@ -224,42 +285,41 @@ void RhhIntro_InitCopyrightBgs()
|
||||
HideBg(0);
|
||||
HideBg(1);
|
||||
HideBg(2);
|
||||
ShowBg(3);
|
||||
HideBg(3);
|
||||
}
|
||||
|
||||
void RhhIntro_LoadCopyrightBgGraphics()
|
||||
static void ExpansionIntro_LoadGraphics(void)
|
||||
{
|
||||
LZ77UnCompVram(sBgTiles_PoweredBy, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[BG_3].charBaseIndex));
|
||||
LZ77UnCompVram(sBgMap_PoweredBy, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[BG_3].mapBaseIndex));
|
||||
LZ77UnCompVram(sBgTiles_RhhCredits, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[BG_2].charBaseIndex));
|
||||
LZ77UnCompVram(sBgMap_RhhCredits, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[BG_2].mapBaseIndex));
|
||||
LZ77UnCompVram(sBgTiles_PoweredBy, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG3].charBaseIndex));
|
||||
LZ77UnCompVram(sBgMap_PoweredBy, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG3].mapBaseIndex));
|
||||
LZ77UnCompVram(sBgTiles_RhhCredits, (void*) BG_CHAR_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG2].charBaseIndex));
|
||||
LZ77UnCompVram(sBgMap_RhhCredits, (u16*) BG_SCREEN_ADDR(sBgTemplates_RhhCopyrightScreen[EXPANSION_INTRO_BG2].mapBaseIndex));
|
||||
LoadCompressedPalette(sBgPal_Credits, 0x00, 0x60);
|
||||
}
|
||||
|
||||
void RhhIntro_LoadCopyrightSpriteGraphics()
|
||||
{
|
||||
LoadCompressedSpriteSheet(&sSpriteSheet_DizzyEgg);
|
||||
LoadCompressedSpriteSheet(&sSpriteSheet_Porygon);
|
||||
LoadSpritePalette(&sSpritePalette_DizzyEgg);
|
||||
LoadSpritePalette(&sSpritePalette_Porygon);
|
||||
}
|
||||
|
||||
void RhhIntro_CreateCopyRightSprites()
|
||||
static void ExpansionIntro_CreateSprites(void)
|
||||
{
|
||||
sDizzyId = CreateSprite(&sSpriteTemplate_DizzyEgg, 0, DIZZY_POS_Y, 0);
|
||||
gSprites[sDizzyId].x2 = DIZZY_POS_X;
|
||||
u32 dizzyId, poryId;
|
||||
|
||||
sPoryId = CreateSprite(&sSpriteTemplate_Porygon, 0, PORY_POS_Y, 0);
|
||||
gSprites[sPoryId].x2 = PORY_POS_X;
|
||||
dizzyId = CreateSprite(&sSpriteTemplate_DizzyEgg, 0, DIZZY_POS_Y, 0);
|
||||
gSprites[dizzyId].x2 = DIZZY_POS_X;
|
||||
|
||||
poryId = CreateSprite(&sSpriteTemplate_Porygon, 0, PORY_POS_Y, 0);
|
||||
gSprites[poryId].x2 = PORY_POS_X;
|
||||
}
|
||||
|
||||
void RhhIntro_ShowRhhCredits()
|
||||
static void ExpansionIntro_StartBlend(void)
|
||||
{
|
||||
ShowBg(2);
|
||||
CreateTask(Task_ShowRhhCredits, 0);
|
||||
CreateTask(Task_ExpansionIntro_HandleBlend, 0);
|
||||
}
|
||||
|
||||
static void Task_ShowRhhCredits(u8 taskId)
|
||||
static void Task_ExpansionIntro_HandleBlend(u8 taskId)
|
||||
{
|
||||
if (GetGpuReg(REG_OFFSET_BLDY) != 0)
|
||||
{
|
||||
@ -273,7 +333,7 @@ static void Task_ShowRhhCredits(u8 taskId)
|
||||
}
|
||||
|
||||
#define sTimer data[0]
|
||||
static void SpriteCallbacK_DizzyWalking(struct Sprite* sprite)
|
||||
static void SpriteCallback_DizzyWalking(struct Sprite* sprite)
|
||||
{
|
||||
sprite->x2--;
|
||||
|
||||
@ -336,10 +396,4 @@ static void SpriteCallback_PorygonFlying(struct Sprite* sprite)
|
||||
}
|
||||
#undef sTimer
|
||||
|
||||
void RhhIntro_DestroyRhhCreditSprites()
|
||||
{
|
||||
DestroySpriteAndFreeResources(&gSprites[sDizzyId]);
|
||||
DestroySpriteAndFreeResources(&gSprites[sPoryId]);
|
||||
}
|
||||
|
||||
#endif //RHH_COPYRIGHT_INTRO
|
||||
#endif //EXPANSION_INTRO
|
83
src/intro.c
@ -23,7 +23,7 @@
|
||||
#include "sound.h"
|
||||
#include "util.h"
|
||||
#include "title_screen.h"
|
||||
#include "rhh_copyright.h"
|
||||
#include "expansion_intro.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/battle_anim.h"
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
*/
|
||||
|
||||
// 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);
|
||||
@ -1025,18 +1024,6 @@ static const struct SpritePalette sSpritePalette_RayquazaOrb[] =
|
||||
{},
|
||||
};
|
||||
|
||||
#if RHH_COPYRIGHT_INTRO == TRUE
|
||||
static void VBlankCB_PretIntro()
|
||||
{
|
||||
LoadOam();
|
||||
ProcessSpriteCopyRequests();
|
||||
TransferPlttBuffer();
|
||||
ScanlineEffect_InitHBlankDmaTransfer();
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
BuildOamBuffer();
|
||||
}
|
||||
#endif
|
||||
|
||||
static void VBlankCB_Intro(void)
|
||||
{
|
||||
@ -1046,7 +1033,7 @@ static void VBlankCB_Intro(void)
|
||||
ScanlineEffect_InitHBlankDmaTransfer();
|
||||
}
|
||||
|
||||
static void MainCB2_Intro(void)
|
||||
void MainCB2_Intro(void)
|
||||
{
|
||||
RunTasks();
|
||||
AnimateSprites();
|
||||
@ -1093,14 +1080,11 @@ static u8 SetUpCopyrightScreen(void)
|
||||
CpuFill32(0, (void *)OAM, OAM_SIZE);
|
||||
CpuFill16(0, (void *)(PLTT + 2), PLTT_SIZE - 2);
|
||||
ResetPaletteFade();
|
||||
#if RHH_COPYRIGHT_INTRO == FALSE
|
||||
LoadCopyrightGraphics(0, 0x3800, BG_PLTT_ID(0));
|
||||
#endif
|
||||
ScanlineEffect_Stop();
|
||||
ResetTasks();
|
||||
ResetSpriteData();
|
||||
FreeAllSpritePalettes();
|
||||
#if RHH_COPYRIGHT_INTRO == FALSE
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_WHITEALPHA);
|
||||
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
|
||||
| BGCNT_CHARBASE(0)
|
||||
@ -1110,59 +1094,14 @@ static u8 SetUpCopyrightScreen(void)
|
||||
EnableInterrupts(INTR_FLAG_VBLANK);
|
||||
SetVBlankCallback(VBlankCB_Intro);
|
||||
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON;
|
||||
#else
|
||||
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
|
||||
| BGCNT_CHARBASE(0)
|
||||
| BGCNT_SCREENBASE(7)
|
||||
| BGCNT_16COLOR
|
||||
| BGCNT_TXT256x256);
|
||||
EnableInterrupts(INTR_FLAG_VBLANK);
|
||||
REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON;
|
||||
|
||||
gMain.state++;
|
||||
break;
|
||||
case 1:
|
||||
RhhIntro_InitCopyrightBgs();
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA);
|
||||
SetVBlankCallback(VBlankCB_PretIntro);
|
||||
#endif
|
||||
SetSerialCallback(SerialCB_CopyrightScreen);
|
||||
GameCubeMultiBoot_Init(&gMultibootProgramStruct);
|
||||
default:
|
||||
#if RHH_COPYRIGHT_INTRO == TRUE
|
||||
RunTasks();
|
||||
UpdatePaletteFade();
|
||||
gMain.state++;
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
break;
|
||||
case 30:
|
||||
RhhIntro_LoadCopyrightBgGraphics();
|
||||
BeginNormalPaletteFade(0x00000001, 0, 0x10, 0, RGB_BLACK);
|
||||
UpdatePaletteFade();
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 31:
|
||||
RhhIntro_LoadCopyrightSpriteGraphics();
|
||||
RhhIntro_CreateCopyRightSprites();
|
||||
UpdatePaletteFade();
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 45:
|
||||
RhhIntro_ShowRhhCredits();
|
||||
UpdatePaletteFade();
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 253:
|
||||
#else
|
||||
UpdatePaletteFade();
|
||||
gMain.state++;
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
break;
|
||||
case 140:
|
||||
#endif
|
||||
GameCubeMultiBoot_Main(&gMultibootProgramStruct);
|
||||
if (gMultibootProgramStruct.gcmb_field_2 != 1)
|
||||
{
|
||||
@ -1170,22 +1109,16 @@ static u8 SetUpCopyrightScreen(void)
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
#if RHH_COPYRIGHT_INTRO == TRUE
|
||||
case 254:
|
||||
if (UpdatePaletteFade())
|
||||
break;
|
||||
RhhIntro_DestroyRhhCreditSprites();
|
||||
gMain.state++;
|
||||
break;
|
||||
|
||||
case 255:
|
||||
#else
|
||||
case 141:
|
||||
if (UpdatePaletteFade())
|
||||
break;
|
||||
#endif
|
||||
#if EXPANSION_INTRO == TRUE
|
||||
SetMainCallback2(CB2_ExpansionIntro);
|
||||
CreateTask(Task_HandleExpansionIntro, 0);
|
||||
#else
|
||||
CreateTask(Task_Scene1_Load, 0);
|
||||
SetMainCallback2(MainCB2_Intro);
|
||||
#endif
|
||||
if (gMultibootProgramStruct.gcmb_field_2 != 0)
|
||||
{
|
||||
if (gMultibootProgramStruct.gcmb_field_2 == 2)
|
||||
@ -1232,7 +1165,7 @@ void CB2_InitCopyrightScreenAfterTitleScreen(void)
|
||||
|
||||
#define sBigDropSpriteId data[0]
|
||||
|
||||
static void Task_Scene1_Load(u8 taskId)
|
||||
void Task_Scene1_Load(u8 taskId)
|
||||
{
|
||||
SetVBlankCallback(NULL);
|
||||
sIntroCharacterGender = Random() & 1;
|
||||
|
@ -149,4 +149,3 @@
|
||||
.include "src/trainer_hill.o"
|
||||
.include "src/rayquaza_scene.o"
|
||||
.include "src/debug.o"
|
||||
.include "src/rhh_copyright.o"
|
||||
|