Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1063 | tullio | 1 | |
2 | /* |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
16 | * |
||
17 | */ |
||
18 | |||
2 | pj | 19 | #include <ll/i386/hw-data.h> |
20 | #include <ll/i386/hw-instr.h> |
||
21 | #include <drivers/gd.h> |
||
22 | |||
23 | void gd_getcolor(BYTE ind, BYTE *r, BYTE *g, BYTE *b) |
||
24 | { |
||
25 | outp(0x3c7, ind); |
||
26 | *r = inp(0x3c9); |
||
27 | *g = inp(0x3c9); |
||
28 | *b = inp(0x3c9); |
||
29 | } |
||
30 | |||
31 | void gd_setcolor(BYTE ind,BYTE r,BYTE g,BYTE b) |
||
32 | { |
||
33 | outp(0x3c8, ind); |
||
34 | outp(0x3c9, r); |
||
35 | outp(0x3c9, g); |
||
36 | outp(0x3c9, b); |
||
37 | } |
||
38 | |||
39 | void gd_getpalette(BYTE start, BYTE num, BYTE *pal) |
||
40 | { |
||
41 | int i; |
||
42 | |||
43 | for (i = start; i < start + num; i++) { |
||
44 | outp(0x3c7, i); |
||
45 | *pal++ = inp(0x3c9); |
||
46 | *pal++ = inp(0x3c9); |
||
47 | *pal++ = inp(0x3c9); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | void gd_setpalette(BYTE start, BYTE num, BYTE *pal) |
||
52 | { |
||
53 | int i; |
||
54 | |||
55 | for (i = start; i < start + num; i++) { |
||
56 | outp(0x3c8, i); |
||
57 | outp(0x3c9, *pal++); |
||
58 | outp(0x3c9, *pal++); |
||
59 | outp(0x3c9, *pal++); |
||
60 | } |
||
61 | } |