-void
-tty_set_theme(vga_attribute fg, vga_attribute bg)
-{
- tty_theme_color = (bg << 4 | fg) << 8;
-}
-
-void
-tty_put_char(char chr)
-{
- switch (chr) {
- case '\t':
- tty_x += 4;
- break;
- case '\n':
- tty_y++;
- // fall through
- case '\r':
- tty_x = 0;
- break;
- case '\x08':
- tty_x = tty_x ? tty_x - 1 : 0;
- *(tty_vga_buffer + tty_x + tty_y * TTY_WIDTH) =
- (tty_theme_color | 0x20);
- break;
- default:
- *(tty_vga_buffer + tty_x + tty_y * TTY_WIDTH) =
- (tty_theme_color | chr);
- tty_x++;
- break;
- }