using write_cell to test color palette

This commit is contained in:
shockrahwow 2019-01-18 12:47:13 -08:00
parent 2600868abd
commit e09e9ffc82

View File

@ -12,21 +12,11 @@
/*
enum typedef Colors{
Black,
Blue,
Green,
Cyan,
Red,
Magenta,
Brown,
LightGrey,
DarkGrey,
LightBlue,
LightGreen,
LightCyan,
LightRed,
LightMagenta,
LightBrown,
Black, Blue, Green,
Cyan, Red, Magenta,
Brown, LightGrey, DarkGrey,
LightBlue, LightGreen, LightCyan,
LightRed, LightMagenta, LightBrown,
White,
};
*/
@ -36,17 +26,13 @@ enum typedef Colors{
static char* Frame_Buffer = (char*)0x000B8000;
// Writes character to a given cell in the framebuffer
// Safety handled by caller function
void write_cell(const unsigned cell, const char c, const char fg_bg) {
void write_cell(unsigned cell, char c, char fg, char bg) {
Frame_Buffer[cell] = c;
Frame_Buffer[cell+1] = fg_bg;
Frame_Buffer[cell+1] = (fg & 0x0f << 4) | (bg & 0x0f);
}
void colors() {
// finding what the fucking colors are that we can draw
unsigned char color = 0x00;
for(int i =0;i<0x20;i++) {
Frame_Buffer[i] = 'a';
Frame_Buffer[i+1] = color;
color++;
for(int i =0;i<0x10;i++) {
write_cell(i, 'a', 8, 8);
}
}