>>979616
here you go nigger. this is how we do graphics
char font[256][FONT_H][FONT_W] = {{
...
{0,1,1,1,1,1,1,0}, /* <- 0; the first 127 letters are ascii
{1,0,0,0,0,0,0,1}, * and the rest can be switched out for
{1,0,0,0,0,0,0,1}, * whatever extended ascii charset you
{1,0,0,0,0,0,0,1}, * want at runtime or compile time.
{1,0,0,0,0,0,0,1}, * i would go for letting the user define
{1,0,0,0,0,0,0,1}, * bitmaps for characters but since we're
{1,0,0,0,0,0,0,1}, * on an imageboard we go for a gay
{1,0,0,0,0,0,0,1}, * worse-is-better solution */
{1,0,0,0,0,0,0,1},
{0,1,1,1,1,1,1,0}
},{
...
}};
uint32_t framebuffer[600][800];
void setup_graphics() {
/* FUTURE: use actual vertical rate of screen instead of 60Hz */
setup_good_periodic_timer_like_hpet_or_something(render_stuff,1666666666);
framebuffer = map_framebuffer();
}
uint32_t logo[LOGO_H][LOGO_W] = ...;
#define SPACE_SIZE 2
void render_stuff() {
/* rendering must be top-down to ensure vertical synchronization and no
* user input latency, and must never exceed the refresh period (e.g 16.66ms)
* TODO: add code to adjust periodic timer to start right when monitor enters vblank
* (can be done via VESA API I think) */
char stuff = "welcome to nignog OS v43.3.5 :^)";
for (int y=0;y<FONT_H,y++)
for (int c=0;c<size(stuff);c++)
for (int x=0;x<FONT_W;x++)
framebuffer[y][c*(FONT_W+SPACE_SIZE)+x] = 0x00ff0000;
for (int y=0;y<LOGO_H;y++)
for (int x=0;x<LOGO_W;x++)
framebuffer[50+y][x] = logo[y][x];
}