| 1 | #ifndef DRIVERS__VGA_TEXTMODE_H__ |
| 2 | #define DRIVERS__VGA_TEXTMODE_H__ |
| 3 | |
| 4 | #if defined (BIOS) |
| 5 | |
| 6 | #include <stdint.h> |
| 7 | #include <stddef.h> |
| 8 | #include <stdbool.h> |
| 9 | #include <flanterm.h> |
| 10 | |
| 11 | #define VD_COLS (80 * 2) |
| 12 | #define VD_ROWS 25 |
| 13 | |
| 14 | struct textmode_context { |
| 15 | struct flanterm_context term; |
| 16 | |
| 17 | volatile uint8_t *video_mem; |
| 18 | |
| 19 | uint8_t *back_buffer; |
| 20 | uint8_t *front_buffer; |
| 21 | |
| 22 | size_t cursor_offset; |
| 23 | size_t old_cursor_offset; |
| 24 | bool cursor_status; |
| 25 | bool cursor_overflow; |
| 26 | uint8_t text_palette; |
| 27 | |
| 28 | uint8_t saved_state_text_palette; |
| 29 | size_t saved_state_cursor_offset; |
| 30 | }; |
| 31 | |
| 32 | void vga_textmode_init(bool managed); |
| 33 | |
| 34 | #endif |
| 35 | |
| 36 | #endif |