Mercurial > vesa
comparison 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 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:cbded07e50d8 |
|---|---|
| 1 #include <stdio.h> | |
| 2 #include <stdint.h> | |
| 3 #include <dpmi.h> | |
| 4 #include <go32.h> | |
| 5 #include <sys/farptr.h> | |
| 6 #include <stdlib.h> | |
| 7 #include <string.h> | |
| 8 #include <inttypes.h> | |
| 9 #include <dos.h> | |
| 10 | |
| 11 #include "vbe.h" | |
| 12 | |
| 13 int main(void) | |
| 14 { | |
| 15 uint8_t *framebuffer; | |
| 16 struct vbe vbe; | |
| 17 int x, y; | |
| 18 | |
| 19 framebuffer = malloc(640 * 400); | |
| 20 | |
| 21 vbe_init(&vbe, 640, 400); | |
| 22 | |
| 23 { | |
| 24 for (x = 0; x < 640; x++) | |
| 25 for (y = 0; y < 400; y++) | |
| 26 framebuffer[(y * 640) + x] = vbe_rgb(&vbe, (x + 10), (y + 10), 0xFF); | |
| 27 | |
| 28 vbe_blit(&vbe, framebuffer); | |
| 29 } | |
| 30 | |
| 31 delay(5000); | |
| 32 | |
| 33 free(framebuffer); | |
| 34 | |
| 35 vbe_quit(&vbe); | |
| 36 | |
| 37 printf("vbe.bpp: %d", vbe.bpp); | |
| 38 | |
| 39 return 0; | |
| 40 } |
