Skip to content

Commit

Permalink
customized title screen
Browse files Browse the repository at this point in the history
  • Loading branch information
alaxandir committed Sep 11, 2022
1 parent c617970 commit 4346faf
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 11 deletions.
Binary file modified graphics/title_screen/emerald_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/title_screen/trees.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/title_screen/trees_map.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions include/constants/map_groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,6 @@

#define MAP_GROUPS_COUNT 37

// static const u8 MAP_GROUP_COUNT[] = {57, 4, 6, 6, 6, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0};

#endif // GUARD_CONSTANTS_MAP_GROUPS_H
2 changes: 1 addition & 1 deletion src/intro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ static u8 SetUpCopyrightScreen(void)
if (UpdatePaletteFade())
break;
CreateTask(Task_Scene1_Load, 0);
SetMainCallback2(MainCB2_Intro);
SetMainCallback2(CB2_InitTitleScreen);
if (gMultibootProgramStruct.gcmb_field_2 != 0)
{
if (gMultibootProgramStruct.gcmb_field_2 == 2)
Expand Down
78 changes: 68 additions & 10 deletions src/title_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "graphics.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/species.h"

#define VERSION_BANNER_RIGHT_TILEOFFSET 64
#define VERSION_BANNER_LEFT_X 98
Expand Down Expand Up @@ -54,12 +55,65 @@ static void SpriteCB_PokemonLogoShine(struct Sprite *sprite);
// const rom data
static const u16 sUnusedUnknownPal[] = INCBIN_U16("graphics/title_screen/unused.gbapal");

static const u32 sTitleScreenRayquazaGfx[] = INCBIN_U32("graphics/title_screen/rayquaza.4bpp.lz");
static const u32 sTitleScreenRayquazaTilemap[] = INCBIN_U32("graphics/title_screen/rayquaza.bin.lz");
static const u32 sTitleScreenRayquazaGfx[] = INCBIN_U32("graphics/title_screen/trees.4bpp.lz");
static const u32 sTitleScreenRayquazaTilemap[] = INCBIN_U32("graphics/title_screen/trees_map.bin.lz");
static const u32 sTitleScreenLogoShineGfx[] = INCBIN_U32("graphics/title_screen/logo_shine.4bpp.lz");
static const u32 sTitleScreenCloudsGfx[] = INCBIN_U32("graphics/title_screen/clouds.4bpp.lz");
const u32 gTest_Mon[] = INCBIN_U32("graphics/pokemon/eevee/anim_front.4bpp.lz");
const u32 gTestPal_Mon[] = INCBIN_U32("graphics/pokemon/eevee/normal.gbapal.lz");

static const struct CompressedSpriteSheet sSpriteSheet_Mon[] =
{
{gTest_Mon, 4096, 777},
{NULL},
};

static const struct CompressedSpritePalette sSpritePal_Mon[] =
{
{gTestPal_Mon, 777},
{NULL},
};

static const union AnimCmd smon_Anim1[] =
{
ANIMCMD_FRAME(0, 30),
ANIMCMD_FRAME(64, 30),
ANIMCMD_JUMP(0),
};

static const union AnimCmd *const smon_AnimTable[] =
{
smon_Anim1,
};

static const struct OamData sMonOamData =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 3,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};

static const struct SpriteTemplate sMonSpriteTemplate =

{
.tileTag = 777,
.paletteTag = 777,
.oam = &sMonOamData,
.anims = smon_AnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy,
};

// 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
Expand Down Expand Up @@ -507,7 +561,7 @@ static void StartPokemonLogoShine(u8 flashBg)

static void VBlankCB(void)
{
ScanlineEffect_InitHBlankDmaTransfer();
//ScanlineEffect_InitHBlankDmaTransfer();
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
Expand All @@ -534,7 +588,7 @@ void CB2_InitTitleScreen(void)
SetGpuReg(REG_OFFSET_BG0CNT, 0);
SetGpuReg(REG_OFFSET_BG2HOFS, 0);
SetGpuReg(REG_OFFSET_BG2VOFS, 0);
SetGpuReg(REG_OFFSET_BG1HOFS, 0);
//SetGpuReg(REG_OFFSET_BG1HOFS, 0);
SetGpuReg(REG_OFFSET_BG1VOFS, 0);
SetGpuReg(REG_OFFSET_BG0HOFS, 0);
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
Expand All @@ -555,7 +609,7 @@ void CB2_InitTitleScreen(void)
// bg1
LZ77UnCompVram(sTitleScreenCloudsGfx, (void *)(BG_CHAR_ADDR(3)));
LZ77UnCompVram(gTitleScreenCloudsTilemap, (void *)(BG_SCREEN_ADDR(27)));
ScanlineEffect_Stop();
//ScanlineEffect_Stop();
ResetTasks();
ResetSpriteData();
FreeAllSpritePalettes();
Expand All @@ -565,6 +619,8 @@ void CB2_InitTitleScreen(void)
LoadCompressedSpriteSheet(&sPokemonLogoShineSpriteSheet[0]);
LoadPalette(gTitleScreenEmeraldVersionPal, 0x100, 0x20);
LoadSpritePalette(&sSpritePalette_PressStart[0]);
LoadCompressedSpriteSheet(sSpriteSheet_Mon);
LoadCompressedSpritePalette(sSpritePal_Mon);
gMain.state = 2;
break;
case 2:
Expand Down Expand Up @@ -608,14 +664,14 @@ void CB2_InitTitleScreen(void)
| DISPCNT_OBJ_ON
| DISPCNT_WIN0_ON
| DISPCNT_OBJWIN_ON);
m4aSongNumStart(MUS_TITLE);
m4aSongNumStart(MUS_EVER_GRANDE);
gMain.state = 5;
break;
case 5:
if (!UpdatePaletteFade())
{
StartPokemonLogoShine(0);
ScanlineEffect_InitWave(0, DISPLAY_HEIGHT, 4, 4, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE);
//ScanlineEffect_InitWave(0, DISPLAY_HEIGHT, 4, 4, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE);
SetMainCallback2(MainCB2);
}
break;
Expand Down Expand Up @@ -705,6 +761,7 @@ static void Task_TitleScreenPhase2(u8 taskId)
| DISPCNT_OBJ_ON);
CreatePressStartBanner(START_BANNER_X, 108);
CreateCopyrightBanner(START_BANNER_X, 148);
CreateSprite(&sMonSpriteTemplate, 190, 110, 0);
gTasks[taskId].data[4] = 0;
gTasks[taskId].func = Task_TitleScreenPhase3;
}
Expand All @@ -728,6 +785,7 @@ static void Task_TitleScreenPhase3(u8 taskId)
{
if ((JOY_NEW(A_BUTTON)) || (JOY_NEW(START_BUTTON)))
{
PlayCryInternal(SPECIES_EEVEE, 0, 120, 10, 0);
FadeOutBGM(4);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
SetMainCallback2(CB2_GoToMainMenu);
Expand All @@ -754,13 +812,13 @@ static void Task_TitleScreenPhase3(u8 taskId)
SetGpuReg(REG_OFFSET_BG2Y_L, 0);
SetGpuReg(REG_OFFSET_BG2Y_H, 0);
gTasks[taskId].tCounter++;
if (gTasks[taskId].tCounter & 1)
/* if (gTasks[taskId].tCounter & 1)
{
gTasks[taskId].data[4]++;
gBattle_BG1_Y = gTasks[taskId].data[4] / 2;
gBattle_BG1_X = 0;
}
UpdateLegendaryMarkingColor(gTasks[taskId].tCounter);
} */
//UpdateLegendaryMarkingColor(gTasks[taskId].tCounter);
if ((gMPlayInfo_BGM.status & 0xFFFF) == 0)
{
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 0x10, RGB_WHITEALPHA);
Expand Down

0 comments on commit 4346faf

Please sign in to comment.