/** * @file vga.h * @brief VGA * @details Responsible for VGA buffer control. */ #ifndef VGA_H #define VGA_H /** * @brief */ #define VGA_GRID_COLS 80 /** * @brief */ #define VGA_GRID_ROWS 25 /** * @brief */ #define DEFAULT_ATTRIBUTES 0x0F00 #include #include #include "io.h" /** * @brief Information on the VGA buffer */ extern volatile uint16_t* const vga_buffer; /** * @brief */ typedef struct vga_ctx_s { int cursor_col; /**< @brief */ int cursor_row; /**< @brief */ uint16_t attributes; /**< @brief */ } vga_ctx_t; /** * @brief grid is top left origin. This is our cursor! Black background, White foreground */ extern uint16_t vga_attributes; /** * @brief */ extern char_writer_t* default_vga; /** * @brief Clear the VGA buffer, context optional * @param ctx */ void vga_clear_ctx(vga_ctx_t* ctx); /** * @brief */ void vga_clear(); /** * @brief Write character c to cursor. Implements IO generic ASCII output * @param ctx * @param c * @return int */ int vga_out(void* ctx, char c); #endif