-
Notifications
You must be signed in to change notification settings - Fork 49
/
vgammvga.c
109 lines (93 loc) · 2.63 KB
/
vgammvga.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include "libvga.h"
#include "memio.h"
unsigned long __svgalib_vgammbase;
int __svgalib_mm_inmisc(void)
{
return v_readb(__svgalib_vgammbase+MIS_R);
}
void __svgalib_mm_outmisc(int i)
{
v_writeb(i, __svgalib_vgammbase+MIS_W);
}
int __svgalib_mm_incrtc(int i)
{
v_writeb(i, __svgalib_vgammbase+__svgalib_CRT_I);
return v_readb(__svgalib_vgammbase+__svgalib_CRT_D);
}
void __svgalib_mm_outcrtc(int i, int d)
{
v_writeb(i, __svgalib_vgammbase+__svgalib_CRT_I);
v_writeb(d, __svgalib_vgammbase+__svgalib_CRT_D);
}
int __svgalib_mm_inseq(int i)
{
v_writeb(i, __svgalib_vgammbase+SEQ_I);
return v_readb(__svgalib_vgammbase+SEQ_D);
}
void __svgalib_mm_outseq(int i, int val)
{
v_writeb(i, __svgalib_vgammbase+SEQ_I);
v_writeb(val, __svgalib_vgammbase+SEQ_D);
}
int __svgalib_mm_ingra(int index)
{
v_writeb(index, __svgalib_vgammbase+GRA_I);
return v_readb(__svgalib_vgammbase+GRA_D);
}
void __svgalib_mm_outgra(int index, int val)
{
v_writeb(index, __svgalib_vgammbase+GRA_I);
v_writeb(val, __svgalib_vgammbase+GRA_D);
}
int __svgalib_mm_inis1(void)
{
return v_readb(__svgalib_vgammbase+__svgalib_IS1_R);
}
int __svgalib_mm_inatt(int index)
{
__svgalib_mm_inis1();
v_writeb(index, __svgalib_vgammbase+ATT_IW);
return v_readb(__svgalib_vgammbase+ATT_R);
}
void __svgalib_mm_outatt(int index, int val)
{
__svgalib_mm_inis1();
v_writeb(index, __svgalib_vgammbase+ATT_IW);
v_writeb(val, __svgalib_vgammbase+ATT_IW);
}
void __svgalib_mm_attscreen(int i)
{
__svgalib_mm_inis1();
v_writeb(i, __svgalib_vgammbase+ATT_IW);
}
void __svgalib_mm_inpal(int i, int *r, int *g, int *b)
{
v_writeb(i, __svgalib_vgammbase+PEL_IR);
*r=v_readb(__svgalib_vgammbase+PEL_D);
*g=v_readb(__svgalib_vgammbase+PEL_D);
*b=v_readb(__svgalib_vgammbase+PEL_D);
}
void __svgalib_mm_outpal(int i, int r, int g, int b)
{
v_writeb(i, __svgalib_vgammbase+PEL_IW);
v_writeb(r, __svgalib_vgammbase+PEL_D);
v_writeb(g, __svgalib_vgammbase+PEL_D);
v_writeb(b, __svgalib_vgammbase+PEL_D);
}
void __svgalib_mm_io_mapio(void)
{
__svgalib_inmisc=__svgalib_mm_inmisc;
__svgalib_outmisc=__svgalib_mm_outmisc;
__svgalib_incrtc=__svgalib_mm_incrtc;
__svgalib_outcrtc=__svgalib_mm_outcrtc;
__svgalib_inseq=__svgalib_mm_inseq;
__svgalib_outseq=__svgalib_mm_outseq;
__svgalib_ingra=__svgalib_mm_ingra;
__svgalib_outgra=__svgalib_mm_outgra;
__svgalib_inatt=__svgalib_mm_inatt;
__svgalib_outatt=__svgalib_mm_outatt;
__svgalib_attscreen=__svgalib_mm_attscreen;
__svgalib_inis1=__svgalib_mm_inis1;
__svgalib_inpal=__svgalib_mm_inpal;
__svgalib_outpal=__svgalib_mm_outpal;
}