Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
state_file_select.c
Go to the documentation of this file.
1#include "common.h"
2#include "ld_addrs.h"
3#include "nu/nusys.h"
4#include "hud_element.h"
5#include "sprite.h"
6#include "model.h"
7#include "game_modes.h"
8
9#if VERSION_JP
10// TODO: split the filemenu segment
11extern Addr filemenu_ROM_START;
12extern Addr filemenu_ROM_END;
13extern Addr filemenu_VRAM;
14extern Addr filemenu_TEXT_START;
15extern Addr filemenu_TEXT_END;
16extern Addr filemenu_DATA_START;
17extern Addr filemenu_RODATA_END;
18extern Addr filemenu_BSS_START;
19extern Addr filemenu_BSS_END;
20#endif
21
22extern u16 gFrameBuf0[];
23extern u16 gFrameBuf1[];
24extern u16 gFrameBuf2[];
26
27NUPiOverlaySegment D_8007798C = {
28 .romStart = filemenu_ROM_START,
29 .romEnd = filemenu_ROM_END,
30 .ramStart = filemenu_VRAM,
31 .textStart = filemenu_TEXT_START,
32 .textEnd = filemenu_TEXT_END,
33 .dataStart = filemenu_DATA_START,
34 .dataEnd = filemenu_RODATA_END,
35 .bssStart = filemenu_BSS_START,
36 .bssEnd = filemenu_BSS_END,
37};
38
40
41extern s32 D_80200000;
43
46static s16 D_800A0932;
47
49 D_800A0931 = 0;
50 D_800A0932 = 0;
56 mdl_load_all_textures(NULL, 0, 0);
57
62 gCameras[CAM_DEFAULT].vfov = 25.0f;
63 set_cam_viewport(CAM_DEFAULT, 12, 28, 296, 184);
64
65 gCameras[CAM_DEFAULT].params.basic.skipRecalc = FALSE;
66 gCameras[CAM_DEFAULT].params.basic.pitch = 0;
67 gCameras[CAM_DEFAULT].params.basic.dist = 40;
68 gCameras[CAM_DEFAULT].params.basic.fovScale = 100;
69
73
77
81
83
88
90}
91
93 switch (D_800A0931) {
94 case 0:
95 D_800A0931 = 1;
96 break;
97 case 1:
99 D_800A0930 = 1;
100 D_800A0931 = 2;
101 break;
102 case 2:
103 if (D_800A0930 >= 0) {
104 D_800A0930--;
105 if (D_800A0930 == 0) {
106 D_800A0930 = -1;
108 nuPiReadRomOverlay(&D_8007798C);
109 filemenu_init(0);
110 }
111 }
112
113 if (D_800A0930 < 0) {
115 }
116 break;
117 }
118}
119
121}
122
124 D_800A0931 = 0;
125 D_800A0932 = 0;
126 D_800A0930 = 0;
127
128 if (func_80244BC4() == 0) {
130 } else {
132 gOverrideFlags &= ~GLOBAL_OVERRIDES_WINDOWS_OVER_CURTAINS;
133 bgm_set_song(0, -1, 0, 1000, 8);
134 }
135 gOverrideFlags &= ~GLOBAL_OVERRIDES_40;
136}
137
139 s32 temp_s0 = func_80244BC4();
140 s32 flagSum;
141 s32 i;
142
143 switch (D_800A0931) {
144 case 0:
145 flagSum = 0;
146
147 for (i = 44; i < ARRAY_COUNT(gWindows); i++) {
148 Window* window = &gWindows[i];
149
150 if (window->parent == WIN_FILES_MAIN || window->parent == WIN_NONE) {
151 flagSum += window->flags & WINDOW_FLAG_INITIAL_ANIMATION;
152 }
153 }
154
155 if (flagSum == 0) {
156 D_800A0931 = 1;
157 }
158 break;
159 case 1:
160 if (temp_s0 == 0 || update_exit_map_screen_overlay(&D_800A0932) != 0) {
161 D_800A0931 = 2;
162 }
163 break;
164 case 2:
167 D_800A0931 = 3;
168 case 3:
170 if (temp_s0 == 0) {
172 gOverrideFlags &= ~GLOBAL_OVERRIDES_WINDOWS_OVER_CURTAINS;
173 } else {
174 D_800A0930 = 10;
175 D_800A0931 = 4;
176 }
177 break;
178 case 4:
179 if (D_800A0930 > 0) {
180 D_800A0930--;
181 } else {
183 D_800A0930 = 10;
184 D_800A0931 = 5;
185 }
186 break;
187 case 5:
188 if (D_800A0930 > 0) {
189 D_800A0930--;
190 } else {
191 D_800A0931 = 6;
192 }
193 break;
194 case 6:
196 break;
197 }
198}
199
@ TRANSITION_ENTER_WORLD
Definition enums.h:2370
@ TRANSITION_SLOW_FADE_TO_WHITE
Definition enums.h:2369
@ CAMERA_FLAG_DISABLED
Definition enums.h:4721
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ WINDOW_FLAG_INITIAL_ANIMATION
Definition enums.h:4996
@ TIME_FREEZE_FULL
Definition enums.h:3466
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ WINDOW_GROUP_FILES
Definition enums.h:5326
@ WINDOW_GROUP_ALL
Definition enums.h:5323
@ GLOBAL_OVERRIDES_WINDOWS_OVER_CURTAINS
Definition enums.h:4335
@ CAM_TATTLE
Definition enums.h:1802
@ CAM_DEFAULT
Definition enums.h:1800
@ CAM_HUD
Definition enums.h:1803
@ CAM_BATTLE
Definition enums.h:1801
@ WIN_FILES_MAIN
Definition enums.h:5288
@ WIN_NONE
Definition enums.h:5240
void filemenu_init(s32)
void filemenu_cleanup(void)
s32 bgm_set_song(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume)
void set_map_transition_effect(ScreenTransition)
s32 disable_player_input(void)
Definition 77480.c:990
HeapNode * general_heap_create(void)
Definition heap.c:6
void filemenu_update(void)
void mdl_load_all_textures(struct ModelNode *model, s32 romOffset, s32 size)
Definition model.c:2322
void set_windows_visible(s32 groupIdx)
Definition windows.c:445
s16 update_exit_map_screen_overlay(s16 *progress)
void set_time_freeze_mode(s32)
Time freeze modes: 0: none 1: NPCs move, can't be interacted with 2: NPCs don't move,...
Definition main_loop.c:358
s32 battle_heap_create(void)
Definition heap.c:22
s32 func_80244BC4(void)
void set_curtain_scale_goal(f32 scale)
Definition curtains.c:285
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height)
Definition cam_main.c:373
void set_game_mode(s32 modeID)
Definition game_modes.c:127
@ GAME_MODE_ENTER_WORLD
Definition game_modes.h:11
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
void hud_element_set_aux_cache(void *base, s32 size)
void hud_element_clear_cache(void)
#define CAM_NEAR_CLIP
Definition macros.h:117
#define BSS
Definition macros.h:7
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define CAM_FAR_CLIP
Definition macros.h:118
u8 IntroMessageIdx
void state_init_file_select(void)
void state_step_exit_file_select(void)
void state_step_file_select(void)
void state_drawUI_exit_file_select(void)
u16 gFrameBuf2[]
Definition heaps3.c:7
u16 * fsFrameBuffers[]
u16 gFrameBuf1[]
Definition heaps3.c:6
ShapeFile gMapShapeData
Definition heaps.c:16
void state_init_exit_file_select(void)
BSS s8 D_800A0931
NUPiOverlaySegment D_8007798C
BSS s8 D_800A0930
u16 gFrameBuf0[]
Definition heaps3.c:5
void state_drawUI_file_select(void)
s32 D_80200000
s16 bgColor[3]
Vec3f lookAt_obj_target
union Camera::@17 params
Vec3f lookAt_eye
u8 Addr[]
Linker symbol address, as in ld_addrs.h.
Definition types.h:16
s32 gOverrideFlags
Definition main_loop.c:11
Camera gCameras[4]
Definition cam_main.c:17
s32 gCurrentCameraID
Definition cam_math.c:4
Window gWindows[64]
Definition windows.c:23