Didn't feel the need to make a new branch for this one, but i added some doxygen documentation templates to all of the headers. It's a bit overdue.
72 lines
1.1 KiB
C
72 lines
1.1 KiB
C
/**
|
|
* @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 <stdint.h>
|
|
#include <stdarg.h>
|
|
#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
|