[Maintenance] [th04/th05] Declare a little-endian BCD score type

Only in C land though; doing the same in ASM land actually makes digit
accesses harder to read.

Part of P0065, funded by Touhou Patch Center.
This commit is contained in:
nmlgc 2020-01-01 21:17:50 +01:00
parent 23ea2d4bee
commit c3a9816e60
3 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#include "th02/score.h"
#include "th04/score.h"
#if GAME == 5
# define SCOREDAT_PLACES 5
@ -14,9 +14,10 @@
#define SCOREDAT_NAME_LEN 8
#pragma option -a1
typedef struct {
unsigned char g_name[SCOREDAT_PLACES][SCOREDAT_NAME_LEN + 1];
unsigned char g_points[SCOREDAT_PLACES][SCORE_DIGITS];
score_lebcd_t g_points[SCOREDAT_PLACES];
#if GAME == 5
unsigned char g_stage[SCOREDAT_PLACES];
@ -29,6 +30,7 @@ typedef struct {
unsigned char unused_2[SCOREDAT_PLACES];
#endif
} scoredat_t;
#pragma option -a.
typedef struct {
int8_t key1;

View File

@ -1 +1,8 @@
#include "th02/score.h"
typedef union {
unsigned char continues_used;
unsigned char digits[SCORE_DIGITS];
} score_lebcd_t;
extern unsigned char extends_gained;

View File

@ -32,6 +32,7 @@ int pascal far select_for_rank(
/// Player
/// ------
#include "th04/player/player.h"
#include "th04/score.h"
/// ------
/// Stages