removed clang-format and clang_complete files from the repo
[dosdemo] / src / dos / vga.h
1 #ifndef VGA_H_
2 #define VGA_H_
3
4 #include "inttypes.h"
5 #include "dosutil.h"
6 #include "cdpmi.h"
7 #include "vgaregs.h"
8
9 #define VGA_FBADDR      ((void*)phys_to_virt(0xa0000))
10
11 int vga_setmode(int mode);
12 int vga_setmodex(void);
13
14 #define vga_planemask(mask) \
15         outpw(VGA_SC_ADDR_PORT, VGA_SC_MAPMASK_REG | ((unsigned short)(mask) << 8))
16
17 #ifdef __WATCOMC__
18 void vga_setpal(int16_t idx, uint8_t r, uint8_t g, uint8_t b);
19 #pragma aux vga_setpal = \
20         "test ax, 0x8000" \
21         "jnz skip_dacaddr" \
22         "mov dx, 0x3c8" \
23         "out dx, al" \
24         "skip_dacaddr:" \
25         "mov dx, 0x3c9" \
26         "mov al, bl" \
27         "shr al, 2" \
28         "out dx, al" \
29         "mov al, bh" \
30         "shr al, 2" \
31         "out dx, al" \
32         "mov al, cl" \
33         "shr al, 2" \
34         "out dx, al" \
35         parm[ax][bl][bh][cl] \
36         modify[dx];
37 #endif /* __WATCOMC__ */
38
39 #endif  /* VGA_H_ */