support more codes

This commit is contained in:
Dave Murphy 2014-12-13 02:51:57 +00:00
parent 28ef35f4a6
commit 2de946890d
2 changed files with 65 additions and 3 deletions

View File

@ -94,7 +94,13 @@ typedef struct PrintConsole
#define CONSOLE_COLOR_BOLD (1<<0) #define CONSOLE_COLOR_BOLD (1<<0)
#define CONSOLE_COLOR_FAINT (1<<1) #define CONSOLE_COLOR_FAINT (1<<1)
#define CONSOLE_COLOR_REVERSE (1<<2) #define CONSOLE_ITALIC (1<<2)
#define CONSOLE_UNDERLINE (1<<3)
#define CONSOLE_BLINK_SLOW (1<<4)
#define CONSOLE_BLINK_FAST (1<<5)
#define CONSOLE_COLOR_REVERSE (1<<6)
#define CONSOLE_CONCEAL (1<<7)
#define CONSOLE_CROSSED_OUT (1<<8)
/*! \brief Loads the font into the console /*! \brief Loads the font into the console
\param console pointer to the console to update, if NULL it will update the current console \param console pointer to the console to update, if NULL it will update the current console

View File

@ -326,8 +326,64 @@ ssize_t con_write(struct _reent *r,int fd,const char *ptr, size_t len) {
currentConsole->flags |= CONSOLE_COLOR_FAINT; currentConsole->flags |= CONSOLE_COLOR_FAINT;
break; break;
case 7: // reverse video case 3: // italic
currentConsole->flags |= CONSOLE_COLOR_REVERSE; currentConsole->flags |= CONSOLE_ITALIC;
break;
case 4: // underline
currentConsole->flags |= CONSOLE_UNDERLINE;
break;
case 5: // blink slow
currentConsole->flags &= ~CONSOLE_BLINK_FAST;
currentConsole->flags |= CONSOLE_BLINK_SLOW;
break;
case 6: // blink fast
currentConsole->flags &= ~CONSOLE_BLINK_SLOW;
currentConsole->flags |= CONSOLE_BLINK_FAST;
break;
case 7: // reverse video
currentConsole->flags |= CONSOLE_COLOR_REVERSE;
break;
case 8: // conceal
currentConsole->flags |= CONSOLE_CONCEAL;
break;
case 9: // crossed-out
currentConsole->flags |= CONSOLE_CROSSED_OUT;
break;
case 21: // bold off
currentConsole->flags &= ~CONSOLE_COLOR_BOLD;
break;
case 22: // normal color
currentConsole->flags &= ~CONSOLE_COLOR_BOLD;
currentConsole->flags &= ~CONSOLE_COLOR_FAINT;
break;
case 23: // italic off
currentConsole->flags &= ~CONSOLE_ITALIC;
break;
case 24: // underline off
currentConsole->flags &= ~CONSOLE_UNDERLINE;
break;
case 25: // blink off
currentConsole->flags &= ~CONSOLE_BLINK_SLOW;
currentConsole->flags &= ~CONSOLE_BLINK_FAST;
break;
case 27: // reverse off
currentConsole->flags &= ~CONSOLE_COLOR_REVERSE;
break;
case 29: // crossed-out off
currentConsole->flags &= ~CONSOLE_CROSSED_OUT;
break; break;
case 30 ... 37: // writing color case 30 ... 37: // writing color