feature: character escape (you can now write text)
fix: cursor when changing screens
This commit is contained in:
@ -26,14 +26,14 @@ void terminal_initialize(void)
|
||||
for (size_t y = 0; y < VGA_HEIGHT; y++) {
|
||||
for (size_t x = 0; x < VGA_WIDTH; x++) {
|
||||
const size_t index = y * VGA_WIDTH + x;
|
||||
TERM_BUF[index] = vga_entry(' ', screen->color);
|
||||
TERM_BUF[index] = vga_entry(' ', VGA_COLOR_WHITE);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < TERM_COUNT; i++) {
|
||||
screens[i].row = 0;
|
||||
screens[i].column = 0;
|
||||
screens[i].color =
|
||||
vga_entry_color(VGA_COLOR_LIGHT_GREY, VGA_COLOR_BLACK);
|
||||
screens[i].color = vga_entry_color(VGA_COLOR_LIGHT_MAGENTA - i,
|
||||
VGA_COLOR_BLACK);
|
||||
memcpy(screens[i].buffer, TERM_BUF, sizeof(screen->buffer));
|
||||
}
|
||||
}
|
||||
@ -43,6 +43,7 @@ void terminal_set_screen(int pos)
|
||||
memcpy(screen->buffer, TERM_BUF, sizeof(screen->buffer));
|
||||
screen = &screens[pos];
|
||||
memcpy(TERM_BUF, screen->buffer, sizeof(screen->buffer));
|
||||
update_cursor();
|
||||
}
|
||||
|
||||
void terminal_setcolor(uint8_t color)
|
||||
@ -62,7 +63,7 @@ static void terminal_scroll(void)
|
||||
for (size_t i = 0; i < VGA_WIDTH * (VGA_HEIGHT - 1); i++)
|
||||
TERM_BUF[i] = TERM_BUF[i + VGA_WIDTH];
|
||||
for (size_t i = 0; i < VGA_WIDTH; i++)
|
||||
terminal_putentryat(' ', screen->color, i, VGA_HEIGHT - 1);
|
||||
terminal_putentryat(' ', VGA_COLOR_WHITE, i, VGA_HEIGHT - 1);
|
||||
}
|
||||
|
||||
static void terminal_new_line(void)
|
||||
|
||||
Reference in New Issue
Block a user