Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
state_title_screen.c File Reference

Go to the source code of this file.

Data Structures

struct  TitleDataStruct
 

Macros

#define TITLE_WIDTH   200
 
#define TITLE_HEIGHT   112
 
#define TITLE_TILE_HEIGHT   2
 
#define TITLE_POS_LEFT   ((SCREEN_WIDTH - TITLE_WIDTH) / 2)
 
#define TITLE_POS_TOP   15
 
#define FILENAME_ERROR   "ERROR\xf7\xf7\xf7"
 
#define TITLE_NUM_TILES   (TITLE_HEIGHT / TITLE_TILE_HEIGHT)
 
#define TITLE_TILE_PIXELS   (TITLE_WIDTH * TITLE_TILE_HEIGHT)
 
#define COPYRIGHT_WIDTH   144
 
#define VAR_1   32
 
#define VAR_2   676
 
#define RECT_SIZE   0x40
 
#define YL_BASE   764
 
#define YH_BASE   828
 
#define COPYRIGHT_TEX_CHUNKS   2
 
#define COPYRIGHT_IMG(k, i)   &TitleScreen_ImgList_Copyright[16 * i]
 
#define LTT_LRT   15
 

Enumerations

enum  TitleScreenStates {
  TITLE_STATE_INIT = 0 , TITLE_STATE_APPEAR = 1 , TITLE_STATE_HOLD = 2 , TITLE_STATE_UNUSED = 3 ,
  TITLE_STATE_BEGIN_DISMISS = 4 , TITLE_STATE_DISMISS = 5 , TITLE_STATE_EXIT = 6
}
 
enum  { NEXT_STATE_DEMO = 10 , NEXT_STATE_INTRO = 9 , NEXT_STATE_FILE_SELECT = 5 , NEXT_STATE_NONE = 0 }
 

Functions

void appendGfx_title_screen (void)
 
void title_screen_draw_images (f32, f32)
 
void title_screen_draw_logo (f32)
 
void title_screen_draw_press_start (void)
 
void title_screen_draw_copyright (f32)
 
void state_init_title_screen (void)
 
void state_step_title_screen (void)
 
void state_drawUI_title_screen (void)
 

Variables

s16 TitleScreenNextState = NEXT_STATE_NONE
 
SaveFileSummary gSaveSlotSummary [4]
 
SaveSlotMetadata gSaveSlotMetadata [4]
 
s32 PressStart_Alpha = 0
 
b32 PressStart_IsVisible = FALSE
 
s32 PressStart_BlinkCounter = 0
 
s32 PlayIntroNext = FALSE
 
Lights1 D_80077A38 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)
 
Gfx TitleSetupGfx []
 
BSS s16 TitleScreen_AppearDelay
 
BSS TitleDataStructTitleScreen_ImgList
 
BSS s32 * TitleScreen_ImgList_Logo
 
BSS u8(* TitleScreen_ImgList_Copyright )[144]
 
BSS s32 * TitleScreen_ImgList_PressStart
 
BSS s32 * TitleScreen_ImgList_CopyrightPalette
 
BSS s16 TitleScreen_TimeLeft
 

Data Structure Documentation

◆ TitleDataStruct

struct TitleDataStruct
Data Fields
s32 logo
s32 copyright
s32 pressStart
s32 copyrightPalette

Macro Definition Documentation

◆ TITLE_WIDTH

#define TITLE_WIDTH   200

Definition at line 19 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ TITLE_HEIGHT

#define TITLE_HEIGHT   112

Definition at line 20 of file state_title_screen.c.

◆ TITLE_TILE_HEIGHT

#define TITLE_TILE_HEIGHT   2

Definition at line 21 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ TITLE_POS_LEFT

#define TITLE_POS_LEFT   ((SCREEN_WIDTH - TITLE_WIDTH) / 2)

Definition at line 22 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ TITLE_POS_TOP

#define TITLE_POS_TOP   15

Definition at line 23 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ FILENAME_ERROR

#define FILENAME_ERROR   "ERROR\xf7\xf7\xf7"

Definition at line 24 of file state_title_screen.c.

◆ TITLE_NUM_TILES

#define TITLE_NUM_TILES   (TITLE_HEIGHT / TITLE_TILE_HEIGHT)

Definition at line 27 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ TITLE_TILE_PIXELS

#define TITLE_TILE_PIXELS   (TITLE_WIDTH * TITLE_TILE_HEIGHT)

Definition at line 28 of file state_title_screen.c.

Referenced by title_screen_draw_logo().

◆ COPYRIGHT_WIDTH

#define COPYRIGHT_WIDTH   144

Definition at line 106 of file state_title_screen.c.

Referenced by state_init_title_screen(), and title_screen_draw_copyright().

◆ VAR_1

#define VAR_1   32

Definition at line 472 of file state_title_screen.c.

Referenced by title_screen_draw_press_start().

◆ VAR_2

#define VAR_2   676

Definition at line 473 of file state_title_screen.c.

Referenced by title_screen_draw_press_start().

◆ RECT_SIZE

#define RECT_SIZE   0x40

Definition at line 522 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

◆ YL_BASE

#define YL_BASE   764

Definition at line 523 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

◆ YH_BASE

#define YH_BASE   828

Definition at line 524 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

◆ COPYRIGHT_TEX_CHUNKS

#define COPYRIGHT_TEX_CHUNKS   2

Definition at line 525 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

◆ COPYRIGHT_IMG

#define COPYRIGHT_IMG ( k,
i )   &TitleScreen_ImgList_Copyright[16 * i]

Definition at line 526 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

◆ LTT_LRT

#define LTT_LRT   15

Definition at line 527 of file state_title_screen.c.

Referenced by title_screen_draw_copyright().

Enumeration Type Documentation

◆ TitleScreenStates

Enumerator
TITLE_STATE_INIT 
TITLE_STATE_APPEAR 
TITLE_STATE_HOLD 
TITLE_STATE_UNUSED 
TITLE_STATE_BEGIN_DISMISS 
TITLE_STATE_DISMISS 
TITLE_STATE_EXIT 

Definition at line 31 of file state_title_screen.c.

31 {
34 TITLE_STATE_HOLD = 2, // show the title screen with PRESS START blinking
39};
@ TITLE_STATE_EXIT
@ TITLE_STATE_INIT
@ TITLE_STATE_HOLD
@ TITLE_STATE_UNUSED
@ TITLE_STATE_DISMISS
@ TITLE_STATE_BEGIN_DISMISS
@ TITLE_STATE_APPEAR

◆ anonymous enum

anonymous enum
Enumerator
NEXT_STATE_DEMO 
NEXT_STATE_INTRO 
NEXT_STATE_FILE_SELECT 
NEXT_STATE_NONE 

Definition at line 41 of file state_title_screen.c.

41 {
42 NEXT_STATE_DEMO = 10,
45 NEXT_STATE_NONE = 0, // used only for the initial value
46};
@ NEXT_STATE_INTRO
@ NEXT_STATE_DEMO
@ NEXT_STATE_FILE_SELECT
@ NEXT_STATE_NONE

Function Documentation

◆ appendGfx_title_screen()

void appendGfx_title_screen ( void )

Definition at line 384 of file state_title_screen.c.

384 {
385 f32 alpha;
386
387 switch (gGameStatusPtr->startupState) {
388 case TITLE_STATE_INIT:
390 break;
394 alpha = SQ(alpha);
395 title_screen_draw_images(alpha, alpha);
396 break;
397 case TITLE_STATE_HOLD:
398 title_screen_draw_images(0.0f, 0.0f);
399 break;
401 title_screen_draw_images(0.0f, 0.0f);
402 break;
406 alpha = SQ(alpha);
407 title_screen_draw_images(alpha, alpha);
408 break;
409 }
410
411 gDPPipeSync(gMainGfxPos++);
412 gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, osVirtualToPhysical(nuGfxCfb_ptr));
413 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
414 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
415 gDPPipeSync(gMainGfxPos++);
416 gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING |
417 G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
418 gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
419 gSPSetLights1(gMainGfxPos++, D_80077A38);
420
421 gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
422 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
423 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
424 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
425 gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
426 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
427 gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
428 gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
429 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
430 render_frame(FALSE);
431 render_frame(TRUE);
432}
u16 * nuGfxCfb_ptr
Definition cam_main.c:14
void render_frame(s32 flag)
Definition cam_main.c:91
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
#define SQ(x)
Definition macros.h:166
void title_screen_draw_images(f32, f32)
Lights1 D_80077A38
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by state_init_title_screen().

◆ title_screen_draw_images()

void title_screen_draw_images ( f32 logoMoveAlpha,
f32 copyrightMoveAlpha )

Definition at line 434 of file state_title_screen.c.

434 {
435 title_screen_draw_logo(logoMoveAlpha);
436 title_screen_draw_copyright(copyrightMoveAlpha);
437}
void title_screen_draw_copyright(f32)
void title_screen_draw_logo(f32)

Referenced by appendGfx_title_screen().

◆ title_screen_draw_logo()

void title_screen_draw_logo ( f32 moveAlpha)

Definition at line 439 of file state_title_screen.c.

439 {
440 s32 yOffset;
441 s32 i;
442
443 gSPDisplayList(gMainGfxPos++, TitleSetupGfx);
444 gDPPipeSync(gMainGfxPos++);
445 yOffset = -100 * moveAlpha;
446
447 for (i = 0; i < TITLE_NUM_TILES; i++) {
448 // Load a tile from the logo texture
449 gDPLoadTextureTile(gMainGfxPos++, &TitleScreen_ImgList_Logo[i * TITLE_TILE_PIXELS], G_IM_FMT_RGBA, G_IM_SIZ_32b,
450 TITLE_WIDTH, TITLE_TILE_HEIGHT, // width, height
451 0, 0, (TITLE_WIDTH - 1), (TITLE_TILE_HEIGHT - 1), // uls, ult, lrs, lrt
452 0, // pal
453 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, // cms, cmt
454 G_TX_NOMASK, G_TX_NOMASK, // masks, maskt
455 G_TX_NOLOD, G_TX_NOLOD); // shifts, shiftt
456 // Draw a scissored texture rectangle with the loaded tile
457 gSPScisTextureRectangle(gMainGfxPos++,
458 (TITLE_POS_LEFT) << 2, // ulx
459 (TITLE_POS_TOP + TITLE_TILE_HEIGHT * i + yOffset) << 2, // uly
460 (TITLE_POS_LEFT + TITLE_WIDTH) << 2, // lrx
461 (TITLE_POS_TOP + TITLE_TILE_HEIGHT + TITLE_TILE_HEIGHT * i + yOffset) << 2, // lry
462 G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
463 }
464
465 gDPPipeSync(gMainGfxPos++);
466}
#define TITLE_POS_TOP
Gfx TitleSetupGfx[]
#define TITLE_POS_LEFT
#define TITLE_TILE_PIXELS
#define TITLE_NUM_TILES
#define TITLE_WIDTH
BSS s32 * TitleScreen_ImgList_Logo
#define TITLE_TILE_HEIGHT

Referenced by title_screen_draw_images().

◆ title_screen_draw_press_start()

void title_screen_draw_press_start ( void )

Definition at line 476 of file state_title_screen.c.

476 {
477 switch (PressStart_IsVisible) {
478 case FALSE:
479 PressStart_Alpha -= 128;
480 if (PressStart_Alpha < 0) {
482 }
483
485 if (PressStart_BlinkCounter >= 16) {
488 }
489 break;
490 case TRUE:
491 PressStart_Alpha += 128;
492 if (PressStart_Alpha > 255) {
493 PressStart_Alpha = 255;
494 }
495
497 if (PressStart_BlinkCounter >= 16) {
499 PressStart_IsVisible = FALSE;
500 }
501 }
502
503 gSPDisplayList(gMainGfxPos++, TitleSetupGfx);
504 gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
505 gDPSetPrimColor(gMainGfxPos++, 0, 0, 248, 240, 152, PressStart_Alpha);
506 gDPPipeSync(gMainGfxPos++);
507 gDPLoadTextureBlock(gMainGfxPos++, TitleScreen_ImgList_PressStart, G_IM_FMT_IA, G_IM_SIZ_8b, 128, VAR_1, 0,
508 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
509 G_TX_NOLOD);
510 gSPTextureRectangle(gMainGfxPos++, 384, 548, 896, VAR_2, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
511 gDPPipeSync(gMainGfxPos++);
512}
b32 PressStart_IsVisible
s32 PressStart_BlinkCounter
s32 PressStart_Alpha
BSS s32 * TitleScreen_ImgList_PressStart
#define VAR_1
#define VAR_2

Referenced by state_drawUI_title_screen().

◆ title_screen_draw_copyright()

void title_screen_draw_copyright ( f32 moveAlpha)

Definition at line 530 of file state_title_screen.c.

530 {
531 s32 alpha;
532 s32 i;
533
534 gSPDisplayList(gMainGfxPos++, &TitleSetupGfx);
535#if VERSION_JP
536 gDPSetTextureLUT(gMainGfxPos++, G_TT_RGBA16);
537#endif
538 gDPPipeSync(gMainGfxPos++);
539
540 alpha = 255.0f - (moveAlpha * 255.0f);
541 if (alpha < 255) {
542 if (alpha < 0) {
543 alpha = 0;
544 }
545 gDPSetCombineMode(gMainGfxPos++, PM_CC_02, PM_CC_02);
546 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, alpha);
547 }
548
549#if VERSION_JP
550 gDPLoadTLUT_pal16(gMainGfxPos++, 0, TitleScreen_ImgList_CopyrightPalette);
551 gDPLoadTextureTile_4b(gMainGfxPos++, TitleScreen_ImgList_Copyright, G_IM_FMT_CI,
552 COPYRIGHT_WIDTH, 0, 0, 0, 127, 31, 0,
553 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
554 G_TX_NOLOD);
555 gSPTextureRectangle(gMainGfxPos++, 388, YL_BASE, 900, 892, G_TX_RENDERTILE,
556 0, 0, 0x0400, 0x0400);
557#else
558 for (i = 0; i < COPYRIGHT_TEX_CHUNKS; i++) {
559 s32 k = 10 * i;
560 alpha = 0; // TODO figure out why this is needed
561
562 gDPLoadTextureTile(gMainGfxPos++, COPYRIGHT_IMG(k, i), G_IM_FMT_IA, G_IM_SIZ_8b,
563 COPYRIGHT_WIDTH, 32, 0, 0, 143, LTT_LRT, 0,
564 G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
565 G_TX_NOLOD);
566 gSPTextureRectangle(gMainGfxPos++, 356, YL_BASE + (RECT_SIZE * i), 932, YH_BASE + (RECT_SIZE * i),
567 G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
568 }
569#endif
570 gDPPipeSync(gMainGfxPos++);
571}
#define PM_CC_02
Definition macros.h:277
#define YL_BASE
#define COPYRIGHT_WIDTH
BSS s32 * TitleScreen_ImgList_CopyrightPalette
#define YH_BASE
#define COPYRIGHT_TEX_CHUNKS
#define LTT_LRT
BSS u8(* TitleScreen_ImgList_Copyright)[144]
#define RECT_SIZE
#define COPYRIGHT_IMG(k, i)

Referenced by title_screen_draw_images().

◆ state_init_title_screen()

void state_init_title_screen ( void )

Definition at line 123 of file state_title_screen.c.

123 {
124 s32 titleDataSize;
125 void* titleDataDst;
126 void* titleData;
127
128 gOverrideFlags = 0;
138 titleData = load_asset_by_name("title_data", &titleDataSize);
139 titleDataDst = TitleScreen_ImgList = heap_malloc(titleDataSize);
140 decode_yay0(titleData, titleDataDst);
141 general_heap_free(titleData);
142
146#if VERSION_JP
148#endif
149
155 gCameras[CAM_DEFAULT].vfov = 25.0f;
156 set_cam_viewport(CAM_DEFAULT, 12, 28, 296, 184);
157
158 gCameras[CAM_DEFAULT].params.basic.skipRecalc = FALSE;
159 gCameras[CAM_DEFAULT].params.basic.pitch = 0;
160 gCameras[CAM_DEFAULT].params.basic.dist = 40;
161 gCameras[CAM_DEFAULT].params.basic.fovScale = 100;
162
164 gCameras[CAM_DEFAULT].lookAt_eye.y = 1000.0f;
165 gCameras[CAM_DEFAULT].lookAt_eye.z = 1500.0f;
166
170
174
176
181
188 clear_npcs();
191 clear_entity_data(TRUE);
195 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
197 load_map_bg("title_bg");
199 bgm_set_song(0, SONG_MAIN_THEME, 0, 500, 8);
201}
@ CAMERA_FLAG_DISABLED
Definition enums.h:4721
@ SONG_MAIN_THEME
Definition enums.h:388
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ INTRO_PART_NONE
Definition enums.h:3556
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ CONTEXT_WORLD
Definition enums.h:3529
@ PLAYER_SPRITES_MARIO_WORLD
Definition enums.h:6346
@ GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD
Definition enums.h:4321
@ CAM_TATTLE
Definition enums.h:1802
@ CAM_DEFAULT
Definition enums.h:1800
@ CAM_HUD
Definition enums.h:1803
@ CAM_BATTLE
Definition enums.h:1801
void clear_script_list(void)
void create_cameras(void)
Definition cam_main.c:255
void clear_animator_list(void)
Definition animator.c:222
s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume)
void clear_render_tasks(void)
Definition model.c:4536
void * load_asset_by_name(const char *assetName, u32 *decompressedSize)
Definition world.c:251
void set_background(BackgroundHeader *)
Definition background.c:40
void clear_entity_data(b32)
Definition entity.c:787
void startup_fade_screen_update(void)
void load_map_bg(char *optAssetName)
Definition background.c:14
void clear_printers(void)
Definition msg.c:196
void clear_effect_data(void)
Definition effects.c:37
HeapNode * general_heap_create(void)
Definition heap.c:6
void clear_worker_list(void)
Definition worker.c:10
s32 general_heap_free(void *data)
Definition heap.c:18
void clear_player_data(void)
Definition inventory.c:49
void decode_yay0(void *src, void *dst)
void clear_entity_models(void)
void reset_background_settings(void)
Definition background.c:33
void * heap_malloc(s32 size)
Definition heap.c:34
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height)
Definition cam_main.c:373
void set_game_mode_render_frontUI(void(*fn)(void))
Definition game_modes.c:154
void hud_element_clear_cache(void)
void clear_npcs(void)
Definition npc.c:60
void sfx_set_reverb_mode(s32 arg0)
Definition sfx.c:352
#define CAM_NEAR_CLIP
Definition macros.h:117
#define CAM_FAR_CLIP
Definition macros.h:118
void spr_init_sprites(s32 playerSpriteSet)
Definition sprite.c:764
void appendGfx_title_screen(void)
BSS TitleDataStruct * TitleScreen_ImgList
BSS s16 TitleScreen_TimeLeft
s16 bgColor[3]
Vec3f lookAt_obj_target
union Camera::@17 params
Vec3f lookAt_eye
s32 gOverrideFlags
Definition main_loop.c:11
BackgroundHeader gBackgroundImage
Camera gCameras[4]
Definition cam_main.c:17
s32 gCurrentCameraID
Definition cam_math.c:4
s32 gTimeFreezeMode
Definition main_loop.c:12

◆ state_step_title_screen()

void state_step_title_screen ( void )

Definition at line 203 of file state_title_screen.c.

203 {
204 s32 temp;
205 u32 pressedButtons = gGameStatusPtr->pressedButtons[0];
206
207 set_curtain_scale(1.0f);
208 set_curtain_fade(0.0f);
209
210 if (TitleScreen_TimeLeft > 0) {
212 }
213
214 switch (gGameStatusPtr->startupState) {
215 case TITLE_STATE_INIT:
221 break;
223 if (TitleScreen_AppearDelay != 0) {
225 break;
226 }
229 }
230 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
231 if (startup_fade_screen_in(6) != 0) {
234 }
235 }
237 break;
238 case TITLE_STATE_HOLD:
239
240 #if DX_SKIP_DEMO && DX_SKIP_STORY
241 // play neither demo nor story
243 #elif DX_SKIP_DEMO
244 // only the story may play
245 if (TitleScreen_TimeLeft == 120) {
246 bgm_set_song(0, -1, 0, 3900, 8);
247 }
248 if (TitleScreen_TimeLeft == 0) {
251 return;
252 }
253 #elif DX_SKIP_STORY
254 // only the demo may play
255 if (TitleScreen_TimeLeft == 0) {
258 return;
259 }
260 #else
261 // allow either demo or story to play
262 if (PlayIntroNext && TitleScreen_TimeLeft == 120) {
263 bgm_set_song(0, -1, 0, 3900, 8);
264 }
265 if (TitleScreen_TimeLeft == 0) {
267 if (!PlayIntroNext) {
269 } else {
271 }
272 PlayIntroNext ^= 1;
273 return;
274 }
275 #endif
276 if (pressedButtons & (BUTTON_A | BUTTON_START)) {
280 bgm_set_song(0, SONG_FILE_SELECT, 0, 500, 8);
281 return;
282 }
283 break;
289 } else {
291 }
293 break;
298 }
299 if (startup_fade_screen_out(10) != 0) {
304 }
305 }
312 } else {
314 }
315 } else {
319 }
320 break;
321 case TITLE_STATE_EXIT:
324 break;
325 }
331 clear_npcs();
334 clear_entity_data(TRUE);
336 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
337 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD;
339
340 switch (TitleScreenNextState) {
341 case NEXT_STATE_INTRO:
344 break;
345 case NEXT_STATE_DEMO:
347 break;
350 gGameStatusPtr->mapID = 0xB; //TODO hardcoded map IDs
353 break;
354 }
355 return;
356 }
357
359 update_npcs();
361 }
362}
u32 pressedButtons[4]
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_START
Definition enums.h:2787
@ SONG_FILE_SELECT
Definition enums.h:387
@ INTRO_PART_0
Definition enums.h:3552
@ AREA_KMR
Definition enums.h:2960
@ SOUND_FILE_MENU_IN
Definition enums.h:710
@ GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME
Definition enums.h:4322
void set_curtain_fade(f32 fade)
Definition curtains.c:302
b32 startup_fade_screen_in(s16 subtractAlpha)
void update_cameras(void)
Definition cam_main.c:19
void set_curtain_scale(f32 scale)
Definition curtains.c:289
void clear_windows(void)
Definition windows.c:135
void startup_set_fade_screen_color(s16 color)
b32 startup_fade_screen_out(s16 addAlpha)
void set_game_mode(s32 modeID)
Definition game_modes.c:127
@ GAME_MODE_DEMO
Definition game_modes.h:22
@ GAME_MODE_FILE_SELECT
Definition game_modes.h:19
@ GAME_MODE_INTRO
Definition game_modes.h:21
void update_npcs(void)
Updates all NPCs.
Definition npc.c:617
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
s16 TitleScreenNextState
s32 PlayIntroNext
BSS s16 TitleScreen_AppearDelay

◆ state_drawUI_title_screen()

void state_drawUI_title_screen ( void )

Definition at line 364 of file state_title_screen.c.

364 {
365 switch (gGameStatusPtr->startupState) {
366 case TITLE_STATE_INIT:
368 PressStart_IsVisible = FALSE;
370 break;
371 case TITLE_STATE_HOLD:
374 }
376 break;
380 break;
381 }
382}
void title_screen_draw_press_start(void)

Variable Documentation

◆ TitleScreenNextState

s16 TitleScreenNextState = NEXT_STATE_NONE

Definition at line 48 of file state_title_screen.c.

Referenced by state_step_title_screen().

◆ gSaveSlotSummary

SaveFileSummary gSaveSlotSummary[4]
Initial value:
= {
{ .filename = { "ERROR\xf7\xf7\xf7" } },
{ .filename = { "ERROR\xf7\xf7\xf7" } },
{ .filename = { "ERROR\xf7\xf7\xf7" } },
{ .filename = { "ERROR\xf7\xf7\xf7" } },
}

Definition at line 50 of file state_title_screen.c.

50 {
51 { .filename = { FILENAME_ERROR } },
52 { .filename = { FILENAME_ERROR } },
53 { .filename = { FILENAME_ERROR } },
54 { .filename = { FILENAME_ERROR } },
55};
#define FILENAME_ERROR

Referenced by filemenu_draw_contents_file_info(), filemenu_draw_contents_file_title(), filemenu_init(), filemenu_main_handle_input(), filemenu_yesno_handle_input(), fio_load_game(), and fio_save_game().

◆ gSaveSlotMetadata

SaveSlotMetadata gSaveSlotMetadata[4]
Initial value:
= {
{ .hasData = TRUE },
{ .hasData = TRUE },
{ .hasData = TRUE },
{ .hasData = TRUE },
}

Definition at line 57 of file state_title_screen.c.

57 {
58 { .hasData = TRUE },
59 { .hasData = TRUE },
60 { .hasData = TRUE },
61 { .hasData = TRUE },
62};

Referenced by filemenu_draw_contents_file_info(), filemenu_draw_contents_file_title(), filemenu_init(), filemenu_main_handle_input(), filemenu_yesno_draw_prompt_contents(), and filemenu_yesno_handle_input().

◆ PressStart_Alpha

s32 PressStart_Alpha = 0

◆ PressStart_IsVisible

b32 PressStart_IsVisible = FALSE

◆ PressStart_BlinkCounter

s32 PressStart_BlinkCounter = 0

◆ PlayIntroNext

s32 PlayIntroNext = FALSE

Definition at line 71 of file state_title_screen.c.

Referenced by state_step_title_screen().

◆ D_80077A38

Lights1 D_80077A38 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)

Definition at line 73 of file state_title_screen.c.

Referenced by appendGfx_title_screen().

◆ TitleSetupGfx

Gfx TitleSetupGfx[]
Initial value:
= {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetTextureFilter(G_TF_POINT),
gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetColorDither(G_CD_DISABLE),
gsDPSetAlphaDither(G_AD_DISABLE),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetCombineKey(G_CK_NONE),
gsDPSetAlphaCompare(G_AC_NONE),
gsDPNoOp(),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
gsSPEndDisplayList(),
}

Definition at line 75 of file state_title_screen.c.

75 {
76 gsDPPipeSync(),
77 gsDPSetCycleType(G_CYC_1CYCLE),
78 gsDPSetRenderMode(G_RM_CLD_SURF, G_RM_CLD_SURF2),
79 gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
80 gsDPSetTextureFilter(G_TF_POINT),
81 gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
82 gsDPSetTexturePersp(G_TP_NONE),
83 gsDPSetColorDither(G_CD_DISABLE),
84 gsDPSetAlphaDither(G_AD_DISABLE),
85 gsDPSetTextureLOD(G_TL_TILE),
86 gsDPSetTextureLUT(G_TT_NONE),
87 gsDPSetTextureDetail(G_TD_CLAMP),
88 gsDPSetTextureConvert(G_TC_FILT),
89 gsDPSetCombineKey(G_CK_NONE),
90 gsDPSetAlphaCompare(G_AC_NONE),
91 gsDPNoOp(),
92 gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
93 gsSPEndDisplayList(),
94};

Referenced by title_screen_draw_copyright(), title_screen_draw_logo(), and title_screen_draw_press_start().

◆ TitleScreen_AppearDelay

BSS s16 TitleScreen_AppearDelay

Definition at line 109 of file state_title_screen.c.

Referenced by state_step_title_screen().

◆ TitleScreen_ImgList

BSS TitleDataStruct* TitleScreen_ImgList

Definition at line 110 of file state_title_screen.c.

Referenced by state_init_title_screen().

◆ TitleScreen_ImgList_Logo

BSS s32* TitleScreen_ImgList_Logo

Definition at line 111 of file state_title_screen.c.

Referenced by state_init_title_screen(), and title_screen_draw_logo().

◆ TitleScreen_ImgList_Copyright

BSS u8(* TitleScreen_ImgList_Copyright)[144]

Definition at line 112 of file state_title_screen.c.

Referenced by state_init_title_screen(), and title_screen_draw_copyright().

◆ TitleScreen_ImgList_PressStart

BSS s32* TitleScreen_ImgList_PressStart

Definition at line 113 of file state_title_screen.c.

Referenced by state_init_title_screen(), and title_screen_draw_press_start().

◆ TitleScreen_ImgList_CopyrightPalette

BSS s32* TitleScreen_ImgList_CopyrightPalette

Definition at line 114 of file state_title_screen.c.

Referenced by state_init_title_screen(), and title_screen_draw_copyright().

◆ TitleScreen_TimeLeft

BSS s16 TitleScreen_TimeLeft

Definition at line 115 of file state_title_screen.c.

Referenced by state_init_title_screen(), and state_step_title_screen().