Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
state_startup.c
Go to the documentation of this file.
1#include "common.h"
2#include "hud_element.h"
3#include "fio.h"
4#include "sprite.h"
5#include "game_modes.h"
6#include "dx/config.h"
7#include "dx/versioning.h"
8
13
15 s32 i;
16
17 if (gGameStatus.startupState != 0) {
19 return;
20 }
21
35
51 clear_entity_data(FALSE);
54 clear_npcs();
68
69 for (i = 0; i < ARRAY_COUNT(gGameStatus.unk_50); i++) {
70 gGameStatus.unk_50[i] = 4;
71 gGameStatus.unk_48[i] = 15;
72 }
73
75
76 if (gSaveGlobals.useMonoSound == 0) {
79 } else {
82 }
83
84 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
85
86 #if DX_QUICK_LAUNCH
87 // immediately jump into the world using last-used save file
91 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD;
92 return;
93 }
94 #endif
95
96 #if DX_SKIP_LOGOS
97 // go right to the story book or file select
98 #if DX_SKIP_STORY
100 set_curtain_fade(0.0f);
102 #else
103 set_curtain_scale(1.0f);
104 set_curtain_fade(0.3f);
107 #endif
108 #else
109 // use vanilla startup process
111 #endif
112}
113
115 startup_draw_prim_rect(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0, 0, 0, 255);
116}
void audio_set_stereo(void)
Definition 30450.c:839
void audio_set_mono(void)
Definition 30450.c:844
b8 keepUsingPartnerOnMapChange
@ DEBUG_SCRIPTS_NONE
Definition enums.h:4275
@ SOUND_OUT_MONO
Definition enums.h:277
@ SOUND_OUT_STEREO
Definition enums.h:278
@ INTRO_PART_NONE
Definition enums.h:3556
@ INTRO_PART_0
Definition enums.h:3552
@ CONTEXT_WORLD
Definition enums.h:3529
@ PLAYER_SPRITES_MARIO_WORLD
Definition enums.h:6346
@ DEMO_STATE_NONE
Definition enums.h:3535
@ GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME
Definition enums.h:4322
b32 fio_load_globals(void)
Definition fio.c:75
b32 fio_load_game(s32 saveSlot)
Definition fio.c:167
SaveGlobals gSaveGlobals
Definition fio.c:20
void clear_script_list(void)
void clear_item_entity_data(void)
void create_cameras(void)
Definition cam_main.c:255
void clear_animator_list(void)
Definition animator.c:222
void startup_draw_prim_rect(s16 left, s16 top, s16 right, s16 bottom, u16 r, u16 g, u16 b, u16 a)
Definition 43F0.c:823
void clear_saved_variables(void)
Definition vars_access.c:5
void clear_screen_overlays(void)
void initialize_curtains(void)
Definition curtains.c:212
void clear_render_tasks(void)
Definition model.c:4536
void clear_model_data(void)
Definition model.c:2364
void set_curtain_fade(f32 fade)
Definition curtains.c:302
void clear_trigger_data(void)
Definition trigger.c:13
void clear_sprite_shading_data(void)
void clear_entity_data(b32)
Definition entity.c:787
void clear_printers(void)
Definition msg.c:196
void initialize_collision(void)
Definition collision.c:111
void bgm_reset_volume(void)
void reset_battle_status(void)
Definition battle.c:99
void clear_player_status(void)
Definition 77480.c:807
void clear_effect_data(void)
Definition effects.c:37
HeapNode * general_heap_create(void)
Definition heap.c:6
s32 bgm_init_music_players(void)
void clear_worker_list(void)
Definition worker.c:10
void set_curtain_scale(f32 scale)
Definition curtains.c:289
void clear_windows(void)
Definition windows.c:135
void clear_player_data(void)
Definition inventory.c:49
void clear_entity_models(void)
void reset_background_settings(void)
Definition background.c:33
void partner_initialize_data(void)
Definition partners.c:1032
void set_game_mode(s32 modeID)
Definition game_modes.c:127
@ GAME_MODE_LOGOS
Definition game_modes.h:8
@ GAME_MODE_ENTER_WORLD
Definition game_modes.h:11
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
@ GAME_MODE_INTRO
Definition game_modes.h:21
void hud_element_set_aux_cache(void *base, s32 size)
void hud_element_clear_cache(void)
void clear_npcs(void)
Definition npc.c:60
void init_encounter_status(void)
Definition npc.c:2191
void sfx_clear_sounds(void)
Definition sfx.c:304
#define SCREEN_WIDTH
Definition macros.h:105
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define SCREEN_HEIGHT
Definition macros.h:106
void spr_init_sprites(s32 playerSpriteSet)
Definition sprite.c:764
void state_init_startup(void)
void state_step_startup(void)
void state_drawUI_startup(void)
s32 gOverrideFlags
Definition main_loop.c:11
GameStatus gGameStatus
Definition main_loop.c:21
GameStatus * gGameStatusPtr
Definition main_loop.c:32
s32 useMonoSound
Definition versioning.h:14
u32 lastFileSelected
Definition versioning.h:15