pull/19/head
E. Almqvist 3 years ago
parent 2ca8de3148
commit 8e0260b8a0
  1. 6
      src/lib/vga.c

@ -4,15 +4,13 @@
// Charpos = 0xb8000 + 2(row*80 + col)
#define VIDEO_MEM (char*)0xb8000
static char* cursor_pos = VIDEO_MEM;
static int cursor_y = 0;
void set_cursor_pos(unsigned int row, unsigned int col) { cursor_pos = (char*)(VIDEO_MEM + 2*(row*80 + col)); }
char* get_cursor_pos(unsigned int row, unsigned int col) { return (char*)(VIDEO_MEM + 2*(row*80 + col)); }
void print(char* str, unsigned int str_len) {
for( unsigned int i = 0; i < str_len; i++ ) {
set_cursor_pos(i, cursor_y); // set cursor pos
*cursor_pos = str[i]; // Write char to video memory
*get_cursor_pos(i, cursor_y) = str[i]; // write to video memory
}
}

Loading…
Cancel
Save