Modules/VGA - Start on a generic VGA driver (VGA driver, and library for derivatives)
[tpg/acess2.git] / KernelLand / Modules / Display / VGA / vgaregs.c
1 /*
2  * Acess2 VGA Driver
3  * - By John Hodge (thePowersGang)
4  */
5
6
7 // === CODE ===
8 void VGA_WriteAttr(Uint8 Index, Uint8 Data)
9 {
10         Index &= 0x1F;
11         SHORTLOCK(&glVGA_Attr);
12         inb(0x3DA);
13         outb(0x3C0, Index);
14         outb(0x3C0, Data);
15         SHORTREL(&glVGA_Attr);
16 }
17
18 Uint8 VGA_ReadAttr(Uint8 Index)
19 {
20         Uint8   ret;
21         SHORTLOCK(&glVGA_Attr);
22         inb(0x3DA);
23         outb(0x3C0, Index);
24         ret = inb(0x3C1);
25         SHORTREL(&glVGA_Attr);
26         return ret;
27 }
28
29 void VGA_WriteSeq(Uint8 Index, Uint8 Data)
30 {
31         outb(0x3C4, Index);
32         outb(0x3C5, Data);
33 }
34 Uint8 VGA_ReadSeq(Uint8 Index)
35 {
36         outb(0x3C4, Index);
37         return inb(0x3C5);
38 }
39 void VGA_WriteGraph(Uint8 Index, Uint8 Data)
40 {
41         outb(0x3CE, Index);
42         outb(0x3CF, Data);
43 }
44 Uint8 VGA_ReadGraph(Uint8 Index)
45 {
46         outb(0x3CE, Index);
47         return inb(0x3CF);
48 }
49
50 void VGA_WriteMiscOut(Uint8 Data)
51 {
52         outb(0x3C2, Data);
53 }
54 Uint8 VGA_ReadMiscOut(void)
55 {
56         return inb(0x3CC);
57 }

UCC git Repository :: git.ucc.asn.au