summaryrefslogtreecommitdiff
path: root/userspace/xterm/vesa.c
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/xterm/vesa.c')
-rw-r--r--userspace/xterm/vesa.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/userspace/xterm/vesa.c b/userspace/xterm/vesa.c
index 7f22a5f..745e7fb 100644
--- a/userspace/xterm/vesa.c
+++ b/userspace/xterm/vesa.c
@@ -29,6 +29,10 @@ static int console_y;
static int console_lines;
static int console_cols;
+static uint8_t termdata[80*24];
+static uint8_t termdata_bg[80*24];
+static uint8_t termdata_fg[80*24];
+
// same colors as in screen.h
static uint32_t cols[] = {
0x0, // black
@@ -52,14 +56,26 @@ static uint32_t cols[] = {
/** update cursor position */
void vesa_update_cursor(uint32_t col,uint32_t row)
{
+ int oldx=console_x;
+ int oldy=console_y;
+
console_x=col;
console_y=row;
+
+
+ vesa_console_put_char(termdata[oldy*80+oldx],termdata_bg[oldy*80+oldx],termdata_fg[oldy*80+oldx],oldx,oldy);
+ vesa_console_put_char(termdata[row*80+col],termdata_bg[row*80+col],termdata_fg[row*80+col],col,row);
}
/** put char */
void vesa_console_put_char(uint8_t c,uint8_t color_bg, uint8_t color_fg, uint32_t x, uint32_t y)
{
- PutFont(c, x,y, cols[color_bg],cols[color_fg]);
+ termdata[y*80+x]=c;
+ termdata_bg[y*80+x]=color_bg;
+ termdata_fg[y*80+x]=color_fg;
+
+ if(x==console_x&&y==console_y)PutFont(c, x,y, cols[color_fg],cols[color_bg]);
+ else PutFont(c, x,y, cols[color_bg],cols[color_fg]);
}
//
@@ -88,7 +104,7 @@ uint32_t vesa_init(char *fontname)
FILE *f;
//if(fontname==NULL)f=fopen("/doc/fonts/binfont.bin","r");
//if(fontname==NULL)f=fopen("/doc/fonts/tinyfont.bin","r");
- if(fontname==NULL)f=fopen("/doc/fonts/binfont_v2.bin","r");
+ if(fontname==NULL)f=fopen("/doc/fonts/envypn7x13.bin","r");
fread(&font_width,1,1,f);
fread(&font_height,1,1,f);