#ifndef _ZX_CHARSET_H #define _ZX_CHARSET_H #include #include #define ZX81_CHARSET_LEN 64 #define ZX81_CHAR_TOKEN_LOW_START 0x40 #define ZX81_CHAR_TOKEN_LOW_END 0x42 #define ZX81_CHAR_TOKEN_HIGH_START 0xc0 #define ZX81_CHAR_TOKEN_HIGH_END 0xff #define ZX81_CHAR_LOW(c) \ (c < ZX81_CHARSET_LEN) #define ZX81_CHAR_INVERSE_START 0x80 #define ZX81_CHAR_INVERSE_END 0xbf #define ZX81_CHAR_INVERSE(c) \ (c >= ZX81_CHAR_INVERSE_START && c <= ZX81_CHAR_INVERSE_END) #define ZX81_CHAR_TOKEN_LOW(c) \ (c >= ZX81_CHAR_TOKEN_LOW_START && c <= ZX81_CHAR_TOKEN_LOW_END) #define ZX81_CHAR_NEWLINE(c) \ (c == 0x76) #define ZX81_CHAR_TOKEN_HIGH(c) \ (c >= 0xc0) #define ZX81_CHAR_TOKEN(c) \ (ZX81_CHAR_TOKEN_LOW(c) || ZX81_CHAR_TOKEN_HIGH(c)) #define ZX81_CHAR_TOKEN_INTEGRAL(c) \ (c == 0x0e) #define ZX81_CHAR_TOKEN_FLOAT(c) \ (c == 0x7e) extern uint32_t zx81_charset[ZX81_CHARSET_LEN]; int zx81_fputc(uint8_t c, int inverse, FILE *stream); #endif /* _ZX_CHARSET_H */