4 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
15 * Revision 1.9 2008/02/20 19:25:09 james
16 * *** empty log message ***
18 * Revision 1.8 2008/02/13 09:12:21 james
19 * *** empty log message ***
21 * Revision 1.7 2008/02/13 01:08:18 james
22 * *** empty log message ***
24 * Revision 1.6 2008/02/07 13:22:51 james
25 * *** empty log message ***
27 * Revision 1.5 2008/02/07 12:41:06 james
28 * *** empty log message ***
30 * Revision 1.4 2008/02/07 12:16:04 james
31 * *** empty log message ***
33 * Revision 1.3 2008/02/06 11:30:37 james
34 * *** empty log message ***
36 * Revision 1.2 2008/02/04 20:23:55 james
37 * *** empty log message ***
39 * Revision 1.1 2008/02/03 23:31:25 james
40 * *** empty log message ***
50 #define CRT_CELS (CRT_ROWS*CRT_COLS)
51 #define CRT_ADDR(r,c) (((r)*CRT_COLS)+(c))
52 #define CRT_ADDR_POS(p) ((((p)->y)*CRT_COLS)+((p)->x))
54 #define CRT_ATTR_NORMAL 0x0
55 #define CRT_ATTR_UNDERLINE 0x1
56 #define CRT_ATTR_REVERSE 0x2
57 #define CRT_ATTR_BLINK 0x4
58 #define CRT_ATTR_BOLD 0x8
61 #define CRT_COLOR_BLACK 0x0
62 #define CRT_COLOR_RED 0x1
63 #define CRT_COLOR_GREEN 0x2
64 #define CRT_COLOR_YELLOW 0x3
65 #define CRT_COLOR_BLUE 0x4
66 #define CRT_COLOR_MAGENTA 0x5
67 #define CRT_COLOR_CYAN 0x6
68 #define CRT_COLOR_WHITE 0x7
69 #define CRT_COLOR_INTENSITY 0x8
71 #define CRT_COLOR_FG_MASK 0xf0
72 #define CRT_COLOR_FG_SHIFT 4
74 #define CRT_COLOR_BG_MASK 0xf
75 #define CRT_COLOR_BG_SHIFT 0
77 #define CRT_COLOR_BG(a) (((a) & CRT_COLOR_BG_MASK) >> CRT_COLOR_BG_SHIFT)
78 #define CRT_COLOR_FG(a) (((a) & CRT_COLOR_FG_MASK) >> CRT_COLOR_FG_SHIFT)
80 #define CRT_MAKE_COLOR(f,b) (((f) << CRT_COLOR_FG_SHIFT)|(b))
82 #define CRT_BGCOLOR_NORMAL CRT_COLOR_BLACK
83 #define CRT_FGCOLOR_NORMAL CRT_COLOR_WHITE
85 #define CRT_COLOR_NORMAL CRT_MAKE_COLOR(CRT_FGCOLOR_NORMAL,CRT_BGCOLOR_NORMAL)
108 typedef struct CRT_struct
110 CRT_CA screen[CRT_CELS];
118 crt_ca_cmp (CRT_CA a, CRT_CA b)
120 return memcmp (&a, &b, sizeof (a));
124 crt_pos_cmp (CRT_Pos a, CRT_Pos b)
126 return memcmp (&a, &b, sizeof (a));
129 #endif /* __CRT_H__ */