aboutsummaryrefslogtreecommitdiffstats
path: root/src/crt.h
diff options
context:
space:
mode:
authorjames <>2008-02-07 12:16:04 +0000
committerjames <>2008-02-07 12:16:04 +0000
commitab5452e7390705d3b46ca29e900d2c5ec9faf555 (patch)
treef1dfb6e48f4d180866420bae638368772d49fca9 /src/crt.h
parentb7dab6019f661c3ef5d19f8faeacfec3a927f727 (diff)
downloadsympathy-ab5452e7390705d3b46ca29e900d2c5ec9faf555.tar.gz
sympathy-ab5452e7390705d3b46ca29e900d2c5ec9faf555.tar.bz2
sympathy-ab5452e7390705d3b46ca29e900d2c5ec9faf555.zip
*** empty log message ***
Diffstat (limited to 'src/crt.h')
-rw-r--r--src/crt.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/crt.h b/src/crt.h
index 002f67f..f92c99a 100644
--- a/src/crt.h
+++ b/src/crt.h
@@ -12,6 +12,9 @@
/*
* $Log$
+ * Revision 1.4 2008/02/07 12:16:04 james
+ * *** empty log message ***
+ *
* Revision 1.3 2008/02/06 11:30:37 james
* *** empty log message ***
*
@@ -39,10 +42,38 @@
#define CRT_ATTR_BLINK 0x4
#define CRT_ATTR_BOLD 0x8
+
+#define CRT_COLOR_BLACK 0x0
+#define CRT_COLOR_RED 0x1
+#define CRT_COLOR_GREEN 0x2
+#define CRT_COLOR_YELLOW 0x3
+#define CRT_COLOR_BLUE 0x4
+#define CRT_COLOR_MAGENTA 0x5
+#define CRT_COLOR_CYAN 0x6
+#define CRT_COLOR_WHITE 0x7
+#define CRT_COLOR_INTENSITY 0x8
+
+#define CRT_COLOR_FG_MASK 0xf0
+#define CRT_COLOR_FG_SHIFT 4
+
+#define CRT_COLOR_BG_MASK 0xf
+#define CRT_COLOR_BG_SHIFT 0
+
+#define CRT_COLOR_BG(a) (((a) & CRT_COLOR_BG_MASK) >> CRT_COLOR_BG_SHIFT)
+#define CRT_COLOR_FG(a) (((a) & CRT_COLOR_FG_MASK) >> CRT_COLOR_FG_SHIFT)
+
+#define CRT_MAKE_COLOR(f,b) (((f) << CRT_COLOR_FG_SHIFT)|(b))
+
+#define CRT_BGCOLOR_NORMAL CRT_COLOR_BLACK
+#define CRT_FGCOLOR_NORMAL CRT_COLOR_WHITE
+
+#define CRT_COLOR_NORMAL CRT_MAKE_COLOR(CRT_FGCOLOR_NORMAL,CRT_BGCOLOR_NORMAL)
+
typedef struct
{
uint8_t chr;
uint8_t attr;
+ uint8_t color;
} CRT_CA;
typedef struct