• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef vgabios_h_included
2 #define vgabios_h_included
3 
4 /* Types */
5 typedef unsigned char  Bit8u;
6 typedef unsigned short Bit16u;
7 typedef unsigned long  Bit32u;
8 typedef unsigned short Boolean;
9 
10 /* Defines */
11 
12 #define SET_AL(val8) AX = ((AX & 0xff00) | (val8))
13 #define SET_BL(val8) BX = ((BX & 0xff00) | (val8))
14 #define SET_CL(val8) CX = ((CX & 0xff00) | (val8))
15 #define SET_DL(val8) DX = ((DX & 0xff00) | (val8))
16 #define SET_AH(val8) AX = ((AX & 0x00ff) | ((val8) << 8))
17 #define SET_BH(val8) BX = ((BX & 0x00ff) | ((val8) << 8))
18 #define SET_CH(val8) CX = ((CX & 0x00ff) | ((val8) << 8))
19 #define SET_DH(val8) DX = ((DX & 0x00ff) | ((val8) << 8))
20 
21 #define GET_AL() ( AX & 0x00ff )
22 #define GET_BL() ( BX & 0x00ff )
23 #define GET_CL() ( CX & 0x00ff )
24 #define GET_DL() ( DX & 0x00ff )
25 #define GET_AH() ( AX >> 8 )
26 #define GET_BH() ( BX >> 8 )
27 #define GET_CH() ( CX >> 8 )
28 #define GET_DH() ( DX >> 8 )
29 
30 #define SET_CF()     FLAGS |= 0x0001
31 #define CLEAR_CF()   FLAGS &= 0xfffe
32 #define GET_CF()     (FLAGS & 0x0001)
33 
34 #define SET_ZF()     FLAGS |= 0x0040
35 #define CLEAR_ZF()   FLAGS &= 0xffbf
36 #define GET_ZF()     (FLAGS & 0x0040)
37 
38 #define SCROLL_DOWN 0
39 #define SCROLL_UP   1
40 #define NO_ATTR     2
41 #define WITH_ATTR   3
42 
43 #define SCREEN_SIZE(x,y) (((x*y*2)|0x00ff)+1)
44 #define SCREEN_MEM_START(x,y,p) ((((x*y*2)|0x00ff)+1)*p)
45 #define SCREEN_IO_START(x,y,p) ((((x*y)|0x00ff)+1)*p)
46 
47 #endif
48