[Debloating] [th01] Resident structure: Remove redundant total continue count

Keeping the structure layout for now though, since hacking resident
structures from DOS is a thing.

Part of P0229, funded by Ember2528.
This commit is contained in:
nmlgc 2023-01-30 02:54:11 +01:00
parent 6797cafe3d
commit 6737b24436
8 changed files with 1 additions and 22 deletions

View File

@ -23,7 +23,6 @@ void resident_create_and_stuff_set(
sgm = ResData<resident_t>::create(RES_ID);
resident = sgm;
resident->stage_id = 0;
resident->continues_total = 0;
}
if(sgm) {
resident = sgm;
@ -42,7 +41,6 @@ int resident_stuff_get(
int8_t& rem_bombs,
int8_t& credit_lives_extra,
unsigned long& rand,
int32_t& continues_total,
int& stage_id
)
{
@ -54,7 +52,6 @@ int resident_stuff_get(
rem_bombs = resident->rem_bombs;
credit_lives_extra = resident->credit_lives_extra;
rand = resident->rand;
continues_total = resident->continues_total;
stage_id = resident->stage_id;
return 0;
}

View File

@ -16,7 +16,6 @@ int resident_stuff_get(
int8_t& rem_bombs,
int8_t& credit_lives_extra,
unsigned long& rand,
int32_t& continues_total,
int& stage_id
);

View File

@ -49,7 +49,6 @@ bool16 end_init(void)
random_seed = resident->rand;
credit_lives_extra = resident->credit_lives_extra;
resident->score = 0;
resident->continues_total = 0;
resident->score_highest = 0;
} else {
puts("ERROR : end_flag is not ture !!");
@ -69,7 +68,6 @@ bool16 end_resident_clear(void)
if(sgm) {
resident_t* resident = sgm;
resident->score = 0;
resident->continues_total = 0;
resident->end_flag = ES_NONE;
resident->score_highest = 0;
for(i = 0; i < SCENE_COUNT; i++) {

View File

@ -525,10 +525,6 @@ void totle_animate(int stage_num)
input_shot = true;
input_ok = true;
resident->continues_per_scene[(stage_num / STAGES_PER_SCENE) - 1] = (
continues_total
);
while((input_shot == true) && (input_ok == true)) {
input_sense(false);
}

View File

@ -245,7 +245,6 @@ bool16 continue_menu(void)
no_continue:
player_is_hit = false;
paused = false;
continues_total = 0;
mdrv2_bgm_stop();
return false;
}

View File

@ -75,7 +75,6 @@ int8_t credit_lives_extra = CFG_CREDIT_LIVES_EXTRA_DEFAULT;
int rem_lives = 4;
unsigned long frame_rand;
uscore_t score = 0;
long continues_total = 0;
// ------------------------------------------------------------
#include "th01/hardware/input_mf.cpp"
@ -411,7 +410,6 @@ int __cdecl main(void)
bombs_extra_per_life_lost, // ZUN bloat: Supposed to be [rem_bombs]...
credit_lives_extra,
frame_rand,
continues_total,
stage_id
) == 1) {
error_resident_invalid();
@ -540,7 +538,6 @@ int __cdecl main(void)
resident->stage_id = stage_id;
resident->score = score;
resident->continues_total = continues_total;
Pellets.unput_and_reset();
Shots.unput_and_reset();

View File

@ -364,7 +364,6 @@ void start_game(bool new_game)
resident->bonus_per_stage[i] = 0;
}
resident->score_highest = 0;
resident->continues_total = 0;
resident->end_flag = ES_NONE;
}

View File

@ -62,11 +62,7 @@ typedef struct {
pellet_speed_t pellet_speed;
unsigned long rand;
score_t score;
// ZUN bloat: Never actually read from. Even FUUIN.EXE, who does care
// about this value, manually derives it from [continues_per_scene].
int32_t continues_total;
int32_t unused_3;
uint16_t continues_per_scene[SCENE_COUNT];
// of the current scene, without the boss stage
@ -114,8 +110,6 @@ extern int32_t continues_per_scene[SCENE_COUNT];
extern score_t score_highest;
inline void resident_continue_use(void) {
resident->continues_total++;
continues_total++;
resident->continues_per_scene[resident->stage_id / STAGES_PER_SCENE]++;
}
// ------------------------------------------------------------