|
0
|
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 }
|