@@ -487,15 +487,15 @@ typedef enum _PaperMapIdx
487487// Temp name. Related to music.
488488typedef enum _SysFlags
489489{
490- SysFlag_None = 0 ,
491- SysFlag_Freeze = 1 << 0 ,
492- SysFlag_1 = 1 << 1 ,
493- SysFlag_2 = 1 << 2 ,
494- SysFlag_3 = 1 << 3 ,
495- SysFlag_4 = 1 << 4 ,
496- SysFlag_5 = 1 << 5 ,
497- SysFlag_6 = 1 << 6 ,
498- SysFlag_Mute = 1 << 7
490+ SysFlag_None = 0 ,
491+ SysFlag_Pause = 1 << 0 ,
492+ SysFlag_1 = 1 << 1 ,
493+ SysFlag_2 = 1 << 2 ,
494+ SysFlag_3 = 1 << 3 ,
495+ SysFlag_4 = 1 << 4 ,
496+ SysFlag_5 = 1 << 5 ,
497+ SysFlag_6 = 1 << 6 ,
498+ SysFlag_Mute = 1 << 7
499499} e_SysFlags ;
500500
501501// Temp name.
@@ -1141,7 +1141,7 @@ STATIC_ASSERT_SIZEOF(s_EventData, 12);
11411141
11421142typedef struct _SaveUserConfig
11431143{
1144- s_ControllerConfig controllerConfig_0 ;
1144+ s_ControllerConfig controllerConfig ;
11451145 s8 optScreenPosX_1C ; /** Range: [-11, 11], default: 0. */
11461146 s8 optScreenPosY_1D ; /** Range: [-8, 8], default: 0. */
11471147 u8 optSoundType_1E ; /** `bool` | Stereo: `false`, Monaural: `true`, default: Stereo. */
@@ -1152,7 +1152,7 @@ typedef struct _SaveUserConfig
11521152 u8 optExtraWeaponCtrl_23 ; /** `bool` | Switch: `false`, Press: `true`, default: Press. */
11531153 u8 optExtraBloodColor_24 ; /** `e_BloodColor` | Default: Normal. */
11541154 s8 optAutoLoad_25 ; /** `bool` | Off: `false`, On: `true`, default: Off. */
1155- u8 unk_26 ;
1155+ u8 unk_26 ; // Padding.
11561156 u8 optExtraOptionsEnabled_27 ; /** Holds unlocked option flags. */
11571157 s8 optExtraViewCtrl_28 ; /** `bool` | Normal: `false`, Reverse: `true`, default: Normal. */
11581158 s8 optExtraViewMode_29 ; /** `bool` | Normal: `false`, Self View: `true`, default: Normal. */
@@ -1166,36 +1166,35 @@ typedef struct _SaveUserConfig
11661166} s_SaveUserConfig ;
11671167STATIC_ASSERT_SIZEOF (s_SaveUserConfig , 56 );
11681168
1169- /** @brief Game workspace. Stores miscellaneous gameplay-related data.
1170- */
1169+ /** @brief Game workspace. Stores miscellaneous gameplay-related data. */
11711170typedef struct _GameWork
11721171{
1173- s_SaveUserConfig config_0 ;
1174- s_ControllerData controllers_38 [CONTROLLER_COUNT_MAX ];
1175- s_Savegame autosave_90 ;
1176- s_Savegame savegame_30C ;
1177- u16 gsScreenWidth_588 ;
1178- u16 gsScreenHeight_58A ;
1179- s_PrimColor background2dColor_58C ;
1180- e_GameState gameStatePrev_590 ;
1181- e_GameState gameState_594 ;
1182- s32 gameStateStep_598 [3 ]; /** Temp data used by current `gameState`. Can be another state ID or other data.
1183- * This states could be sub-states for specific events of individual screens
1184- * because of the way it's normally used in menus. For example: in the settings
1185- * screen, [0] is used to define what option the player has selected, and [1] is used
1186- * during specific settings screens, such as the position screen or the brightness screen.
1187- *
1188- * [2] is likely rarely used or maybe only used during maps.
1189- */
1190- s8 unk_5A4 [4 ];
1191- s32 field_5A8 ;
1192- s32 field_5AC ;
1193- s8 unk_5B0 ;
1194- s8 mapAnimIdx_5B1 ;
1195- s8 bgmTrackIdx_5B2 ; /** `BgmTrackIdx` | Currently player background music track. */
1196- s8 ambientIdx_5B4 ; // Index of `g_AmbientVabTaskLoadCmds`.
1197- s_AnalogController rawController_5B4 ;
1198- s8 unused_5BC [28 ]; // @unused Debug data?
1172+ /* 0x0 */ s_SaveUserConfig config ;
1173+ /* 0x38 */ s_ControllerData controllers [CONTROLLER_COUNT_MAX ];
1174+ /* 0x90 */ s_Savegame autosave ;
1175+ /* 0x30C */ s_Savegame savegame ;
1176+ /* 0x588 */ u16 gsScreenWidth ;
1177+ /* 0x58A */ u16 gsScreenHeight ;
1178+ /* 0x58C */ s_PrimColor background2dColor ;
1179+ /* 0x590 */ e_GameState gameStatePrev ;
1180+ /* 0x594 */ e_GameState gameState ;
1181+ /* 0x598 */ s32 gameStateSteps [3 ]; /** Sub-state steps used by the current `gameState`. Can other state IDs or data.
1182+ * This states could be sub-states for specific events of individual screens
1183+ * because of the way it's normally used in menus. For example: in the settings
1184+ * screen, [0] is used to define what option the player has selected, and [1] is used
1185+ * during specific settings screens, such as the position screen or the brightness screen.
1186+ *
1187+ * [2] is likely rarely used or maybe only used during maps.
1188+ */
1189+ /* 0x5A4 */ s8 unk_5A4 [4 ]; // Padding?
1190+ /* 0x5A8 */ s32 field_5A8 ;
1191+ /* 0x5AC */ s32 field_5AC ;
1192+ /* 0x5B0 */ s8 unk_5B0 ; // Padding?
1193+ /* 0x5B1 */ s8 mapAnimIdx ;
1194+ /* 0x5B2 */ s8 bgmIdx ; /** `BgmTrackIdx` | Currently player background music track. */
1195+ /* 0x5B4 */ s8 ambientIdx ; /** Index of `g_AmbientVabTaskLoadCmds`. */
1196+ /* 0x5B4 */ s_AnalogController rawController ;
1197+ /* 0x5BC */ s8 unused_5BC [28 ]; // @unused Debug data?
11991198} s_GameWork ;
12001199STATIC_ASSERT_SIZEOF (s_GameWork , 1496 );
12011200
@@ -1236,7 +1235,7 @@ STATIC_ASSERT_SIZEOF(s_ModelAnim, 20);
12361235/** @brief Character model. */
12371236typedef struct _Model
12381237{
1239- /* 0x0 */ s8 charaId_0 ; /** `e_CharacterId` TODO: Trim suffix. Not yet as another struct has the same field. */
1238+ /* 0x0 */ s8 charaId ; /** `e_CharacterId` */
12401239 /* 0x1 */ u8 paletteIdx ; /** Changes the texture palette index for this model. */
12411240 /* 0x2 */ u8 controlState ; /** Active character control state. */
12421241 /* 0x3 */ u8 stateStep ; // Step number or temp data for the current `controlState`? In `s_PlayerExtra` always 1, set to 0 for 1 tick when anim state appears to change.
@@ -2103,21 +2102,21 @@ static inline void Game_StateSetNext_ClearStateSteps(e_GameState gameState)
21032102{
21042103 e_GameState prevState ;
21052104
2106- prevState = g_GameWork .gameState_594 ;
2105+ prevState = g_GameWork .gameState ;
21072106
2108- g_GameWork .gameState_594 = gameState ;
2107+ g_GameWork .gameState = gameState ;
21092108 g_SysWork .counters_1C [0 ] = 0 ;
21102109 g_SysWork .counters_1C [1 ] = 0 ;
2111- g_GameWork .gameStateStep_598 [1 ] = 0 ;
2112- g_GameWork .gameStateStep_598 [2 ] = 0 ;
2110+ g_GameWork .gameStateSteps [1 ] = 0 ;
2111+ g_GameWork .gameStateSteps [2 ] = 0 ;
21132112
21142113 SysWork_StateSetNext (SysState_Gameplay );
21152114
2116- g_GameWork .gameStateStep_598 [1 ] = 0 ;
2117- g_GameWork .gameStateStep_598 [2 ] = 0 ;
2118- g_GameWork .gameStateStep_598 [0 ] = prevState ;
2119- g_GameWork .gameStatePrev_590 = prevState ;
2120- g_GameWork .gameStateStep_598 [0 ] = 0 ;
2115+ g_GameWork .gameStateSteps [1 ] = 0 ;
2116+ g_GameWork .gameStateSteps [2 ] = 0 ;
2117+ g_GameWork .gameStateSteps [0 ] = prevState ;
2118+ g_GameWork .gameStatePrev = prevState ;
2119+ g_GameWork .gameStateSteps [0 ] = 0 ;
21212120}
21222121
21232122/** @brief Sets the GameState to be used in the next game update.
@@ -2127,19 +2126,19 @@ static inline void Game_StateSetNext(e_GameState gameState)
21272126{
21282127 e_GameState prevState ;
21292128
2130- prevState = g_GameWork .gameState_594 ;
2129+ prevState = g_GameWork .gameState ;
21312130
2132- g_GameWork .gameState_594 = gameState ;
2131+ g_GameWork .gameState = gameState ;
21332132 g_SysWork .counters_1C [0 ] = 0 ;
21342133 g_SysWork .counters_1C [1 ] = 0 ;
2135- g_GameWork .gameStateStep_598 [1 ] = 0 ;
2136- g_GameWork .gameStateStep_598 [2 ] = 0 ;
2134+ g_GameWork .gameStateSteps [1 ] = 0 ;
2135+ g_GameWork .gameStateSteps [2 ] = 0 ;
21372136
21382137 SysWork_StateSetNext (SysState_Gameplay );
21392138
2140- g_GameWork .gameStateStep_598 [0 ] = prevState ;
2141- g_GameWork .gameStatePrev_590 = prevState ;
2142- g_GameWork .gameStateStep_598 [0 ] = 0 ;
2139+ g_GameWork .gameStateSteps [0 ] = prevState ;
2140+ g_GameWork .gameStatePrev = prevState ;
2141+ g_GameWork .gameStateSteps [0 ] = 0 ;
21432142}
21442143
21452144/** @brief Returns the GameState to the previously used state.
@@ -2149,19 +2148,19 @@ static inline void Game_StateSetPrevious()
21492148{
21502149 e_GameState prevState ;
21512150
2152- prevState = g_GameWork .gameState_594 ;
2151+ prevState = g_GameWork .gameState ;
21532152
21542153 g_SysWork .counters_1C [0 ] = 0 ;
21552154 g_SysWork .counters_1C [1 ] = 0 ;
2156- g_GameWork .gameStateStep_598 [1 ] = 0 ;
2157- g_GameWork .gameStateStep_598 [2 ] = 0 ;
2155+ g_GameWork .gameStateSteps [1 ] = 0 ;
2156+ g_GameWork .gameStateSteps [2 ] = 0 ;
21582157
21592158 SysWork_StateSetNext (SysState_Gameplay );
21602159
2161- g_GameWork .gameStateStep_598 [0 ] = prevState ;
2162- g_GameWork .gameState_594 = g_GameWork .gameStatePrev_590 ;
2163- g_GameWork .gameStatePrev_590 = prevState ;
2164- g_GameWork .gameStateStep_598 [0 ] = 0 ;
2160+ g_GameWork .gameStateSteps [0 ] = prevState ;
2161+ g_GameWork .gameState = g_GameWork .gameStatePrev ;
2162+ g_GameWork .gameStatePrev = prevState ;
2163+ g_GameWork .gameStateSteps [0 ] = 0 ;
21652164}
21662165
21672166/** @brief Gets an event flag state from the savegame event flags array.
0 commit comments