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

Go to the source code of this file.

Data Structures

struct  DemoSceneData
 

Enumerations

enum  DemoSceneType {
  DEMO_SCENE_WORLD = 0 , DEMO_SCENE_PEACH = 1 , DEMO_SCENE_BATTLE = 2 , DEMO_SCENE_DONE = 3 ,
  DEMO_SCENE_EXIT = 4
}
 

Functions

void state_init_demo (void)
 
void state_step_demo (void)
 
void state_drawUI_demo (void)
 

Variables

DemoSceneData DemoScenes []
 
char versionString [] = "Prg Ver.??/??/?? ??:??"
 

Data Structure Documentation

◆ DemoSceneData

struct DemoSceneData
Data Fields
s16 sceneType
u16 index
char unk_4
s8 partnerID
s8 storyProgress
char unk_7
char * mapName

Enumeration Type Documentation

◆ DemoSceneType

Enumerator
DEMO_SCENE_WORLD 
DEMO_SCENE_PEACH 
DEMO_SCENE_BATTLE 
DEMO_SCENE_DONE 
DEMO_SCENE_EXIT 

Definition at line 17 of file state_demo.c.

17 {
23};
@ DEMO_SCENE_PEACH
Definition state_demo.c:19
@ DEMO_SCENE_BATTLE
Definition state_demo.c:20
@ DEMO_SCENE_EXIT
Definition state_demo.c:22
@ DEMO_SCENE_WORLD
Definition state_demo.c:18
@ DEMO_SCENE_DONE
Definition state_demo.c:21

Function Documentation

◆ state_init_demo()

void state_init_demo ( void )

Definition at line 144 of file state_demo.c.

144 {
148 }
149
153
159}
void disable_sounds(void)
Definition 30450.c:865
@ OVERLAY_SCREEN_COLOR
Definition enums.h:2388
@ TRANSITION_END_DEMO_SCENE_BLACK
Definition enums.h:2364
@ DEMO_STATE_ACTIVE
Definition enums.h:3536
@ DEMO_STATE_NONE
Definition enums.h:3535
void clear_script_list(void)
void clear_saved_variables(void)
Definition vars_access.c:5
void set_map_transition_effect(ScreenTransition)
void set_screen_overlay_params_front(u8, f32)
GameStatus * gGameStatusPtr
Definition main_loop.c:32

◆ state_step_demo()

void state_step_demo ( void )

Definition at line 161 of file state_demo.c.

161 {
162 PlayerData* playerData = &gPlayerData;
164 s16 mode = demoSceneData->sceneType;
165 s16 mapID;
166 s16 areaID;
167
169 mode = DEMO_SCENE_DONE;
170 }
172 mode = DEMO_SCENE_EXIT;
173 }
174
175 switch (mode) {
176 case DEMO_SCENE_DONE:
183 break;
184 case DEMO_SCENE_EXIT:
185 if (gGameStatusPtr->startupState != 0) {
187 }
188
189 if (gGameStatusPtr->startupState == 0) {
198 gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME;
213 clear_entity_data(FALSE);
216 clear_npcs();
225 }
226 return;
227 case DEMO_SCENE_WORLD:
228 get_map_IDs_by_name_checked(demoSceneData->mapName, &areaID, &mapID);
229 gGameStatusPtr->areaID = areaID;
230 gGameStatusPtr->mapID = mapID;
231 gGameStatusPtr->entryID = demoSceneData->index;
233 playerData->curPartner = demoSceneData->partnerID;
234 set_cam_viewport(CAM_DEFAULT, 29, 20, -262, 177);
235 evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress);
236
237 if (gGameStatusPtr->nextDemoScene == 0) {
239 } else {
241 }
242
244 break;
245 case DEMO_SCENE_PEACH:
246 get_map_IDs_by_name_checked(demoSceneData->mapName, &areaID, &mapID);
247 gGameStatusPtr->areaID = areaID;
248 gGameStatusPtr->mapID = mapID;
249 gGameStatusPtr->entryID = demoSceneData->index;
251 playerData->curPartner = demoSceneData->partnerID;
252 set_cam_viewport(CAM_DEFAULT, 29, 20, -262, 177);
253 evt_set_variable(NULL, GB_StoryProgress, demoSceneData->storyProgress);
254
255 if (gGameStatusPtr->nextDemoScene == 0) {
257 } else {
259 }
260
262 break;
264 load_demo_battle(demoSceneData->index);
265 break;
266 }
267
271 }
272}
void enable_sounds(void)
Definition 30450.c:861
void load_demo_battle(u32 index)
Definition battle.c:190
b8 keepUsingPartnerOnMapChange
@ TRANSITION_END_DEMO_SCENE_WHITE
Definition enums.h:2365
@ DEBUG_SCRIPTS_NONE
Definition enums.h:4275
@ PEACH_FLAG_IS_PEACH
Definition enums.h:2488
@ CONTEXT_WORLD
Definition enums.h:3529
@ PLAYER_SPRITES_MARIO_WORLD
Definition enums.h:6346
@ DEMO_STATE_4
Definition enums.h:3538
@ DEMO_STATE_DONE
Definition enums.h:3539
@ GLOBAL_OVERRIDES_DISABLE_DRAW_FRAME
Definition enums.h:4322
@ CAM_DEFAULT
Definition enums.h:1800
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 get_map_IDs_by_name_checked(const char *mapName, s16 *areaID, s16 *mapID)
Same as get_map_IDs_by_name, but will panic if the map doesn't exist.
Definition world.c:247
void clear_screen_overlays(void)
void clear_render_tasks(void)
Definition model.c:4536
void clear_model_data(void)
Definition model.c:2364
void startup_set_fade_screen_alpha(s16 alpha)
void clear_trigger_data(void)
Definition trigger.c:13
void clear_sprite_shading_data(void)
void clear_entity_data(b32)
Definition entity.c:787
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
void startup_fade_screen_update(void)
void clear_printers(void)
Definition msg.c:196
void initialize_collision(void)
Definition collision.c:111
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
void clear_worker_list(void)
Definition worker.c:10
void startup_set_fade_screen_color(s16 color)
void clear_player_data(void)
Definition inventory.c:49
void clear_entity_models(void)
void reset_background_settings(void)
Definition background.c:33
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_DEMO_WORLD
Definition game_modes.h:10
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
void hud_element_clear_cache(void)
void clear_npcs(void)
Definition npc.c:60
void init_encounter_status(void)
Definition npc.c:2191
@ GB_StoryProgress
#define LAST_DEMO_SCENE_IDX
Definition macros.h:108
void spr_init_sprites(s32 playerSpriteSet)
Definition sprite.c:764
DemoSceneData DemoScenes[]
Definition state_demo.c:25
char * mapName
Definition state_demo.c:14
s32 gOverrideFlags
Definition main_loop.c:11
PlayerData gPlayerData
Definition 77480.c:40

◆ state_drawUI_demo()

void state_drawUI_demo ( void )

Definition at line 274 of file state_demo.c.

274 {
275
276}

Variable Documentation

◆ DemoScenes

DemoSceneData DemoScenes[]

Definition at line 25 of file state_demo.c.

25 {
26 {
27 .sceneType = DEMO_SCENE_WORLD,
28 .mapName = "nok_12",
29 .index = nok_12_ENTRY_2,
30 .partnerID = PARTNER_GOOMBARIO,
32 },
33 {
34 .sceneType = DEMO_SCENE_BATTLE,
35 .index = 0
36 },
37 {
38 .sceneType = DEMO_SCENE_WORLD,
39 .mapName = "isk_04",
40 .index = isk_04_ENTRY_5,
41 .partnerID = PARTNER_PARAKARRY,
43 },
44 {
45 .sceneType = DEMO_SCENE_WORLD,
46 .mapName = "tik_03",
47 .index = tik_03_ENTRY_2,
48 .partnerID = PARTNER_KOOPER,
50 },
51 {
52 .sceneType = DEMO_SCENE_WORLD,
53 .mapName = "trd_09",
54 .index = trd_09_ENTRY_2,
55 .partnerID = PARTNER_PARAKARRY,
56 .storyProgress = STORY_CH1_STAR_SPIRIT_RESCUED
57 },
58 {
59 .sceneType = DEMO_SCENE_WORLD,
60 .mapName = "jan_04",
61 .index = jan_04_ENTRY_4,
62 .partnerID = PARTNER_SUSHIE,
64 },
65 {
66 .sceneType = DEMO_SCENE_BATTLE,
67 .index = 1
68 },
69 {
70 .sceneType = DEMO_SCENE_WORLD,
71 .mapName = "mac_00",
72 .index = mac_00_ENTRY_6,
73 .partnerID = PARTNER_BOMBETTE,
75 },
76 {
77 .sceneType = DEMO_SCENE_WORLD,
78 .mapName = "kzn_02",
79 .index = kzn_02_ENTRY_2,
80 .partnerID = PARTNER_KOOPER,
81 .storyProgress = STORY_CH5_LAVA_STREAM_BLOCKED
82 },
83 {
84 .sceneType = DEMO_SCENE_BATTLE,
85 .index = 2
86 },
87 {
88 .sceneType = DEMO_SCENE_WORLD,
89 .mapName = "mac_03",
90 .index = mac_03_ENTRY_3,
91 .partnerID = PARTNER_BOMBETTE,
93 },
94 {
95 .sceneType = DEMO_SCENE_WORLD,
96 .mapName = "nok_02" ,
97 .index = nok_02_ENTRY_4,
98 .partnerID = PARTNER_GOOMBARIO,
100 },
101 {
102 .sceneType = DEMO_SCENE_BATTLE,
103 .index = 3
104 },
105 {
106 .sceneType = DEMO_SCENE_PEACH,
107 .mapName = "kkj_11",
108 .index = kkj_11_ENTRY_8,
109 .partnerID = PARTNER_TWINK,
110 .storyProgress = STORY_CH5_BEGAN_PEACH_MISSION
111 },
112 {
113 .sceneType = DEMO_SCENE_WORLD,
114 .mapName = "arn_08",
115 .index = arn_08_ENTRY_2,
116 .partnerID = PARTNER_BOW,
117 .storyProgress = STORY_CH3_UNLOCKED_WINDY_MILL
118 },
119 {
120 .sceneType = DEMO_SCENE_BATTLE,
121 .index = 4
122 },
123 {
124 .sceneType = DEMO_SCENE_WORLD,
125 .mapName = "nok_12",
126 .index = nok_12_ENTRY_3,
127 .partnerID = PARTNER_GOOMBARIO,
129 },
130 {
131 .sceneType = DEMO_SCENE_PEACH,
132 .mapName = "kkj_26",
133 .index = kkj_26_ENTRY_3,
134 .partnerID = PARTNER_NONE,
136 },
138 .sceneType = DEMO_SCENE_DONE,
139 .mapName = "end"
140 },
141 {} // final entry blank
142};
@ kkj_11_ENTRY_8
Definition entrances.h:226
@ arn_08_ENTRY_2
Definition entrances.h:764
@ nok_12_ENTRY_2
Definition entrances.h:343
@ kkj_26_ENTRY_3
Definition entrances.h:266
@ trd_09_ENTRY_2
Definition entrances.h:394
@ nok_02_ENTRY_4
Definition entrances.h:334
@ kzn_02_ENTRY_2
Definition entrances.h:931
@ isk_04_ENTRY_5
Definition entrances.h:652
@ tik_03_ENTRY_2
Definition entrances.h:141
@ jan_04_ENTRY_4
Definition entrances.h:884
@ mac_03_ENTRY_3
Definition entrances.h:120
@ nok_12_ENTRY_3
Definition entrances.h:344
@ mac_00_ENTRY_6
Definition entrances.h:103
@ STORY_CH5_LAVA_STREAM_BLOCKED
Definition enums.h:165
@ STORY_CH5_BEGAN_PEACH_MISSION
Definition enums.h:176
@ STORY_CH3_UNLOCKED_WINDY_MILL
Definition enums.h:114
@ STORY_CH1_STAR_SPIRIT_RESCUED
Definition enums.h:61
@ STORY_CH1_KNOCKED_SWITCH_FROM_TREE
Definition enums.h:39
@ PARTNER_NONE
Definition enums.h:2885
@ PARTNER_BOMBETTE
Definition enums.h:2888
@ PARTNER_BOW
Definition enums.h:2894
@ PARTNER_SUSHIE
Definition enums.h:2892
@ PARTNER_TWINK
Definition enums.h:2896
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ PARTNER_KOOPER
Definition enums.h:2887
@ PARTNER_GOOMBARIO
Definition enums.h:2886

Referenced by state_step_demo().

◆ versionString

char versionString[] = "Prg Ver.??/??/?? ??:??"

Definition at line 285 of file state_demo.c.