Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/src/game/level_update.h
7858 views
1
#ifndef LEVEL_UPDATE_H
2
#define LEVEL_UPDATE_H
3
4
#include <PR/ultratypes.h>
5
6
#include "types.h"
7
8
9
#define TIMER_CONTROL_SHOW 0
10
#define TIMER_CONTROL_START 1
11
#define TIMER_CONTROL_STOP 2
12
#define TIMER_CONTROL_HIDE 3
13
14
#define WARP_OP_NONE 0x00
15
#define WARP_OP_UNKNOWN_01 0x01
16
#define WARP_OP_UNKNOWN_02 0x02
17
#define WARP_OP_WARP_DOOR 0x03
18
#define WARP_OP_WARP_OBJECT 0x04
19
#define WARP_OP_TELEPORT 0x05
20
#define WARP_OP_STAR_EXIT 0x11
21
#define WARP_OP_DEATH 0x12
22
#define WARP_OP_WARP_FLOOR 0x13
23
#define WARP_OP_GAME_OVER 0x14
24
#define WARP_OP_CREDITS_END 0x15
25
#define WARP_OP_DEMO_NEXT 0x16
26
#define WARP_OP_CREDITS_START 0x17
27
#define WARP_OP_CREDITS_NEXT 0x18
28
#define WARP_OP_DEMO_END 0x19
29
#define WARP_OP_CUSTOM_RESET 0x20
30
31
#define WARP_OP_TRIGGERS_LEVEL_SELECT 0x10
32
33
#define MARIO_SPAWN_DOOR_WARP 0x01
34
#define MARIO_SPAWN_UNKNOWN_02 0x02
35
#define MARIO_SPAWN_UNKNOWN_03 0x03
36
#define MARIO_SPAWN_TELEPORT 0x04
37
#define MARIO_SPAWN_INSTANT_ACTIVE 0x10
38
#define MARIO_SPAWN_SWIMMING 0x11
39
#define MARIO_SPAWN_AIRBORNE 0x12
40
#define MARIO_SPAWN_HARD_AIR_KNOCKBACK 0x13
41
#define MARIO_SPAWN_SPIN_AIRBORNE_CIRCLE 0x14
42
#define MARIO_SPAWN_DEATH 0x15
43
#define MARIO_SPAWN_SPIN_AIRBORNE 0x16
44
#define MARIO_SPAWN_FLYING 0x17
45
#define MARIO_SPAWN_PAINTING_STAR_COLLECT 0x20
46
#define MARIO_SPAWN_PAINTING_DEATH 0x21
47
#define MARIO_SPAWN_AIRBORNE_STAR_COLLECT 0x22
48
#define MARIO_SPAWN_AIRBORNE_DEATH 0x23
49
#define MARIO_SPAWN_LAUNCH_STAR_COLLECT 0x24
50
#define MARIO_SPAWN_LAUNCH_DEATH 0x25
51
#define MARIO_SPAWN_UNKNOWN_27 0x27
52
53
54
struct CreditsEntry
55
{
56
/*0x00*/ u8 levelNum;
57
/*0x01*/ u8 areaIndex;
58
/*0x02*/ u8 unk02;
59
/*0x03*/ s8 marioAngle;
60
/*0x04*/ Vec3s marioPos;
61
/*0x0C*/ const char **unk0C;
62
};
63
64
extern struct CreditsEntry *gCurrCreditsEntry;
65
66
extern struct MarioState gMarioStates[];
67
extern struct MarioState *gMarioState;
68
69
extern s16 sCurrPlayMode;
70
extern u16 D_80339ECA;
71
extern s16 sTransitionTimer;
72
extern void (*sTransitionUpdate)(s16 *);
73
extern u8 unused3[4];
74
75
struct WarpDest {
76
u8 type;
77
u8 levelNum;
78
u8 areaIdx;
79
u8 nodeId;
80
u32 arg;
81
};
82
83
extern struct WarpDest sWarpDest;
84
85
extern s16 D_80339EE0;
86
extern s16 sDelayedWarpOp;
87
extern s16 sDelayedWarpTimer;
88
extern s16 sSourceWarpNodeId;
89
extern s32 sDelayedWarpArg;
90
extern u8 unused4[2];
91
extern s8 sTimerRunning;
92
93
struct HudDisplay {
94
/*0x00*/ s16 lives;
95
/*0x02*/ s16 coins;
96
/*0x04*/ s16 stars;
97
/*0x06*/ s16 wedges;
98
/*0x08*/ s16 keys;
99
/*0x0A*/ s16 flags;
100
/*0x0C*/ u16 timer;
101
u16 starGet;
102
};
103
104
extern struct HudDisplay gHudDisplay;
105
extern s8 gNeverEnteredCastle;
106
107
enum HUDDisplayFlag {
108
HUD_DISPLAY_FLAG_LIVES = 0x0001,
109
HUD_DISPLAY_FLAG_COIN_COUNT = 0x0002,
110
HUD_DISPLAY_FLAG_STAR_COUNT = 0x0004,
111
HUD_DISPLAY_FLAG_CAMERA_AND_POWER = 0x0008,
112
HUD_DISPLAY_FLAG_KEYS = 0x0010,
113
HUD_DISPLAY_FLAG_UNKNOWN_0020 = 0x0020,
114
HUD_DISPLAY_FLAG_TIMER = 0x0040,
115
HUD_DISPLAY_FLAG_EMPHASIZE_POWER = 0x8000,
116
117
HUD_DISPLAY_NONE = 0x0000,
118
HUD_DISPLAY_DEFAULT = HUD_DISPLAY_FLAG_LIVES | HUD_DISPLAY_FLAG_COIN_COUNT | HUD_DISPLAY_FLAG_STAR_COUNT | HUD_DISPLAY_FLAG_CAMERA_AND_POWER | HUD_DISPLAY_FLAG_KEYS | HUD_DISPLAY_FLAG_UNKNOWN_0020
119
};
120
121
122
u16 level_control_timer(s32 timerOp);
123
void fade_into_special_warp(u32 arg, u32 color);
124
void load_level_init_text(u32 arg);
125
s16 level_trigger_warp(struct MarioState *m, s32 warpOp);
126
void level_set_transition(s16 length, void (*updateFunction)(s16 *));
127
128
s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused);
129
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum);
130
s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum);
131
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1);
132
s32 credits_wait_for_reset();
133
void basic_update(UNUSED s16 *arg);
134
135
#endif // LEVEL_UPDATE_H
136
137