Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | #include <ll/i386/hw-data.h> |
2 | #include <ll/i386/hw-instr.h> |
||
3 | #include <drivers/gd.h> |
||
4 | |||
5 | void gd_getcolor(BYTE ind, BYTE *r, BYTE *g, BYTE *b) |
||
6 | { |
||
7 | outp(0x3c7, ind); |
||
8 | *r = inp(0x3c9); |
||
9 | *g = inp(0x3c9); |
||
10 | *b = inp(0x3c9); |
||
11 | } |
||
12 | |||
13 | void gd_setcolor(BYTE ind,BYTE r,BYTE g,BYTE b) |
||
14 | { |
||
15 | outp(0x3c8, ind); |
||
16 | outp(0x3c9, r); |
||
17 | outp(0x3c9, g); |
||
18 | outp(0x3c9, b); |
||
19 | } |
||
20 | |||
21 | void gd_getpalette(BYTE start, BYTE num, BYTE *pal) |
||
22 | { |
||
23 | int i; |
||
24 | |||
25 | for (i = start; i < start + num; i++) { |
||
26 | outp(0x3c7, i); |
||
27 | *pal++ = inp(0x3c9); |
||
28 | *pal++ = inp(0x3c9); |
||
29 | *pal++ = inp(0x3c9); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | void gd_setpalette(BYTE start, BYTE num, BYTE *pal) |
||
34 | { |
||
35 | int i; |
||
36 | |||
37 | for (i = start; i < start + num; i++) { |
||
38 | outp(0x3c8, i); |
||
39 | outp(0x3c9, *pal++); |
||
40 | outp(0x3c9, *pal++); |
||
41 | outp(0x3c9, *pal++); |
||
42 | } |
||
43 | } |