mirror of https://github.com/nmlgc/ReC98.git
[Maintenance] [th01] Text mode functions: ZUN's proprietary attribute bits
Again (2113031
), very helpful for debugging.
Part of P0207, funded by GhostPhanom.
This commit is contained in:
parent
cfea4971ee
commit
e5ca2928d2
|
@ -121,25 +121,25 @@ void z_text_putsa(tram_x_t x, tram_y_t y, int z_atrb, const char *str)
|
|||
#define tx_chars(byte) ((char*)MK_FP(0xA000, p + byte))
|
||||
#define tx_atrbs(byte) ((int16_t*)MK_FP(0xA200, p + byte))
|
||||
|
||||
if(z_atrb & 1) {
|
||||
if(z_atrb & Z_ATRB_BLUE) {
|
||||
hw_atrb += 0x20;
|
||||
}
|
||||
if(z_atrb & 4) {
|
||||
if(z_atrb & Z_ATRB_RED) {
|
||||
hw_atrb += 0x40;
|
||||
}
|
||||
if(z_atrb & 2) {
|
||||
if(z_atrb & Z_ATRB_GREEN) {
|
||||
hw_atrb += 0x80;
|
||||
}
|
||||
if(z_atrb & 0x800) {
|
||||
if(z_atrb & Z_ATRB_VLINE) {
|
||||
hw_atrb += 0x10;
|
||||
}
|
||||
if(z_atrb & 0x400) {
|
||||
if(z_atrb & Z_ATRB_UNDERLINE) {
|
||||
hw_atrb += TX_UNDERLINE;
|
||||
}
|
||||
if(z_atrb & 0x200) {
|
||||
if(z_atrb & Z_ATRB_REVERSE) {
|
||||
hw_atrb += TX_REVERSE;
|
||||
}
|
||||
if(z_atrb & 0x100) {
|
||||
if(z_atrb & Z_ATRB_BLINK) {
|
||||
hw_atrb += TX_BLINK;
|
||||
}
|
||||
hw_atrb += hw_atrb << 8;
|
||||
|
|
|
@ -9,6 +9,20 @@ typedef enum {
|
|||
_z_text_cursor_t_FORCE_UINT16 = 0xFFFF
|
||||
} z_text_cursor_t;
|
||||
|
||||
// Attribute bits for z_text_vputsa(), completely differing from the PC-98
|
||||
// hardware text attribute bits.
|
||||
#define Z_ATRB_BLUE 0x1
|
||||
#define Z_ATRB_GREEN 0x2
|
||||
#define Z_ATRB_RED 0x4
|
||||
#define Z_ATRB_CYAN (Z_ATRB_BLUE | Z_ATRB_GREEN)
|
||||
#define Z_ATRB_MAGENTA (Z_ATRB_BLUE | Z_ATRB_RED)
|
||||
#define Z_ATRB_YELLOW (Z_ATRB_GREEN | Z_ATRB_RED)
|
||||
#define Z_ATRB_WHITE (Z_ATRB_BLUE | Z_ATRB_GREEN | Z_ATRB_RED)
|
||||
#define Z_ATRB_BLINK 0x100
|
||||
#define Z_ATRB_REVERSE 0x200
|
||||
#define Z_ATRB_UNDERLINE 0x400
|
||||
#define Z_ATRB_VLINE 0x800
|
||||
|
||||
void z_text_init(void);
|
||||
void z_text_25line(void);
|
||||
void z_text_20line(void);
|
||||
|
|
Loading…
Reference in New Issue