Skip to content

Commit

Permalink
Create terminal.h
Browse files Browse the repository at this point in the history
  • Loading branch information
cledic committed Apr 30, 2016
1 parent 89eae0c commit fbc6580
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions terminal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* VT100 terminal command */
#define ESC (0x1B)
#define TERM_CLEAR_SCREEN printf("%c[2J", ESC)
#define TERM_CURSOR_HOME printf("%c[H", ESC)
#define TERM_TEXT_RED printf("%c[31m", ESC)
#define TERM_TEXT_GREEN printf("%c[32m", ESC)
#define TERM_TEXT_WHITE printf("%c[37m", ESC)
#define TERM_BKGRD_WHITE printf("%c[47m", ESC)
#define TERM_TEXT_BLUE printf("%c[34m", ESC)
#define TERM_TEXT_BLACK printf("%c[30m", ESC)
#define TERM_TEXT_DEFAULT printf("%c[0m", ESC)
#define TERM_CURSOR_POS(v,h) printf("%c[%d;%dH", ESC,v,h)
//
#define TERM_CURSOR_SAVE printf("%c7", ESC)
#define TERM_CURSOR_RESTORE printf("%c8", ESC)

void Term_Banner( void);

0 comments on commit fbc6580

Please sign in to comment.