jankos/framebuffer.h
shockrahwow 8d1879fe97 - Retesting framebuffer drivers
- clear_fb() fully working
- trying to add positional buffer writes for fancy output
- POSITION macro only seems to work for (0,0) coords for now
haven't tested other edge cases yet
2019-02-25 15:36:31 -08:00

40 lines
886 B
C

#include "stl/string.h"
#define COLUMNS 80
#define ROWS 25
#define AREA ( COLUMNS * ROWS )
#define POSITION(ROW, COL) ( (ROW * COLUMNS) + COL )
// address of our frame buffer
#define FRAME_BUFFER_ADDR 0x000B8000
// Logical index of a cell in the frame buffer
#define FRAME_CELL(cell_) (cell_ * 2)
// Colors available in text framebuffer
#define Black 0x01
#define Blue 0x02
#define Green 0x03
#define Cyan 0x04
#define Red 0x05
#define Magenta 0x05
#define Brown 0x06
#define LightGrey 0x07
#define DarkGrey 0x08
#define LightBlue 0x09
#define LightGreen 0x0a
#define LightCyan 0x0b
#define LightRed 0x0c
#define LightMagenta 0x0d
#define LightBrown 0x0e
#define White 0x0f
void write_cell_fb(unsigned cell, char c , char fg, char bg);
void print_fb(char* str, unsigned row, unsigned col);
void clear_fb();
/* Testing function because yote squad in here yeye */
void test_fb();