Specifications.
[pintos-anon] / specs / freevga / vga / attrreg.htm
1 <HTML>
2 <HEAD>
3    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4    <META NAME="Author" CONTENT="Joshua Neal">
5    <META NAME="Description" CONTENT="Pure VGA/SVGA hardware programming (registers, identification, and other low-level stuff.)">
6    <META NAME="KeyWords" CONTENT="VGA SVGA hardware video programming">
7    <TITLE>VGA/SVGA Video Programming--Attribute Controller Registers</TITLE>
8 </HEAD>
9 <BODY>
10
11 <CENTER><A HREF="../home.htm">Home</A> <A HREF="vga.htm#register">Back</A>&nbsp;
12 <HR WIDTH="100%"><B>Hardware Level VGA and SVGA Video Programming Information
13 Page</B></CENTER>
14
15 <CENTER>Attribute Controller Registers&nbsp;
16 <HR WIDTH="100%"></CENTER>
17
18
19 <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Attribute Controller
20 Registers are accessed via a pair of registers, the Attribute Address/Data
21 Register and the Attribute Data Read Register. See the <A HREF="vgareg.htm">Accessing
22 the VGA Registers</A> section for more detals. The Address/Data Register
23 is located at port 3C0h and the Data Read Register is located at port 3C1h.
24 <BR>&nbsp;
25 <TABLE BORDER WIDTH="600" CELLPADING="2" >
26 <CAPTION><A NAME="3C0"></A><B>Attribute Address Register(3C0h)</B></CAPTION>
27
28 <TR ALIGN=CENTER VALIGN=CENTER>
29 <TD WIDTH="75">7</TD>
30
31 <TD WIDTH="75">6</TD>
32
33 <TD WIDTH="75">5</TD>
34
35 <TD WIDTH="75">4</TD>
36
37 <TD WIDTH="75">3</TD>
38
39 <TD WIDTH="75">2</TD>
40
41 <TD WIDTH="75">1</TD>
42
43 <TD WIDTH="75">0</TD>
44 </TR>
45
46 <TR ALIGN=CENTER VALIGN=CENTER>
47 <TD WIDTH="75"></TD>
48
49 <TD WIDTH="75"></TD>
50
51 <TD WIDTH="75">PAS</TD>
52
53 <TD COLSPAN="5" WIDTH="375">Attribute Address</TD>
54 </TR>
55 </TABLE>
56 &nbsp;
57 <UL><B>PAS -- Palette Address Source<BR>
58 </B>"<I>This bit is set to 0 to load color values to the registers in the
59 internal palette. It is set to 1 for normal operation of the attribute
60 controller. Note: Do not access the internal palette while this bit is
61 set to 1. While this bit is 1, the Type 1 video subsystem disables accesses
62 to the palette; however, the Type 2 does not, and the actual color value
63 addressed cannot be ensured.</I>"
64 <LI>
65 <B>Attribute Address<BR>
66 </B>This field specifies the index value of the attribute register to be
67 read or written.</LI>
68 </UL>
69 &nbsp;
70 <TABLE BORDER WIDTH="600" CELLPADING="2" >
71 <CAPTION ALIGN=TOP><A NAME="000F"></A><B>Palette Registers (Index 00-0Fh)</B></CAPTION>
72
73 <TR ALIGN=CENTER VALIGN=CENTER>
74 <TD WIDTH="75">7</TD>
75
76 <TD WIDTH="75">6</TD>
77
78 <TD WIDTH="75">5</TD>
79
80 <TD WIDTH="75">4</TD>
81
82 <TD WIDTH="75">3</TD>
83
84 <TD WIDTH="75">2</TD>
85
86 <TD WIDTH="75">1</TD>
87
88 <TD WIDTH="75">0</TD>
89 </TR>
90
91 <TR ALIGN=CENTER VALIGN=CENTER>
92 <TD WIDTH="75"></TD>
93
94 <TD WIDTH="75"></TD>
95
96 <TD COLSPAN="6" WIDTH="450">Internal Palette Index</TD>
97 </TR>
98 </TABLE>
99 &nbsp;
100 <UL><B>Internal Palette Index<BR>
101 </B>"<I>These 6-bit registers allow a dynamic mapping between the text
102 attribute or graphic color input value and the display color on the CRT
103 screen. When set to 1, this bit selects the appropriate color. The Internal
104 Palette registers should be modified only during the vertical retrace interval
105 to avoid problems with the displayed image. These internal palette values
106 are sent off-chip to the video DAC, where they serve as addresses into
107 the DAC registers.</I>"</UL>
108 &nbsp;
109 <TABLE BORDER WIDTH="600" CELLPADING="2" >
110 <CAPTION ALIGN=TOP><A NAME="10"></A><B>Attribute Mode Control Register
111 (Index 10h)</B></CAPTION>
112
113 <TR ALIGN=CENTER VALIGN=CENTER>
114 <TD WIDTH="75">7</TD>
115
116 <TD WIDTH="75">6</TD>
117
118 <TD WIDTH="75">5</TD>
119
120 <TD WIDTH="75">4</TD>
121
122 <TD WIDTH="75">3</TD>
123
124 <TD WIDTH="75">2</TD>
125
126 <TD WIDTH="75">1</TD>
127
128 <TD WIDTH="75">0</TD>
129 </TR>
130
131 <TR ALIGN=CENTER VALIGN=CENTER>
132 <TD WIDTH="75">P54S</TD>
133
134 <TD WIDTH="75">8BIT</TD>
135
136 <TD WIDTH="75">PPM</TD>
137
138 <TD WIDTH="75"></TD>
139
140 <TD WIDTH="75">BLINK</TD>
141
142 <TD WIDTH="75">LGE</TD>
143
144 <TD WIDTH="75">MONO</TD>
145
146 <TD WIDTH="75">ATGE</TD>
147 </TR>
148 </TABLE>
149 &nbsp;
150 <UL><B>P54S -- Palette Bits 5-4 Select<BR>
151 </B>"<I>This bit selects the source for the P5 and P4 video bits that act
152 as inputs to the video DAC. When this bit is set to 0, P5 and P4 are the
153 outputs of the Internal Palette registers. When this bit is set to 1, P5
154 and P4 are bits 1 and 0 of the Color Select register.</I>"
155 <BR><B>8BIT -- 8-bit Color Enable<BR>
156 </B>"<I>When this bit is set to 1, the video data is sampled so that eight
157 bits are available to select a color in the 256-color mode (0x13). This
158 bit is set to 0 in all other modes.</I>"
159 <LI>
160 <B>PPM -- Pixel Panning Mode</B></LI>
161
162 <BR>This field allows the upper half of the screen to pan independently
163 of the lower screen. If this field is set to 0 then nothing special occurs
164 during a successful line compare (see the <A HREF="crtcreg.htm#18">Line
165 Compare</A> field.) If this field is set to 1, then upon a successful line
166 compare, the bottom portion of the screen is displayed as if the <A HREF="attrreg.htm#13">Pixel
167 Shift Count</A> and <A HREF="crtcreg.htm#08">Byte Panning</A> fields are
168 set to 0.
169 <BR><B>BLINK - Blink Enable<BR>
170 </B>"<I>When this bit is set to 0, the most-significant bit of the attribute
171 selects the background intensity (allows 16 colors for background). When
172 set to 1, this bit enables blinking.</I>"
173 <LI>
174 <B>LGA - Line Graphics Enable</B></LI>
175
176 <BR>This field is used in 9 bit wide character modes to provide continuity
177 for the horizontal line characters in the range C0h-DFh. If this field
178 is set to 0, then the 9th column of these characters is replicated from
179 the 8th column of the character. Otherwise, if it is set to 1 then the
180 9th column is set to the background like the rest of the characters.
181 <LI>
182 <B>MONO - Monochrome Emulation</B></LI>
183
184 <BR>This field is used to store your favorite bit. According to IBM, "When
185 this bit is set to 1, monochrome emulation mode is selected. When this
186 bit is set to 0, color |emulation mode is selected." It is present and
187 programmable in all of the hardware but it apparently does nothing. The
188 internal palette is used to provide monochrome emulation instead.
189 <LI>
190 <B>ATGE - Attribute Controller Graphics Enable<BR>
191 </B>"<I>When set to 1, this bit selects the graphics mode of operation.</I>"</LI>
192 </UL>
193 &nbsp;
194 <TABLE BORDER WIDTH="600" CELLPADING="2" >
195 <CAPTION><A NAME="11"></A><B>Overscan Color Register (Index 11h)</B></CAPTION>
196
197 <TR ALIGN=CENTER VALIGN=CENTER>
198 <TD WIDTH="75">7</TD>
199
200 <TD WIDTH="75">6</TD>
201
202 <TD WIDTH="75">5</TD>
203
204 <TD WIDTH="75">4</TD>
205
206 <TD WIDTH="75">3</TD>
207
208 <TD WIDTH="75">2</TD>
209
210 <TD WIDTH="75">1</TD>
211
212 <TD WIDTH="75">0</TD>
213 </TR>
214
215 <TR ALIGN=CENTER VALIGN=CENTER>
216 <TD COLSPAN="8" WIDTH="600">Overscan Palette Index</TD>
217 </TR>
218 </TABLE>
219 &nbsp;
220 <UL><B>Overscan Palette Index<BR>
221 </B>"<I>These bits select the border color used in the 80-column alphanumeric
222 modes and in the graphics modes other than modes 4, 5, and D. (Selects
223 a color from one of the DAC registers.)</I>"</UL>
224 &nbsp;
225 <TABLE BORDER WIDTH="600" CELLPADING="2" >
226 <CAPTION ALIGN=TOP><A NAME="12"></A><B>Color Plane Enable Register (Index
227 12h)</B></CAPTION>
228
229 <TR ALIGN=CENTER VALIGN=CENTER>
230 <TD WIDTH="75">7</TD>
231
232 <TD WIDTH="75">6</TD>
233
234 <TD WIDTH="75">5</TD>
235
236 <TD WIDTH="75">4</TD>
237
238 <TD WIDTH="75">3</TD>
239
240 <TD WIDTH="75">2</TD>
241
242 <TD WIDTH="75">1</TD>
243
244 <TD WIDTH="75">0</TD>
245 </TR>
246
247 <TR ALIGN=CENTER VALIGN=CENTER>
248 <TD WIDTH="75"></TD>
249
250 <TD WIDTH="75"></TD>
251
252 <TD WIDTH="75"></TD>
253
254 <TD WIDTH="75"></TD>
255
256 <TD COLSPAN="4" WIDTH="300">Color Plane Enable</TD>
257 </TR>
258 </TABLE>
259 &nbsp;
260 <UL>
261 <LI>
262 <B>Color Plane Enable<BR>
263 </B>"<I>Setting a bit to 1, enables the corresponding display-memory color
264 plane.</I>"</LI>
265 </UL>
266 &nbsp;
267 <TABLE BORDER WIDTH="600" CELLPADING="2" >
268 <CAPTION ALIGN=TOP><A NAME="13"></A><B>Horizontal Pixel Panning Register
269 (Index 13h)</B></CAPTION>
270
271 <TR ALIGN=CENTER VALIGN=CENTER>
272 <TD WIDTH="75">7</TD>
273
274 <TD WIDTH="75">6</TD>
275
276 <TD WIDTH="75">5</TD>
277
278 <TD WIDTH="75">4</TD>
279
280 <TD WIDTH="75">3</TD>
281
282 <TD WIDTH="75">2</TD>
283
284 <TD WIDTH="75">1</TD>
285
286 <TD WIDTH="75">0</TD>
287 </TR>
288
289 <TR ALIGN=CENTER VALIGN=CENTER>
290 <TD WIDTH="75"></TD>
291
292 <TD WIDTH="75"></TD>
293
294 <TD WIDTH="75"></TD>
295
296 <TD WIDTH="75"></TD>
297
298 <TD COLSPAN="4" WIDTH="300">Pixel Shift Count</TD>
299 </TR>
300 </TABLE>
301 &nbsp;
302 <UL><B>Pixel Shift Count<BR>
303 </B>"<I>These bits select the number of pels that the video data is shifted
304 to the left. PEL panning is available in both alphanumeric and graphics
305 modes.</I>"</UL>
306 &nbsp;
307 <TABLE BORDER WIDTH="600" CELLPADING="2" >
308 <CAPTION ALIGN=TOP><A NAME="14"></A><B>Color Select Register (Index 14h)</B></CAPTION>
309
310 <TR ALIGN=CENTER VALIGN=CENTER>
311 <TD WIDTH="75">7</TD>
312
313 <TD WIDTH="75">6</TD>
314
315 <TD WIDTH="75">5</TD>
316
317 <TD WIDTH="75">4</TD>
318
319 <TD WIDTH="75">3</TD>
320
321 <TD WIDTH="75">2</TD>
322
323 <TD WIDTH="75">1</TD>
324
325 <TD WIDTH="75">0</TD>
326 </TR>
327
328 <TR ALIGN=CENTER VALIGN=CENTER>
329 <TD WIDTH="75"></TD>
330
331 <TD WIDTH="75"></TD>
332
333 <TD WIDTH="75"></TD>
334
335 <TD WIDTH="75"></TD>
336
337 <TD COLSPAN="2" WIDTH="150">Color Select 7-6</TD>
338
339 <TD COLSPAN="2" WIDTH="150">Color Select 5-4</TD>
340 </TR>
341 </TABLE>
342 &nbsp;
343 <UL><B>Color Select 7-6<BR>
344 </B>"<I>In modes other than mode 13 hex, these are the two most-significant
345 bits of the 8-bit digital color value to the video DAC. In mode 13 hex,
346 the 8-bit attribute is the digital color value to the video DAC. These
347 bits are used to rapidly switch between sets of colors in the video DAC.</I>"
348 <BR><B>Color Select 5-4<BR>
349 </B>"<I>These bits can be used in place of the P4 and P5 bits from the
350 Internal Palette registers to form the&nbsp; 8-bit digital color value
351 to the video DAC. Selecting these bits is done in the Attribute Mode Control&nbsp;
352 register (index 0x10). These bits are used to rapidly switch between colors
353 sets within the video DAC.</I>"</UL>
354 Notice: All trademarks used or referred to on this page are the property
355 of their respective owners.
356 <BR>All pages are Copyright &copy; 1997, 1998, J. D. Neal, except where
357 noted. Permission for utilization and distribution is subject to the terms
358 of the <A HREF="license.htm">FreeVGA Project Copyright License</A>.
359 </BODY>
360 </HTML>