#include #define VESA_FRAMEBUFFER 0xf5100000 #define VESA_PITCH 2560 #define VESA_BPP 4 //https://forum.osdev.org/viewtopic.php?t=10018&p=64358 // TODO: what will happen in 24bit mode? /* volatile int c; int delay() { c++; } */ void put_rect(int x,int y, int w, int h,uint32_t col) { // start uint8_t *p=VESA_FRAMEBUFFER+y*VESA_PITCH+x*VESA_BPP; uint32_t *pix=p; for(int yy=y; yyvesaXres|| y<0 || y>vesaYres) return; if (x) x = (x*VESA_BPP); // get bytes (divide by 8) if (y) y = (y*VESA_PITCH); //uint8_t *cTemp=VbeModeInfoBlock->physbase; uint8_t *cTemp=VESA_FRAMEBUFFER; cTemp[x+y] = (uint8_t)(color & 0xff); cTemp[x+y+1] = (uint8_t)((color>>8) & 0xff); cTemp[x+y+2] = (uint8_t)((color>>16) & 0xff); }