|
|
|
@ -15,6 +15,18 @@ int get_offset_col(int offset);
|
|
|
|
|
* Public Kernel API functions *
|
|
|
|
|
**********************************************************/
|
|
|
|
|
|
|
|
|
|
void clear_screen() {
|
|
|
|
|
int screen_size = MAX_COLS * MAX_ROWS;
|
|
|
|
|
int i;
|
|
|
|
|
uint8_t *screen = (uint8_t*) VIDEO_ADDRESS;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < screen_size; i++) {
|
|
|
|
|
screen[i*2] = ' ';
|
|
|
|
|
screen[i*2+1] = WHITE_ON_BLACK;
|
|
|
|
|
}
|
|
|
|
|
set_cursor_offset(get_offset(0, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Print a message on the specified location
|
|
|
|
|
* If col, row, are negative, we will use the current offset
|
|
|
|
@ -132,18 +144,6 @@ void set_cursor_offset(int offset) {
|
|
|
|
|
port_byte_out(REG_SCREEN_DATA, (uint8_t)(offset & 0xff));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clear_screen() {
|
|
|
|
|
int screen_size = MAX_COLS * MAX_ROWS;
|
|
|
|
|
int i;
|
|
|
|
|
uint8_t *screen = (uint8_t*) VIDEO_ADDRESS;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < screen_size; i++) {
|
|
|
|
|
screen[i*2] = ' ';
|
|
|
|
|
screen[i*2+1] = WHITE_ON_BLACK;
|
|
|
|
|
}
|
|
|
|
|
set_cursor_offset(get_offset(0, 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int get_offset(int col, int row) { return 2 * (row * MAX_COLS + col); }
|
|
|
|
|
int get_offset_row(int offset) { return offset / (2 * MAX_COLS); }
|
|
|
|
|