2024-05-25 18:17:04 +00:00
|
|
|
#include "th01/main/bullet/pellet_s.hpp"
|
2022-08-15 07:42:57 +00:00
|
|
|
#include "th01/common.h"
|
2024-05-24 21:52:39 +00:00
|
|
|
#include "th01/score.h"
|
2022-08-15 07:42:57 +00:00
|
|
|
|
2022-08-15 07:50:42 +00:00
|
|
|
enum bgm_mode_t {
|
|
|
|
BGM_MODE_OFF,
|
|
|
|
BGM_MODE_MDRV2,
|
|
|
|
BGM_MODE_COUNT,
|
|
|
|
};
|
|
|
|
|
2022-08-15 10:03:33 +00:00
|
|
|
#define BGM_MODES_CENTERED { \
|
|
|
|
" OFF ", \
|
|
|
|
" FM ", \
|
|
|
|
}
|
|
|
|
|
2021-12-25 15:18:17 +00:00
|
|
|
typedef enum {
|
|
|
|
ROUTE_MAKAI,
|
|
|
|
ROUTE_JIGOKU,
|
|
|
|
ROUTE_COUNT,
|
2022-08-14 05:41:03 +00:00
|
|
|
|
|
|
|
_route_t_FORCE_INT16 = 0x7FFF
|
2021-12-25 15:18:17 +00:00
|
|
|
} route_t;
|
|
|
|
|
2022-05-29 23:45:47 +00:00
|
|
|
enum end_sequence_t {
|
|
|
|
ES_NONE,
|
|
|
|
ES_MAKAI,
|
|
|
|
ES_JIGOKU,
|
|
|
|
};
|
|
|
|
|
2021-12-25 15:18:17 +00:00
|
|
|
enum debug_mode_t {
|
|
|
|
DM_OFF = 0,
|
|
|
|
DM_TEST = 1,
|
2022-08-14 05:41:03 +00:00
|
|
|
DM_FULL = 3,
|
|
|
|
|
|
|
|
_debug_mode_t_FORCE_INT16 = 0x7FFF
|
2021-12-25 15:18:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define RES_ID "ReiidenConfig"
|
2024-01-17 08:03:39 +00:00
|
|
|
struct resident_t {
|
2021-12-25 15:18:17 +00:00
|
|
|
char id[sizeof(RES_ID)];
|
2022-08-14 05:41:03 +00:00
|
|
|
int8_t rank;
|
2022-08-15 07:50:42 +00:00
|
|
|
bgm_mode_t bgm_mode;
|
2023-02-05 03:32:10 +00:00
|
|
|
int8_t rem_bombs;
|
2023-02-04 20:35:26 +00:00
|
|
|
int8_t credit_lives_extra; // Add 2 for the actual number of lives
|
2022-05-29 23:45:47 +00:00
|
|
|
end_sequence_t end_flag; /* ZUN symbol [Strings] */
|
2022-08-14 05:41:03 +00:00
|
|
|
int8_t unused_1;
|
|
|
|
int8_t route; // ACTUAL TYPE: route_t
|
|
|
|
int8_t rem_lives;
|
|
|
|
int8_t snd_need_init; // ACTUAL TYPE: bool
|
|
|
|
int8_t unused_2;
|
|
|
|
int8_t debug_mode; // ACTUAL TYPE: debug_mode_t
|
2021-12-25 15:18:17 +00:00
|
|
|
pellet_speed_t pellet_speed;
|
2022-08-14 05:41:03 +00:00
|
|
|
unsigned long rand;
|
2023-02-01 03:29:07 +00:00
|
|
|
score_t score;
|
2022-08-11 00:02:09 +00:00
|
|
|
|
|
|
|
// ZUN bloat: Never actually read from. Even FUUIN.EXE, who does care
|
|
|
|
// about this value, manually derives it from [continues_per_scene].
|
2023-01-31 02:43:24 +00:00
|
|
|
int32_t continues_total;
|
2022-08-11 00:02:09 +00:00
|
|
|
|
2023-01-31 02:43:24 +00:00
|
|
|
uint16_t continues_per_scene[SCENE_COUNT];
|
2021-12-25 15:18:17 +00:00
|
|
|
|
|
|
|
// of the current scene, without the boss stage
|
2023-02-01 03:29:07 +00:00
|
|
|
score_t bonus_per_stage[STAGES_PER_SCENE - 1];
|
2021-12-25 15:18:17 +00:00
|
|
|
|
2022-08-12 14:41:02 +00:00
|
|
|
unsigned int stage_id;
|
2021-12-25 15:18:17 +00:00
|
|
|
unsigned long hiscore;
|
2023-02-01 03:29:07 +00:00
|
|
|
score_t score_highest; // among all continues
|
2021-12-25 15:18:17 +00:00
|
|
|
uint16_t point_value;
|
2024-01-17 08:03:39 +00:00
|
|
|
};
|
2021-12-25 15:18:17 +00:00
|
|
|
|
2023-02-05 06:14:31 +00:00
|
|
|
extern resident_t far *resident;
|
|
|
|
|
|
|
|
// Redundant copies of resident structure fields to static data
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
|
|
|
|
// ACTUAL TYPE: rank_t
|
|
|
|
#if (BINARY == 'M')
|
|
|
|
extern int8_t rank;
|
|
|
|
#elif (BINARY == 'E')
|
|
|
|
extern uint8_t rank;
|
|
|
|
#endif
|
2022-08-11 19:33:36 +00:00
|
|
|
|
2023-02-05 06:14:31 +00:00
|
|
|
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] */
|
2022-08-14 05:41:03 +00:00
|
|
|
extern int8_t route; // ACTUAL TYPE: route_t
|
2023-02-05 06:14:31 +00:00
|
|
|
extern int rem_lives; // ZUN bloat: The resident structure just uses int8_t.
|
|
|
|
|
|
|
|
// Current gameplay frame plus resident_t::rand, without any frame_delay().
|
|
|
|
// Displayed as "rand" in the debug output, but can't be /* ZUN symbol */'d
|
|
|
|
// like that, due to obviously colliding with the C standard library function.
|
|
|
|
extern unsigned long frame_rand;
|
|
|
|
|
|
|
|
#if (BINARY == 'M')
|
|
|
|
extern uscore_t score;
|
|
|
|
#elif (BINARY == 'E')
|
|
|
|
extern score_t score;
|
|
|
|
#endif
|
|
|
|
extern int32_t continues_total;
|
|
|
|
|
|
|
|
// ZUN bloat: The resident structure just uses uint16_t.
|
|
|
|
extern int32_t continues_per_scene[SCENE_COUNT];
|
|
|
|
|
|
|
|
extern score_t score_highest;
|
2022-08-12 14:41:02 +00:00
|
|
|
|
|
|
|
inline void resident_continue_use(void) {
|
|
|
|
resident->continues_total++;
|
|
|
|
continues_total++;
|
|
|
|
resident->continues_per_scene[resident->stage_id / STAGES_PER_SCENE]++;
|
|
|
|
}
|
2023-02-05 06:14:31 +00:00
|
|
|
// ------------------------------------------------------------
|