2025-06-29 05:13:43 +00:00
|
|
|
/* vga.h
|
|
|
|
|
* VGA
|
2025-06-10 13:17:21 +00:00
|
|
|
*
|
2025-06-29 05:13:43 +00:00
|
|
|
* Responsible for VGA buffer control.
|
2025-06-10 13:17:21 +00:00
|
|
|
*/
|
2025-06-29 05:13:43 +00:00
|
|
|
#ifndef VGA_H
|
|
|
|
|
#define VGA_H
|
2025-06-08 20:18:06 +00:00
|
|
|
#define VGA_GRID_COLS 80
|
2025-05-29 03:19:50 +00:00
|
|
|
#define VGA_GRID_ROWS 25
|
|
|
|
|
#include <stdint.h>
|
2025-06-08 20:18:06 +00:00
|
|
|
#include <stdarg.h>
|
2025-05-29 03:19:50 +00:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* CONSTANTS AND VARIABLES
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//Information on the VGA buffer
|
|
|
|
|
|
|
|
|
|
extern volatile uint16_t* const vga_buffer;
|
|
|
|
|
|
|
|
|
|
//grid is top left origin. This is our cursor!
|
|
|
|
|
extern int cursor_col;
|
|
|
|
|
extern int cursor_row;
|
|
|
|
|
extern uint16_t vga_attributes; // Black background, White foreground
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Functions
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//Clear the VGA buffer
|
|
|
|
|
void vga_clear();
|
|
|
|
|
//Put a character in the VGA buffer and move the cursor to the right by one
|
|
|
|
|
void vga_set_attributes(uint8_t attributes);
|
2025-06-29 05:13:43 +00:00
|
|
|
//Write character c to cursor
|
|
|
|
|
//Implements IO generic ASCII output
|
|
|
|
|
int vga_out(char c);
|
|
|
|
|
|
2025-05-29 03:19:50 +00:00
|
|
|
|
|
|
|
|
#endif
|