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

Go to the source code of this file.

Macros

#define LOGO_1_Y   89
 
#define LOGO_2_Y   59
 
#define N64_FADE_IN_TIME   40
 

Enumerations

enum  LogoStates {
  LOGOS_STATE_N64_FADE_IN = 0x0 , LOGOS_STATE_N64_HOLD = 0x1 , LOGOS_STATE_N64_FADE_OUT = 0x2 , LOGOS_STATE_NINTENDO_FADE_IN = 0x3 ,
  LOGOS_STATE_NINTENDO_HOLD = 0x4 , LOGOS_STATE_NINTENDO_FADE_OUT = 0x5 , LOGOS_STATE_IS_FADE_IN = 0x6 , LOGOS_STATE_IS_HOLD_1 = 0x7 ,
  LOGOS_STATE_IS_HOLD_2 = 0x8 , LOGOS_STATE_IS_FADE_OUT = 0x9 , LOGOS_STATE_CURTAINS_APPEAR = 0xA , LOGOS_STATE_CLEANUP = 0xB
}
 

Functions

void appendGfx_intro_logos (void)
 
void state_init_logos (void)
 
void state_step_logos (void)
 
void state_drawUI_logos (void)
 

Variables

s32 D_800778C0 [] = { 0, 0 }
 
Gfx D_800778C8 []
 
Gfx D_80077908 []
 
BSS u8 * gLogosImages
 
BSS u8 * gLogosImage3
 
BSS u8 * gLogosImage1
 
BSS u8 * gLogosImage2
 

Macro Definition Documentation

◆ LOGO_1_Y

#define LOGO_1_Y   89

Definition at line 17 of file state_logos.c.

Referenced by appendGfx_intro_logos().

◆ LOGO_2_Y

#define LOGO_2_Y   59

Definition at line 18 of file state_logos.c.

Referenced by appendGfx_intro_logos().

◆ N64_FADE_IN_TIME

#define N64_FADE_IN_TIME   40

Definition at line 19 of file state_logos.c.

Referenced by state_step_logos().

Enumeration Type Documentation

◆ LogoStates

enum LogoStates
Enumerator
LOGOS_STATE_N64_FADE_IN 
LOGOS_STATE_N64_HOLD 
LOGOS_STATE_N64_FADE_OUT 
LOGOS_STATE_NINTENDO_FADE_IN 
LOGOS_STATE_NINTENDO_HOLD 
LOGOS_STATE_NINTENDO_FADE_OUT 
LOGOS_STATE_IS_FADE_IN 
LOGOS_STATE_IS_HOLD_1 
LOGOS_STATE_IS_HOLD_2 
LOGOS_STATE_IS_FADE_OUT 
LOGOS_STATE_CURTAINS_APPEAR 
LOGOS_STATE_CLEANUP 

Definition at line 22 of file state_logos.c.

22 {
35};
@ LOGOS_STATE_NINTENDO_HOLD
Definition state_logos.c:27
@ LOGOS_STATE_NINTENDO_FADE_OUT
Definition state_logos.c:28
@ LOGOS_STATE_IS_FADE_OUT
Definition state_logos.c:32
@ LOGOS_STATE_NINTENDO_FADE_IN
Definition state_logos.c:26
@ LOGOS_STATE_IS_HOLD_1
Definition state_logos.c:30
@ LOGOS_STATE_N64_FADE_IN
Definition state_logos.c:23
@ LOGOS_STATE_CLEANUP
Definition state_logos.c:34
@ LOGOS_STATE_N64_FADE_OUT
Definition state_logos.c:25
@ LOGOS_STATE_N64_HOLD
Definition state_logos.c:24
@ LOGOS_STATE_CURTAINS_APPEAR
Definition state_logos.c:33
@ LOGOS_STATE_IS_HOLD_2
Definition state_logos.c:31
@ LOGOS_STATE_IS_FADE_IN
Definition state_logos.c:29

Function Documentation

◆ appendGfx_intro_logos()

void appendGfx_intro_logos ( void )

Definition at line 259 of file state_logos.c.

259 {
260 s32 i;
261
262 gDPPipeSync(gMainGfxPos++);
263 gDPSetRenderMode(gMainGfxPos++, G_RM_NOOP, G_RM_NOOP2);
264 gDPSetCombineMode(gMainGfxPos++, G_CC_DECALRGB, G_CC_DECALRGB);
265 gDPSetCycleType(gMainGfxPos++, G_CYC_FILL);
266 gDPSetFillColor(gMainGfxPos++, PACK_FILL_COLOR(224, 224, 224, 1));
267 gDPFillRectangle(gMainGfxPos++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
268 gDPPipeSync(gMainGfxPos++);
269
270 switch (gGameStatusPtr->startupState) {
274 gSPDisplayList(gMainGfxPos++, D_80077908);
275 for (i = 0; i < 7; i++) {
276 gDPLoadTextureTile(gMainGfxPos++, gLogosImage1 + i * 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 128, 112,
277 0, 0, 127, 15, 0,
278 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
279 gSPTextureRectangle(gMainGfxPos++, 96 * 4, (64 + i * 16) * 4, 224 * 4, (80 + i * 16) * 4, G_TX_RENDERTILE, 0, 0, 1024, 1024);
280 gDPPipeSync(gMainGfxPos++);
281 }
282 break;
286#if VERSION_JP
287 break;
292#endif
293 gSPDisplayList(gMainGfxPos++, D_80077908);
294 for (i = 0; i < 6; i++) {
295 gDPLoadTextureTile(gMainGfxPos++, gLogosImage2 + i * 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, 48,
296 0, 0, 255, 7, 0,
297 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
298 gSPTextureRectangle(
299 gMainGfxPos++,
300 32 * 4, (LOGO_1_Y + i * 8) * 4,
301 288 * 4, (LOGO_1_Y + 8 + i * 8) * 4,
302 G_TX_RENDERTILE, 0, 0, 1024, 1024);
303 gDPPipeSync(gMainGfxPos++);
304 }
305#if !VERSION_JP
306 break;
311 gSPDisplayList(gMainGfxPos++, D_80077908);
312#endif
313 for (i = 0; i < 14; i++) {
314 gDPLoadTextureTile(gMainGfxPos++, gLogosImage3 + i * 0x1000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 256, 112,
315 0, 0, 255, 7, 0,
316 G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
317 gSPTextureRectangle(gMainGfxPos++,
318 32 * 4, (LOGO_2_Y + i * 8) * 4,
319 288 * 4, (LOGO_2_Y + 8 + i * 8) * 4,
320 G_TX_RENDERTILE, 0, 0, 1024, 1024);
321 gDPPipeSync(gMainGfxPos++);
322 }
323 break;
324 }
325}
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
#define PACK_FILL_COLOR(r, g, b, a)
Definition macros.h:163
BSS u8 * gLogosImage2
Definition state_logos.c:64
BSS u8 * gLogosImage1
Definition state_logos.c:63
Gfx D_80077908[]
Definition state_logos.c:50
#define LOGO_1_Y
Definition state_logos.c:17
BSS u8 * gLogosImage3
Definition state_logos.c:62
#define LOGO_2_Y
Definition state_logos.c:18
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by state_drawUI_logos().

◆ state_init_logos()

void state_init_logos ( void )

Definition at line 66 of file state_logos.c.

66 {
67 s8* romStart;
68 s8* romEnd;
69
76
77 romEnd = logos_ROM_END;
78 romStart = logos_ROM_START;
79 gLogosImages = heap_malloc(romEnd - romStart);
80 dma_copy(romStart, romEnd, gLogosImages);
81
83 gLogosImage3 = gLogosImages + 0x7000;
84 gLogosImage2 = gLogosImages + 0x15000;
85
86 nuContRmbForceStop();
92 gCameras[CAM_DEFAULT].vfov = 25.0f;
93 set_cam_viewport(CAM_DEFAULT, 12, 28, 296, 184);
94
95 gCameras[CAM_DEFAULT].params.basic.skipRecalc = FALSE;
96 gCameras[CAM_DEFAULT].params.basic.pitch = 0;
97 gCameras[CAM_DEFAULT].params.basic.dist = 40;
98 gCameras[CAM_DEFAULT].params.basic.fovScale = 100;
99
101 gCameras[CAM_DEFAULT].lookAt_eye.y = 1000.0f;
102 gCameras[CAM_DEFAULT].lookAt_eye.z = 1500.0f;
103
107
111
113
118
125 clear_npcs();
128 clear_entity_data(TRUE);
133}
@ CAMERA_FLAG_DISABLED
Definition enums.h:4721
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ 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
void clear_render_tasks(void)
Definition model.c:4536
void startup_set_fade_screen_alpha(s16 alpha)
void clear_entity_data(b32)
Definition entity.c:787
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
Definition 43F0.c:444
void startup_fade_screen_update(void)
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
void startup_set_fade_screen_color(s16 color)
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 hud_element_clear_cache(void)
void clear_npcs(void)
Definition npc.c:60
#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
BSS u8 * gLogosImages
Definition state_logos.c:61
s16 bgColor[3]
Vec3f lookAt_obj_target
union Camera::@17 params
Vec3f lookAt_eye
s32 gOverrideFlags
Definition main_loop.c:11
Camera gCameras[4]
Definition cam_main.c:17
s32 gCurrentCameraID
Definition cam_math.c:4

◆ state_step_logos()

void state_step_logos ( void )

Definition at line 135 of file state_logos.c.

135 {
136 int pressedButtons = gGameStatusPtr->pressedButtons[0];
138 if (startup_fade_screen_out(10)) {
139 set_curtain_scale(1.0f);
140 set_curtain_fade(0.0f);
142 }
143 } else {
154 && (pressedButtons & (BUTTON_START | BUTTON_Z | BUTTON_A))
155 ) {
158 }
159
160 switch (gGameStatusPtr->startupState) {
162 if (startup_fade_screen_in(10)) {
165 }
166 break;
168 if (gGameStatusPtr->logoTime == 0) {
171 }
173 break;
175 if (startup_fade_screen_out(10)) {
177#if VERSION_JP
179#endif
180 }
181 break;
183 if (startup_fade_screen_in(10)) {
186 }
187 break;
189 if (gGameStatusPtr->logoTime == 0) {
191#if VERSION_JP
193#else
195#endif
196 }
198 break;
200 if (startup_fade_screen_out(10)) {
202 }
203 break;
205 if (startup_fade_screen_in(10)) {
208 }
209 break;
211 if (gGameStatusPtr->logoTime == 0) {
215 }
217 break;
219 if (gGameStatusPtr->logoTime == 0) {
224 } else {
226 }
227 break;
229 if (startup_fade_screen_out(10)) {
232 }
233 break;
235 if (gGameStatusPtr->logoTime == 0) {
237 } else {
239 }
240 break;
243 gLogosImages = NULL;
247 break;
248 }
249 }
250 update_npcs();
253}
u32 pressedButtons[4]
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_START
Definition enums.h:2787
@ BUTTON_Z
Definition enums.h:2788
@ INTRO_PART_0
Definition enums.h:3552
void set_curtain_fade(f32 fade)
Definition curtains.c:302
void set_curtain_draw_callback(void(*callback)(void))
b32 startup_fade_screen_in(s16 subtractAlpha)
void set_curtain_fade_goal(f32 fade)
Definition curtains.c:298
void update_cameras(void)
Definition cam_main.c:19
s32 heap_free(void *ptr)
Definition heap.c:42
void set_curtain_scale(f32 scale)
Definition curtains.c:289
b32 startup_fade_screen_out(s16 addAlpha)
void set_curtain_scale_goal(f32 scale)
Definition curtains.c:285
void set_game_mode(s32 modeID)
Definition game_modes.c:127
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
@ GAME_MODE_INTRO
Definition game_modes.h:21
void update_npcs(void)
Updates all NPCs.
Definition npc.c:617
#define N64_FADE_IN_TIME
Definition state_logos.c:19

◆ state_drawUI_logos()

void state_drawUI_logos ( void )

Definition at line 255 of file state_logos.c.

255 {
257}
void appendGfx_intro_logos(void)

Variable Documentation

◆ D_800778C0

s32 D_800778C0[] = { 0, 0 }

Definition at line 37 of file state_logos.c.

37{ 0, 0 };

◆ D_800778C8

Gfx D_800778C8[]
Initial value:
= {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_COPY),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_NOOP, G_RM_NOOP2),
gsDPSetTextureFilter(G_TF_POINT),
gsSPEndDisplayList(),
}

Definition at line 39 of file state_logos.c.

39 {
40 gsDPPipeSync(),
41 gsDPSetCycleType(G_CYC_COPY),
42 gsDPSetTexturePersp(G_TP_NONE),
43 gsDPSetTextureLUT(G_TT_NONE),
44 gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
45 gsDPSetRenderMode(G_RM_NOOP, G_RM_NOOP2),
46 gsDPSetTextureFilter(G_TF_POINT),
47 gsSPEndDisplayList(),
48};

◆ D_80077908

Gfx D_80077908[]
Initial value:
= {
gsDPPipeSync(),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
gsDPSetTextureFilter(G_TF_POINT),
gsSPEndDisplayList(),
}

Definition at line 50 of file state_logos.c.

50 {
51 gsDPPipeSync(),
52 gsDPSetCycleType(G_CYC_1CYCLE),
53 gsDPSetTexturePersp(G_TP_NONE),
54 gsDPSetTextureLUT(G_TT_NONE),
55 gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
56 gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
57 gsDPSetTextureFilter(G_TF_POINT),
58 gsSPEndDisplayList(),
59};

Referenced by appendGfx_intro_logos().

◆ gLogosImages

BSS u8* gLogosImages

Definition at line 61 of file state_logos.c.

Referenced by state_init_logos(), and state_step_logos().

◆ gLogosImage3

BSS u8* gLogosImage3

Definition at line 62 of file state_logos.c.

Referenced by appendGfx_intro_logos(), and state_init_logos().

◆ gLogosImage1

BSS u8* gLogosImage1

Definition at line 63 of file state_logos.c.

Referenced by appendGfx_intro_logos(), and state_init_logos().

◆ gLogosImage2

BSS u8* gLogosImage2

Definition at line 64 of file state_logos.c.

Referenced by appendGfx_intro_logos(), and state_init_logos().