diff options
Diffstat (limited to 'video/console.c')
| -rw-r--r-- | video/console.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/video/console.c b/video/console.c index c1b9c5c..b6958c5 100644 --- a/video/console.c +++ b/video/console.c @@ -6,16 +6,23 @@ static int posx=0; static int posy=0; +static void scr_nextline(); -// glue func for vt52 terminal -void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y) +void update_cursor(uint32_t col,uint32_t row) { + unsigned short position=(row*80) + col; + + // cursor LOW port to vga INDEX register + x86_outb(0x3D4, 0x0F); + x86_outb(0x3D5, (unsigned char)(position&0xFF)); + // cursor HIGH port to vga INDEX register + x86_outb(0x3D4, 0x0E); + x86_outb(0x3D5, (unsigned char )((position>>8)&0xFF)); + } - print_char_col(x,y,c, color); -} // helper_funcs -void print_char_col(int x, int y, char c, char col) +static void print_char_col(int x, int y, char c, char col) { #ifdef FOOLOS_CONSOLE @@ -26,12 +33,20 @@ void print_char_col(int x, int y, char c, char col) } -void print_char(int x, int y, char c) +// glue func for vt52 terminal +void console_put_char(uint8_t c,uint8_t color, uint32_t x, uint32_t y) +{ + + print_char_col(x,y,c, color); +} +// +// +static void print_char(int x, int y, char c) { print_char_col(x,y,c,SCR_WHITE); } -void print_single_num(int i) +static void print_single_num(int i) { if(i<10)print_char_col(posx,posy,'0'+i,SCR_GREEN); else if(i<16)print_char_col(posx,posy,'A'+i-10,SCR_GREEN); @@ -40,7 +55,7 @@ void print_single_num(int i) } -void print_str_col(int x,int y,char *str, char col) +static void print_str_col(int x,int y,char *str, char col) { while(*str!=0) @@ -50,7 +65,7 @@ void print_str_col(int x,int y,char *str, char col) } -void print_str(int x,int y,char *str) +static void print_str(int x,int y,char *str) { print_str_col(x,y,str,SCR_WHITE); } @@ -82,7 +97,7 @@ void scr_put_string_nl(char *str) } */ -void scr_nextline() +static void scr_nextline() { #ifdef FOOLOS_CONSOLE int i,x; @@ -117,7 +132,7 @@ void scr_nextline() #endif } -void scr_put_char(char ch,char col) +static void scr_put_char(char ch,char col) { if(ch=='\n')scr_nextline(); @@ -163,7 +178,7 @@ void scr_put_hex32(uint32_t val) } */ -void scr_put_string(char *str, char col) +static void scr_put_string(char *str, char col) { while(*str!=0) { @@ -171,7 +186,7 @@ void scr_put_string(char *str, char col) } } -void scr_backspace() +static void scr_backspace() { if(posx==0)return; print_char_col(posx-1,posy,' ',SCR_LGREEN); |
