Skip to content

Commit ebae23d

Browse files
committed
Bodyprog: trim suffixes
1 parent 39fea3f commit ebae23d

File tree

117 files changed

+1352
-1349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1352
-1349
lines changed

configs/JAP0/sym.bodyprog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ Fs_CharaAnimBoneInfoUpdate = 0x8003536C; // type:func
380380
//--- PA: 0x0108F0 VA: 0x80035450 subsegment: c, game_boot/background_sound_init
381381
//----------------------------------------------------------------------------------
382382
Bgm_Init = 0x80035450; // type:func
383-
Bgm_IsCurrentBgmTargetCheck = 0x80035578; // type:func
383+
Bgm_ActiveBgmTrackCheck = 0x80035578; // type:func
384384
Bgm_TrackSet = 0x800355AC; // type:func
385-
Bgm_BgmChannelSet = 0x800355F4; // type:func
385+
Bgm_ChannelSet = 0x800355F4; // type:func
386386
func_8003596C = 0x8003563C; // type:func
387387
Sd_AmbientSfxInit = 0x8003566C; // type:func
388388
Sd_IsCurrentAmbientTargetCheck = 0x80035780; // type:func

configs/JAP1/sym.bodyprog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ Fs_CharaAnimBoneInfoUpdate = 0x80035410; // type:func
438438
//--- PA: 0x010994 VA: 0x800354F4 subsegment: c, game_boot/background_sound_init
439439
//----------------------------------------------------------------------------------
440440
Bgm_Init = 0x800354F4; // type:func
441-
Bgm_IsCurrentBgmTargetCheck = 0x8003561C; // type:func
441+
Bgm_ActiveBgmTrackCheck = 0x8003561C; // type:func
442442
Bgm_TrackSet = 0x80035650; // type:func
443-
Bgm_BgmChannelSet = 0x80035698; // type:func
443+
Bgm_ChannelSet = 0x80035698; // type:func
444444
func_8003596C = 0x800356E0; // type:func
445445
Sd_AmbientSfxInit = 0x80035710; // type:func
446446
Sd_IsCurrentAmbientTargetCheck = 0x80035824; // type:func

configs/USA/sym.bodyprog.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ Fs_CharaAnimBoneInfoUpdate = 0x8003569C; // type:func
256256
//--- PA: 0x010C20 VA: 0x80035780 subsegment: c, game_boot/background_sound_init
257257
//----------------------------------------------------------------------------------
258258
Bgm_Init = 0x80035780; // type:func
259-
Bgm_IsCurrentBgmTargetCheck = 0x800358A8; // type:func
259+
Bgm_ActiveBgmTrackCheck = 0x800358A8; // type:func
260260
Bgm_TrackSet = 0x800358DC; // type:func
261-
Bgm_BgmChannelSet = 0x80035924; // type:func
261+
Bgm_ChannelSet = 0x80035924; // type:func
262262
func_8003596C = 0x8003596C; // type:func
263263
Sd_AmbientSfxInit = 0x8003599C; // type:func
264264
Sd_IsCurrentAmbientTargetCheck = 0x80035AB0; // type:func

include/bodyprog/bodyprog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ typedef struct _WaterZone
11971197

11981198
typedef struct
11991199
{
1200-
u8 charaId_0; /** `e_CharacterId` */
1200+
u8 charaId; /** `e_CharacterId` */
12011201
u8 isLoaded_1; /** `bool` */
12021202
// 2 bytes of padding.
12031203
s32 queueIdx_4;

include/bodyprog/demo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef enum _DemoState
2525
/** @brief Initial demo game state data, stored inside `MISC/DEMO****.DAT` files. */
2626
typedef struct _DemoWork
2727
{
28-
s_SaveUserConfig config_0;
28+
s_SaveUserConfig config;
2929
u8 unk_38[200];
3030
s_Savegame savegame_100;
3131
u8 unk_37C[1148];
@@ -38,7 +38,7 @@ STATIC_ASSERT_SIZEOF(s_DemoWork, 2048);
3838
typedef struct _DemoFrameData
3939
{
4040
s_AnalogController analogController_0;
41-
s8 gameStateExpected_8; /** Expected value of `g_GameWork.gameState_594` before `analogController_0` is processed, if it doesn't match `Demo_Update` will display `STEP ERROR` and stop reading demo. */
41+
s8 gameStateExpected_8; /** Expected value of `g_GameWork.gameState` before `analogController_0` is processed, if it doesn't match `Demo_Update` will display `STEP ERROR` and stop reading demo. */
4242
u8 videoPresentInterval_9;
4343
s8 unk_A[2];
4444
u32 randSeed_C;

include/bodyprog/game_boot/background_sound_init.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
#ifndef _BODYPROG_GAMEBOOT_BACKGROUND_SOUND_INIT_H
2-
#define _BODYPROG_GAMEBOOT_BACKGROUND_SOUND_INIT_H
1+
#ifndef _BODYPROG_GAMEBOOT_BACKGROUNDSOUNDINIT_H
2+
#define _BODYPROG_GAMEBOOT_BACKGROUNDSOUNDINIT_H
33

44
s32 Bgm_Init(void);
55

6-
/** @brief Checks if currently assigned song is the same as target. */
7-
bool Bgm_IsCurrentBgmTargetCheck(s32 bgmIdx);
6+
/** @brief Checks if a given background music track is not currently playing.
7+
*
8+
* @param bgmIdx Index of the background music track to check.
9+
* @return `true` if the given track is not currently playing, `false` otherwise.
10+
*/
11+
bool Bgm_ActiveBgmTrackCheck(s32 bgmIdx);
812

913
void Bgm_TrackSet(s32 bgmIdx);
1014

1115
/** Executes sound command. */
12-
void Bgm_BgmChannelSet(void);
16+
void Bgm_ChannelSet(void);
1317

1418
void func_8003596C(void);
1519

1620
bool Sd_AmbientSfxInit(void);
1721

18-
bool Sd_IsCurrentAmbientTargetCheck(s32 ambIdx);
22+
bool Sd_IsCurrentAmbientTargetCheck(s32 ambientIdx);
1923

2024
void Sd_AmbientSfxSet(s32 idx);
2125

include/bodyprog/game_boot/game_load.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
void Anim_CharaTypeAnimInfoClear(void);
77

8-
/** Handles `g_GameWork.gameStateStep_598[0]`.
8+
/** Handles `g_GameWork.gameStateSteps[0]`.
99
* Used to handle map loading and room changes.
1010
*/
1111
void GameBoot_GameStartup(void);

include/bodyprog/memcard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ STATIC_ASSERT_SIZEOF(s_Savegame_Container, 640);
290290
/** @brief Contains `s_SaveUserConfig` data padded to 128 bytes with a footer at the end containing checksum + magic. */
291291
typedef struct _SaveUserConfigContainer
292292
{
293-
s_SaveUserConfig config_0;
293+
s_SaveUserConfig config;
294294
u8 pad_38[68];
295295
s_Savegame_Footer footer_7C;
296296
} s_Savegame_UserConfigs;

include/game.h

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -487,15 +487,15 @@ typedef enum _PaperMapIdx
487487
// Temp name. Related to music.
488488
typedef 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

11421142
typedef 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;
11671167
STATIC_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. */
11711170
typedef 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;
12001199
STATIC_ASSERT_SIZEOF(s_GameWork, 1496);
12011200

@@ -1236,7 +1235,7 @@ STATIC_ASSERT_SIZEOF(s_ModelAnim, 20);
12361235
/** @brief Character model. */
12371236
typedef 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.

include/maps/shared/Map_RoomBgmInit_0_s02_CondFalse.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void Map_RoomBgmInit_CondFalse(void)
6060
break;
6161

6262
case 18:
63-
layerLimits = g_GameWork.bgmTrackIdx_5B2 == 7 ? sharedData_800CFB34_0_s02 : sharedData_800CFB3C_0_s02;
63+
layerLimits = g_GameWork.bgmIdx == 7 ? sharedData_800CFB34_0_s02 : sharedData_800CFB3C_0_s02;
6464

6565
if (Savegame_EventFlagGet(EventFlag_379))
6666
{
@@ -92,7 +92,7 @@ void Map_RoomBgmInit_CondFalse(void)
9292
case 7:
9393
case 8:
9494
case 9:
95-
if (g_GameWork.bgmTrackIdx_5B2 == 34)
95+
if (g_GameWork.bgmIdx == 34)
9696
{
9797
if (Savegame_EventFlagGet(EventFlag_391))
9898
{
@@ -122,7 +122,7 @@ void Map_RoomBgmInit_CondFalse(void)
122122

123123
case 19:
124124
case 20:
125-
if (g_GameWork.bgmTrackIdx_5B2 == 23)
125+
if (g_GameWork.bgmIdx == 23)
126126
{
127127
layerLimits = sharedData_800CFB4C_0_s02;
128128
fadeSpeed = Q12(0.25f);

0 commit comments

Comments
 (0)