22 #define PUSH_VAL(VAL) ansiValues[ansiValuesIdx++] = (VAL)
23 #define POP_VAL() ansiValues[--ansiValuesIdx]
24 #define CLEAR_VALS() ansiValuesIdx = 0
68 static uint8_t cursorX = 0;
69 static uint8_t cursorY = 0;
83 static uint16_t ansiVal = 0;
84 static size_t ansiValuesIdx = 0;
85 static uint16_t ansiValues[8] = { 0 };
87 static uint32_t ansiCursorX = 0;
88 static uint32_t ansiCursorY = 0;
89 static uint32_t ansiVGATable[16] = {
108 static int putchar(
unsigned c,
void** ptr)
124 if (c >=
'0' && c <=
'9') {
125 ansiVal = (uint16_t)(c -
'0');
128 }
else if (c ==
's') {
129 ansiCursorX = cursorX;
130 ansiCursorY = cursorY;
132 }
else if (c ==
'u') {
133 cursorX = ansiCursorX;
134 cursorY = ansiCursorY;
144 }
else if (c ==
'm') {
148 while (ansiValuesIdx > 0) {
152 colorFore = resetFore;
153 colorBack = resetBack;
154 }
else if (ansiVal >=
Black && ansiVal <=
White) {
165 }
else if (c ==
'H' || c ==
'f') {
168 if (ansiValuesIdx > 2) {
174 }
else if (c ==
'J') {
184 }
else if (c >=
'0' && c <=
'9') {
185 ansiVal = (uint16_t)(ansiVal * 10 + (uint16_t)(c -
'0'));
269 putchar(str[i++], NULL);
287 void reset(uint32_t fore, uint32_t back)
289 cursorX = cursorY = 0;
290 colorBack = resetBack = back;
291 colorFore = resetFore = fore;
296 cursorX = cursorY = 0;
297 colorBack = resetBack;
298 colorFore = resetFore;