fork/training-mode-ce

git clone https://git.julia.blue/fork/training-mode-ce

AitchAdd warnings and fix them (#297)4f5d26e

master
7.4 KiB230 linesraw
1#ifndef MEX_H_SCENE
2#define MEX_H_SCENE
3
4#include "structs.h"
5#include "datatypes.h"
6#include "match.h"
7
8// Scene Enums
9enum SCENE_HEAP_KIND
10{
11    SCENEHEAPKIND_UNK0,
12    SCENEHEAPKIND_UNK1,
13    SCENEHEAPKIND_UNK2,
14    SCENEHEAPKIND_UNK3, // shrinks main heap, enables fighter cache?
15    SCENEHEAPKIND_UNK4,
16};
17typedef enum MinorKind
18{
19    MNRKIND_TITLE,     // Title Screen
20    MNRKIND_MNMA,      // Main Menu
21    MNRKIND_MATCH,     // VS Dairantou (In-Game)
22    MNRKIND_SUDDEATH,  // Sudden Death Dairantou (In-Game)
23    MNRKIND_TRAIN,     // Training Mode Dairantou (In-Game)
24    MNRKIND_RST,       // Result Screen
25    MNRKIND_X6,        //
26    MNRKIND_DB,        // Debug Menu
27    MNRKIND_CSS,       // CSS
28    MNRKIND_SSS,       // SSS
29    MNRKIND_XA,        //
30    MNRKIND_TYGAL,     // Trophy Gallery
31    MNRKIND_TYLOT,     // Trophy Lottery
32    MNRKIND_TYCOL,     // Trophy Collection
33    MNRKIND_ADVSPLSH,  // Adventure Mode Splash Screen
34    MNRKIND_TYFALL,    // 1P Mode Trophy Falling Cutscene
35    MNRKIND_ADVCGRT,   // Adventure Mode Congratulations
36    MNRKIND_VI1,       // VisualScene_Luigi
37    MNRKIND_VI2,       // VisualScene_BrinstarLava
38    MNRKIND_VI3,       // VisualScene_PlanetExplode
39    MNRKIND_VI4,       // VisualScene_3KirbysSpawn
40    MNRKIND_VI5,       // VisualScene_GiantKirbySpawns
41    MNRKIND_VI6,       // VisualScene_StarFoxDialog
42    MNRKIND_VI7,       // VisualScene_FZeroRace
43    MNRKIND_VI8,       // VisualScene_MetalMarioLuigi
44    MNRKIND_VI9,       // VisualScene_BowserTrophyFalls
45    MNRKIND_VI10,      // VisualScene_GigaBowserTransformation
46    MNRKIND_VI11,      // VisualScene_GigaBowserDefeated
47    MNRKIND_OP,        // Opening Movie
48    MNRKIND_1PENDMV,   // 1P Mode End Movie
49    MNRKIND_HOWMV,     // How to Play Movie
50    MNRKIND_OMAKE,     // Special Movie
51    MNRKIND_CLSCSPLSH, // TEST
52    MNRKIND_ALSPLSH,   // TEST
53    MNRKIND_GMOV,      // Game over
54    MNRKIND_SOON,      // coming soon
55    MNRKIND_TOSETUP,   // tournament setup
56    MNRKIND_TOBRCK,    // tourn bracket
57    MNRKIND_TOUNK,     // tourn unk
58    MNRKIND_SPCLMSG,   // special msg
59    MNRKIND_PROG,      // progressive
60    MNRKIND_CHLG,      // challenger
61    MNRKIND_CARD,      // memcard prompt
62    MNRKIND_STAFF,     // credits
63    MNRKIND_CAMWARN,   // camera mode memcard prompt
64    MNRKIND_NULL,      // terminator
65} MinorKind;
66typedef enum MajorKind
67{
68    MJRKIND_TITLE,        // Title Screen
69    MJRKIND_MNMA,         // Main Menu
70    MJRKIND_VS,           //
71    MJRKIND_CLASSIC,      //
72    MJRKIND_ADV,          //
73    MJRKIND_ALLSTAR,      //
74    MJRKIND_DBG,          //
75    MJRKIND_DBGSOUND,     //
76    MJRKIND_HANYUTESTCSS, //
77    MJRKIND_HANYUTESTSSS, //
78    MJRKIND_CAMWARN,      // camera mode memcard prompt
79    MJRKIND_TYGAL,        // Trophy Gallery
80    MJRKIND_TYLOT,        // Trophy Lottery
81    MJRKIND_TYCOL,        // Trophy Collection
82    MJRKIND_DBGFIGHT,     //
83    MJRKIND_TARGETS,      //
84    MJRKIND_VSSUDDEATH,   //
85    MJRKIND_VSINVIS,      //
86    MJRKIND_VSSLOW,       //
87    MJRKIND_VSFAST,       //
88    MJRKIND_CHLG,         // Challenger Approaching
89    MJRKIND_CLSCEND,      //
90    MJRKIND_ADVEND,       //
91    MJRKIND_ALLSTAREND,   //
92    MJRKIND_OP,           //
93    MJRKIND_VIS,          // Visual Scene (cutscene)
94    MJRKIND_DBGEND,       // Debug 1P Ending
95    MJRKIND_TOURN,        //
96    MJRKIND_TRAIN,        //
97    MJRKIND_VSTINY,       //
98    MJRKIND_VSGIANT,      //
99    MJRKIND_VSSTAMINA,    //
100    MJRKIND_HOMERUN,      //
101    MJRKIND_10MAN,        //
102    MJRKIND_100MAN,       //
103    MJRKIND_3MIN,         //
104    MJRKIND_15MIN,        //
105    MJRKIND_ENDLESS,      //
106    MJRKIND_CRUEL,        //
107    MJRKIND_PROG,         // Progressive prompt
108    MJRKIND_BOOT,         //
109    MJRKIND_CARD,         // Memcard prompt
110    MJRKIND_VSFIXEDCAM,   //
111    MJRKIND_EVENT,        //
112    MJRKIND_VSSNGLBTN,    //
113    MJRKIND_NULL,         // terminator
114} MajorKind;
115
116struct MajorSceneDesc
117{
118    u8 is_preload;
119    s8 major_id;
120    void (*cb_Load)();
121    void (*cb_Exit)();
122    void (*cb_Boot)();
123    MinorScene *minor_scene_arr; // array of minor scenes
124    char *file_name;             // m-ex specific, name of the file containing major scene code
125};
126
127struct MinorSceneDesc
128{
129    s8 id;
130    void (*cb_Think)();
131    void (*cb_Load)(void *data);
132    void (*cb_Exit)(void *data);
133    char *file_name; // m-ex specific, name of the file containing minor scene code
134};
135
136struct MinorScene
137{
138    s8 minor_id;        // is -1 for last entry
139    u8 heap_kind;       // heap behavior, (2)
140    void *minor_prep;   // inits data for this minor (major exclusive)
141    void *minor_decide; // decides next minor scene
142    u8 minor_kind;      // index for a re-useable list of scene functions. contains a load, think, and leave function.
143    void *load_data;    // points to static data used throughout this minor. other minors may use the same pointer to exchange data between minors
144    void *unload_data;  // points to static data used throughout this minor. other minors may use the same pointer to exchange data between minors
145};
146
147struct SceneInfo
148{
149    u8 major_curr; // 0x0
150    u8 major_next; // 0x1
151    u8 major_prev; // 0x2
152    u8 minor_curr; // 0x3
153    u8 minor_next; // 0x4
154    u8 minor_prev; // 0x5
155};
156
157struct ScDataVS // should really call this FightData... fight meaning the in-game scene
158{
159    u8 x8;                // 0x0
160    u8 x9;                // 0x1
161    u8 xa;                // 0x2
162    int xc;               // 0x4
163    MatchInit match_init; // 0x8
164};
165
166struct ScDataRst
167{
168    int x0;
169    int x4;
170    int x8;
171    MatchStandings match_standings; // 0xC
172    u8 unk[0x2278];                 // 0x?
173};
174
175struct ScDataIntro
176{
177    u8 x0;
178    u8 x1;
179    u8 x2;
180    u8 match_mode;       // 0x3
181    u8 x4;               //
182    u8 x5;               //
183    u8 x6;               //
184    u8 match_event_mode; // 0x7
185    u8 x8;               // 0x8
186    u8 nametag_idx;      // 0x9
187    u8 xa;
188    u8 left_num;
189    u8 right_num;
190    u8 p1_ckind;
191    u8 p2_ckind;
192    u8 p3_ckind;
193    u8 p4_ckind;
194    u8 p5_ckind;
195    u8 p6_ckind;
196    u8 p1_costume;
197    u8 p2_costume;
198    u8 p3_costume;
199    u8 p4_costume;
200    u8 p5_costume;
201    u8 p6_costume;
202};
203
204/*** Static Variables ***/
205static SceneInfo *stc_scene_info = (void *)0x80479D30;
206
207/*
208Scene Change Notes
209
210MinorThink: run Scene_ExitMinor to execute Scene_Decide
211SceneDecide: run either Scene_SetNextMinor to enter another minor, OR Scene_SetNextMajor then Scene_ExitMajor to enter another major
212*/
213
214u8 Scene_GetCurrentMajor();
215MajorSceneDesc *Scene_GetMajorSceneDesc();
216MinorSceneDesc *Scene_GetMinorSceneDesc();
217u8 Scene_GetCurrentMinor();
218void Scene_SetNextMajor(int major_id); // run this in scene decide!
219void Scene_ExitMajor();                // run this to cause a major scene change, usually ran in scene decide!
220void Scene_SetNextMinor(int minor_id); // run this in scene decide!
221void Scene_ExitMinor();                // run this to cause a minor scene change, usually ran in scene think!
222void CSS_DecideNext(MinorScene *minor_scene, ScDataVS *css_data);
223void CSS_ResetKOStars();
224void CSS_InitMajorData(ScDataVS *major_data);
225void CSS_InitMinorData(MinorScene *minor_scene, ScDataVS *major_data, int css_kind);
226void SSS_InitMinorData(MinorScene *minor_scene, ScDataVS *major_data);
227void SSS_DecideNext(MinorScene *minor_scene, ScDataVS *css_data, int exit_minor_id);
228void Match_InitMinorData(MinorScene *minor_scene, ScDataVS *major_data, void *init_cb, void *startmelee_cb);
229void Match_SetNametags(MatchInit *match_init);
230#endif