\r
//set up the palette for color printing\r
static u16 colorTable[] = {\r
- RGB565( 0, 0, 0), // normal black\r
- RGB565(17, 0, 0), // normal red\r
- RGB565( 0,34, 0), // normal green\r
- RGB565(17,34, 0), // normal yellow\r
- RGB565( 0, 0,17), // normal blue\r
- RGB565(17, 0,17), // normal magenta\r
- RGB565( 0,34,17), // normal cyan\r
- RGB565(17,34,17), // normal white\r
- RGB565( 0, 0, 0), // bright black\r
- RGB565(25, 0, 0), // bright red\r
- RGB565( 0,52, 0), // bright green\r
- RGB565(25,52, 0), // bright yellow\r
- RGB565( 4,18,31), // bright blue\r
- RGB565(25, 0,25), // bright magenta\r
- RGB565( 0,52,25), // bright cyan\r
- RGB565(28,57,28) // bright white\r
+ RGB8_to_565( 0, 0, 0), // black\r
+ RGB8_to_565(128, 0, 0), // red\r
+ RGB8_to_565( 0,128, 0), // green\r
+ RGB8_to_565(128,128, 0), // yellow\r
+ RGB8_to_565( 0, 0,128), // blue\r
+ RGB8_to_565(128, 0,128), // magenta\r
+ RGB8_to_565( 0,128,128), // cyan\r
+ RGB8_to_565(192,192,192), // white\r
+\r
+ RGB8_to_565(128,128,128), // bright black\r
+ RGB8_to_565(255, 0, 0), // bright red\r
+ RGB8_to_565( 0,255, 0), // bright green\r
+ RGB8_to_565(255,255, 0), // bright yellow\r
+ RGB8_to_565( 0, 0,255), // bright blue\r
+ RGB8_to_565(255, 0,255), // bright magenta\r
+ RGB8_to_565( 0,255,255), // bright cyan\r
+ RGB8_to_565(255,255,255), // bright white\r
+\r
+ RGB8_to_565( 0, 0, 0), // faint black\r
+ RGB8_to_565( 64, 0, 0), // faint red\r
+ RGB8_to_565( 0, 64, 0), // faint green\r
+ RGB8_to_565( 64, 64, 0), // faint yellow\r
+ RGB8_to_565( 0, 0, 64), // faint blue\r
+ RGB8_to_565( 64, 0, 64), // faint magenta\r
+ RGB8_to_565( 0, 64, 64), // faint cyan\r
+ RGB8_to_565( 96, 96, 96), // faint white\r
};\r
\r
PrintConsole defaultConsole =\r
},\r
(u16*)NULL,\r
0,0, //cursorX cursorY\r
- 0,0, //prevcursorX prevcursorY\r
+ 0,0, //prevcursorX prevcursorY\r
40, //console width\r
30, //console height\r
0, //window x\r
3, //tab size\r
7, // foreground color\r
0, // background color\r
- CONSOLE_COLOR_BRIGHT, // flags\r
+ 0, // flags\r
0, //print callback\r
false //console initialized\r
};\r
escapeseq += consumed;\r
escapelen -= consumed;\r
\r
- if (parameter == 0 ) {\r
- currentConsole->flags |= CONSOLE_COLOR_BRIGHT;\r
- currentConsole->flags &= ~CONSOLE_COLOR_REVERSE;\r
- currentConsole->bg = 0;\r
- currentConsole->fg = 7;\r
+ if (parameter == 0 ) { //reset\r
+ currentConsole->flags = 0;\r
+ currentConsole->bg = 0;\r
+ currentConsole->fg = 7;\r
} else if (parameter == 7) { // reverse video\r
currentConsole->flags |= CONSOLE_COLOR_REVERSE;\r
+ } else if (parameter == 1) { // bright\r
+ currentConsole->flags |= CONSOLE_COLOR_BOLD;\r
+ currentConsole->flags &= ~CONSOLE_COLOR_FAINT;\r
} else if (parameter == 2) { // half bright\r
- currentConsole->flags &= ~CONSOLE_COLOR_BRIGHT;\r
+ currentConsole->flags &= ~CONSOLE_COLOR_BOLD;\r
+ currentConsole->flags |= CONSOLE_COLOR_FAINT;\r
} else if (parameter >= 30 && parameter <= 37) { // writing color\r
currentConsole->fg = parameter - 30;\r
} else if (parameter >= 40 && parameter <= 47) { // screen color\r
int writingColor = currentConsole->fg;\r
int screenColor = currentConsole->bg;\r
\r
- if (currentConsole->flags & CONSOLE_COLOR_BRIGHT) {\r
- writingColor |= 8;\r
- screenColor |=8;\r
+ if (currentConsole->flags & CONSOLE_COLOR_BOLD) {\r
+ writingColor += 8;\r
+ } else if (currentConsole->flags & CONSOLE_COLOR_FAINT) {\r
+ writingColor += 16;\r
}\r
\r
if (currentConsole->flags & CONSOLE_COLOR_REVERSE) {\r