3203a132e39bd428554cc7e8e5ad56f151945d9f
[dos_low3d] / src / video.h
1 #ifndef VIDEO_H_
2 #define VIDEO_H_
3
4 extern unsigned char *vid_backbuf;
5
6 void init_video(void);
7 void close_video(void);
8
9 void vid_clearfb(void);
10 void vid_clearfb_rect(int x, int y, int w, int h);
11 void vid_pgflip(void);
12
13 void vid_setmask(unsigned int mask);
14 #pragma aux vid_setmask = \
15         "mov dx, 0x3c4" \
16         "mov ah, al" \
17         "mov al, 2" \
18         "out dx, ax" \
19         parm [eax] \
20         modify [ax dx];
21
22 void vid_wait_vblank(void);
23 #pragma aux vid_wait_vblank = \
24         "mov dx, 0x3da" \
25         "waitvb:" \
26         "in al, dx" \
27         "and al, 8" \
28         "jz waitvb" \
29         modify [al dx];
30
31 void vid_vsync(void);
32 #pragma aux vid_vsync = \
33         "mov dx, 0x3da" \
34         "invb:" \
35         "in al, dx" \
36         "and al, 8" \
37         "jnz invb" \
38         "waitvb:" \
39         "in al, dx" \
40         "and al, 8" \
41         "jz waitvb" \
42         modify [al dx];
43
44
45 #endif  /* VIDEO_H_ */