[Debloating] [th01] Resident structure: Don't copy out the BGM mode

Not worth it for the two places that use this variable.

Part of P0229, funded by Ember2528.
This commit is contained in:
nmlgc 2023-01-30 03:25:09 +01:00
parent 6737b24436
commit 29c1496b42
4 changed files with 2 additions and 8 deletions

View File

@ -37,7 +37,6 @@ void resident_create_and_stuff_set(
int resident_stuff_get(
int8_t& rank,
bgm_mode_t& bgm_mode,
int8_t& rem_bombs,
int8_t& credit_lives_extra,
unsigned long& rand,
@ -48,7 +47,6 @@ int resident_stuff_get(
if(sgm) {
resident = sgm;
rank = resident->rank;
bgm_mode = resident->bgm_mode;
rem_bombs = resident->rem_bombs;
credit_lives_extra = resident->credit_lives_extra;
rand = resident->rand;

View File

@ -12,7 +12,6 @@ void resident_create_and_stuff_set(
// Returns 0 on success, 1 on error.
int resident_stuff_get(
int8_t& rank,
bgm_mode_t& bgm_mode,
int8_t& rem_bombs,
int8_t& credit_lives_extra,
unsigned long& rand,

View File

@ -406,7 +406,6 @@ int __cdecl main(void)
}
if(resident_stuff_get(
rank,
bgm_mode,
bombs_extra_per_life_lost, // ZUN bloat: Supposed to be [rem_bombs]...
credit_lives_extra,
frame_rand,
@ -469,8 +468,7 @@ int __cdecl main(void)
}
}
// ZUN bloat: Unnecessary cast.
if(static_cast<int>(bgm_mode) == BGM_MODE_MDRV2) {
if(resident->bgm_mode == BGM_MODE_MDRV2) {
mdrv2_enable_if_board_installed();
}
scene_id = (
@ -500,7 +498,7 @@ int __cdecl main(void)
rem_bombs = resident->rem_bombs;
player_left = PLAYER_LEFT_START;
if((bgm_mode != BGM_MODE_OFF) && resident->snd_need_init) {
if((resident->bgm_mode != BGM_MODE_OFF) && resident->snd_need_init) {
mdrv2_bgm_load("init.mdt");
mdrv2_bgm_play();
mdrv2_se_load(SE_FN);

View File

@ -86,7 +86,6 @@ extern resident_t far *resident;
extern uint8_t rank;
#endif
extern bgm_mode_t bgm_mode;
extern int8_t rem_bombs;
extern int8_t credit_lives_extra;
extern end_sequence_t end_flag; /* ZUN symbol [Strings] */