Mercurial > vesa
diff main.c @ 0:cbded07e50d8 default tip
*: initial commit
here's a simple VBE thing. It's intended to be able to work
pretty much anywhere, but I don't really have anything to
test VBE 1.0 with (and i'm not entirely sure if this code
works in the first place)
it's balls simple, no BS, and ONLY works with DJGPP.
| author | Paper <paper@tflc.us> |
|---|---|
| date | Sat, 02 Aug 2025 12:55:21 -0400 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.c Sat Aug 02 12:55:21 2025 -0400 @@ -0,0 +1,40 @@ +#include <stdio.h> +#include <stdint.h> +#include <dpmi.h> +#include <go32.h> +#include <sys/farptr.h> +#include <stdlib.h> +#include <string.h> +#include <inttypes.h> +#include <dos.h> + +#include "vbe.h" + +int main(void) +{ + uint8_t *framebuffer; + struct vbe vbe; + int x, y; + + framebuffer = malloc(640 * 400); + + vbe_init(&vbe, 640, 400); + + { + for (x = 0; x < 640; x++) + for (y = 0; y < 400; y++) + framebuffer[(y * 640) + x] = vbe_rgb(&vbe, (x + 10), (y + 10), 0xFF); + + vbe_blit(&vbe, framebuffer); + } + + delay(5000); + + free(framebuffer); + + vbe_quit(&vbe); + + printf("vbe.bpp: %d", vbe.bpp); + + return 0; +}
