zxdump/include/zx/charset.h
2023-09-13 14:40:48 -04:00

40 lines
870 B
C

#ifndef _ZX_CHARSET_H
#define _ZX_CHARSET_H
#include <stdio.h>
#include <inttypes.h>
#define ZX81_CHARSET_LEN 64
#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 */