3 * - By John Hodge (thePowersGang)
6 #define VGA_CRTC_IDX 0x3B4
7 #define VGA_CRTC_DATA 0x3B5
8 #define VGA_FEAT_IS1 0x3BA // Features / Input Status 1 (B/W Chips)
9 #define VGA_ATTR_WRITE 0x3C0
10 #define VGA_ATTR_READ 0x3C1
11 #define VGA_MISC_IS0 0x3C2 // Misc Output / Input Status 0
12 #define VGA_MBSLEEP 0x3C3 // "Motherboard Sleep"
13 #define VGA_SEQ_IDX 0x3C4
14 #define VGA_SEQ_DATA 0x3C5
15 #define VGA_DACMASK 0x3C6
16 #define VGA_PADR_DACST 0x3C7
17 #define VGA_PIXWRMODE 0x3C8
18 #define VGA_PIXDATA 0x3C9
19 #define VGA_FEATRD 0x3CA
21 #define VGA_MISCOUT 0x3CC
23 #define VGA_GRAPH_IDX 0x3CE
24 #define VGA_GRAPH_DATA 0x3CF
26 #define VGA_CRTC_IDX 0x3D4
27 #define VGA_CRTC_DATA 0x3D5
29 #define VGA_FEAT_IS1_C 0x3DA // Features / Input Status 1 (Colour Chips)
32 void VGA_WriteAttr(Uint8 Index, Uint8 Data)
35 SHORTLOCK(&glVGA_Attr);
37 outb(VGA_ATTR_WRITE, Index);
38 outb(VGA_ATTR_WRITE, Data);
39 SHORTREL(&glVGA_Attr);
42 Uint8 VGA_ReadAttr(Uint8 Index)
45 SHORTLOCK(&glVGA_Attr);
47 outb(VGA_ATTR_WRITE, Index);
48 ret = inb(VGA_ATTR_READ);
49 SHORTREL(&glVGA_Attr);
53 void VGA_WriteSeq(Uint8 Index, Uint8 Data)
55 outb(VGA_SEQ_IDX, Index);
56 outb(VGA_SEQ_DATA, Data);
58 Uint8 VGA_ReadSeq(Uint8 Index)
60 outb(VGA_SEQ_IDX, Index);
61 return inb(VGA_SEQ_DATA);
63 void VGA_WriteGraph(Uint8 Index, Uint8 Data)
65 outb(VGA_GRAPH_IDX, Index);
66 outb(VGA_GRAPH_DATA, Data);
68 Uint8 VGA_ReadGraph(Uint8 Index)
70 outb(VGA_GRAPH_IDX, Index);
71 return inb(VGA_GRAPH_DATA);
74 void VGA_WriteMiscOut(Uint8 Data)
76 outb(VGA_MISC_IS0, Data);
78 Uint8 VGA_ReadMiscOut(void)
80 return inb(VGA_MISCOUT);