Specifications.
[pintos-anon] / specs / freevga / vga / crtcreg.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--CRT 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>CRT Controller Registers&nbsp;
16 <HR WIDTH="100%"></CENTER>
17
18
19 <P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The CRT Controller (CRTC)
20 Registers are accessed via a pair of registers, the CRTC Address Register
21 and the CRTC Data Register. See the <A HREF="vgareg.htm">Accessing the
22 VGA Registers</A> section for more details. The Address Register is located
23 at port 3x4h and the Data Register is located at port 3x5h.&nbsp; The value
24 of the x in 3x4h and 3x5h is dependent on the state of the <A HREF="extreg.htm#3CCR3C2W">Input/Output
25 Address Select</A> field, which allows these registers to be mapped at
26 3B4h-3B5h or 3D4h-3D5h.&nbsp;&nbsp; Note that when the <A HREF="#11">CRTC
27 Registers Protect Enable</A> field is set to 1, writing to register indexes
28 00h-07h is prevented, with the exception of the <A HREF="#07">Line Compare</A>
29 field of the <A HREF="#07">Overflow Register</A>.
30 <UL>
31 <LI>
32 Index 00h -- <A HREF="#00">Horizontal Total Register</A></LI>
33
34 <LI>
35 Index 01h -- <A HREF="#01">End Horizontal Display Register</A></LI>
36
37 <LI>
38 Index 02h -- <A HREF="#02">Start Horizontal Blanking Register</A></LI>
39
40 <LI>
41 Index 03h -- <A HREF="#03">End Horizontal Blanking Register</A></LI>
42
43 <LI>
44 Index 04h -- <A HREF="#04">Start Horizontal Retrace Register</A></LI>
45
46 <LI>
47 Index 05h -- <A HREF="#05">End Horizontal Retrace Register</A></LI>
48
49 <LI>
50 Index 06h -- <A HREF="#06">Vertical Total Register</A></LI>
51
52 <LI>
53 Index 07h -- <A HREF="#07">Overflow Register</A></LI>
54
55 <LI>
56 Index 08h -- <A HREF="#08">Preset Row Scan Register</A></LI>
57
58 <LI>
59 Index 09h -- <I><A HREF="#09">Maximum Scan Line Register</A></I></LI>
60
61 <LI>
62 Index 0Ah -- <A HREF="#0A">Cursor Start Register</A></LI>
63
64 <LI>
65 Index 0Bh -- <A HREF="#0B">Cursor End Register</A></LI>
66
67 <LI>
68 Index 0Ch -- <A HREF="#0C">Start Address High Register</A></LI>
69
70 <LI>
71 Index 0Dh -- <A HREF="#0D">Start Address Low Register</A></LI>
72
73 <LI>
74 Index 0Eh -- <A HREF="#0E">Cursor Location High Register</A></LI>
75
76 <LI>
77 Index 0Fh -- <A HREF="#0F">Cursor Location Low Register</A></LI>
78
79 <LI>
80 Index 10h -- <A HREF="#10">Vertical Retrace Start Register</A></LI>
81
82 <LI>
83 Index 11h -- <A HREF="#11">Vertical Retrace End Register</A></LI>
84
85 <LI>
86 Index 12h -- <A HREF="#12">Vertical Display End Register</A></LI>
87
88 <LI>
89 Index 13h -- <A HREF="#13">Offset Register</A></LI>
90
91 <LI>
92 Index 14h -- <I><A HREF="#14">Underline Location Register</A></I></LI>
93
94 <LI>
95 Index 15h -- <A HREF="#15">Start Vertical Blanking Register</A></LI>
96
97 <LI>
98 Index 16h -- <A HREF="#16">End Vertical Blanking</A></LI>
99
100 <LI>
101 Index 17h -- <I><A HREF="#17">CRTC Mode Control Register</A></I></LI>
102
103 <LI>
104 Index 18h -- <A HREF="#18">Line Compare Register</A></LI>
105 </UL>
106 &nbsp;
107 <TABLE BORDER WIDTH="600" CELLPADING="2" >
108 <CAPTION ALIGN=TOP><A NAME="00"></A><B>Horizontal Total Register (Index
109 00h)</B></CAPTION>
110
111 <TR ALIGN=CENTER VALIGN=CENTER>
112 <TD WIDTH="75">7</TD>
113
114 <TD WIDTH="75">6</TD>
115
116 <TD WIDTH="75">5</TD>
117
118 <TD WIDTH="75">4</TD>
119
120 <TD WIDTH="75">3</TD>
121
122 <TD WIDTH="75">2</TD>
123
124 <TD WIDTH="75">1</TD>
125
126 <TD WIDTH="75">0</TD>
127 </TR>
128
129 <TR ALIGN=CENTER VALIGN=CENTER>
130 <TD COLSPAN="8" WIDTH="600">Horizontal Total</TD>
131 </TR>
132 </TABLE>
133 &nbsp;
134 <UL>
135 <LI>
136 <B>Horizontal Total</B></LI>
137
138 <BR>This field is used to specify the number of character clocks per scan
139 line.&nbsp; This field, along with the dot rate selected, controls the
140 horizontal refresh rate of the VGA by specifying the amount of time one
141 scan line takes.&nbsp; This field is not programmed with the actual number
142 of character clocks, however.&nbsp; Due to timing factors of the VGA hardware
143 (which, for compatibility purposes has been emulated by VGA compatible&nbsp;
144 chipsets), the actual horizontal total is 5 character clocks more than
145 the value stored in this field, thus one needs to subtract 5 from the actual
146 horizontal total value desired before programming it into this register.</UL>
147 &nbsp;
148 <TABLE BORDER WIDTH="600" CELLPADING="2" >
149 <CAPTION ALIGN=TOP><A NAME="01"></A><B>End Horizontal Display Register
150 (Index 01h)</B></CAPTION>
151
152 <TR ALIGN=CENTER VALIGN=CENTER>
153 <TD WIDTH="75">7</TD>
154
155 <TD WIDTH="75">6</TD>
156
157 <TD WIDTH="75">5</TD>
158
159 <TD WIDTH="75">4</TD>
160
161 <TD WIDTH="75">3</TD>
162
163 <TD WIDTH="75">2</TD>
164
165 <TD WIDTH="75">1</TD>
166
167 <TD WIDTH="75">0</TD>
168 </TR>
169
170 <TR ALIGN=CENTER VALIGN=CENTER>
171 <TD COLSPAN="8" WIDTH="600">End Horizontal Display</TD>
172 </TR>
173 </TABLE>
174 &nbsp;
175 <UL>
176 <LI>
177 <B>End Horizontal Display</B></LI>
178
179 <BR>This field is used to control the point that the sequencer stops outputting
180 pixel values from display memory, and sequences the pixel value specified
181 by the <A HREF="attrreg.htm#11">Overscan Palette Index</A> field for the
182 remainder of the scan line.&nbsp; The overscan begins the character clock
183 after the the value programmed into this field.&nbsp; This register should
184 be programmed with the number of character clocks in the active display
185 - 1.&nbsp; Note that the active display may be affected by the <A HREF="#03">Display
186 Enable Skew</A> field.
187 <BR>&nbsp;</UL>
188 &nbsp;
189 <TABLE BORDER WIDTH="600" CELLPADING="2" >
190 <CAPTION ALIGN=TOP><A NAME="02"></A><B>Start Horizontal Blanking Register
191 (Index 02h)</B></CAPTION>
192
193 <TR ALIGN=CENTER VALIGN=CENTER>
194 <TD WIDTH="75">7</TD>
195
196 <TD WIDTH="75">6</TD>
197
198 <TD WIDTH="75">5</TD>
199
200 <TD WIDTH="75">4</TD>
201
202 <TD WIDTH="75">3</TD>
203
204 <TD WIDTH="75">2</TD>
205
206 <TD WIDTH="75">1</TD>
207
208 <TD WIDTH="75">0</TD>
209 </TR>
210
211 <TR ALIGN=CENTER VALIGN=CENTER>
212 <TD COLSPAN="8" WIDTH="600">Start Horizontal Blanking</TD>
213 </TR>
214 </TABLE>
215 &nbsp;
216 <UL>
217 <LI>
218 <B>Start Horizontal Blanking</B></LI>
219
220 <BR>This field is used to specify the character clock at which the horizontal
221 blanking period begins.&nbsp; During the horizontal blanking period, the
222 VGA hardware forces the DAC into a blanking state, where all of the intensities
223 output are at minimum value, no matter what color information the attribute
224 controller is sending to the DAC.&nbsp; This field works in conjunction
225 with the <A HREF="#03">End Horizontal Blanking</A> field to specify the
226 horizontal blanking period.&nbsp; Note that the horizontal blanking can
227 be programmed to appear anywhere within the scan line, as well as being
228 programmed to a value greater than the <A HREF="crtcreg.htm#00">Horizontal
229 Total</A> field preventing the horizontal blanking from occurring at all.</UL>
230 &nbsp;
231 <TABLE BORDER WIDTH="600" CELLPADING="2" >
232 <CAPTION ALIGN=TOP><A NAME="03"></A><B>End Horizontal Blanking Register
233 (Index 03h)</B></CAPTION>
234
235 <TR ALIGN=CENTER VALIGN=CENTER>
236 <TD WIDTH="75">7</TD>
237
238 <TD WIDTH="75">6</TD>
239
240 <TD WIDTH="75">5</TD>
241
242 <TD WIDTH="75">4</TD>
243
244 <TD WIDTH="75">3</TD>
245
246 <TD WIDTH="75">2</TD>
247
248 <TD WIDTH="75">1</TD>
249
250 <TD WIDTH="75">0</TD>
251 </TR>
252
253 <TR ALIGN=CENTER VALIGN=CENTER>
254 <TD WIDTH="75">EVRA</TD>
255
256 <TD COLSPAN="2" WIDTH="150">Display Enable Skew</TD>
257
258 <TD COLSPAN="5" WIDTH="375">End Horizontal Blanking</TD>
259 </TR>
260 </TABLE>
261 &nbsp;
262 <UL>
263 <LI>
264 <B>EVRA -- Enable Vertical Retrace Access</B></LI>
265
266 <BR>This field was used in the IBM EGA to provide access to the light pen
267 input values as the light pen registers were mapped over CRTC indexes 10h-11h.&nbsp;
268 The VGA lacks capability for light pen input, thus this field is normally
269 forced to 1 (although always writing it as 1 might be a good idea for compatibility)
270 , which in the EGA would enable access to the vertical retrace fields instead
271 of the light pen fields.
272 <LI>
273 <B>Display Enable Skew</B></LI>
274
275 <BR>This field affects the timings of the display enable circuitry in the
276 VGA. The value of this field is the number of character clocks that the
277 display enable "signal" is delayed.&nbsp; In all the VGA/SVGA chipsets
278 I've tested, including a PS/2 VGA this field is always programmed to 0.&nbsp;
279 Programming it to non-zero values results in the overscan being displayed
280 over the number of characters programmed into this field at the beginning
281 of the scan line, as well as the end of the active display being shifted
282 the number of characters programmed into this field.&nbsp; The characters
283 that extend past the normal end of the active display can be garbled in
284 certain circumstances that is dependent on the particular VGA implementation.&nbsp;
285 According to documentation from IBM, "<I>This skew control is needed to
286 provide sufficient time for the CRT controller to read a character and
287 attribute code from the video buffer, to gain access to the character generator,
288 and go through the Horizontal PEL Panning register in the attribute controller.
289 Each access requires the 'display enable' signal to be skewed one character
290 clock so that the video output is synchronized with the horizontal and
291 vertical retrace signals.</I>" as well as "<I>Note: Character skew is not
292 adjustable on the Type 2 video and the bits are ignored; however, programs
293 should set these bits for the appropriate skew to maintain compatibility.</I>"&nbsp;
294 This may be required for some early IBM VGA implementations or may be simply
295 an unused "feature" carried over along with its register description from
296 the IBM EGA implementations that require the use of this field.
297 <LI>
298 <B>End Horizontal Blanking</B></LI>
299
300 <BR>This contains bits 4-0 of the End Horizontal Blanking field which specifies
301 the end of the horizontal blanking period.&nbsp; Bit 5 is located After
302 the period has begun as specified by the <A HREF="#02">Start Horizontal
303 Blanking</A> field, the 6-bit value of this field is compared against the
304 lower 6 bits of the character clock.&nbsp; When a match occurs, the horizontal
305 blanking signal is disabled.&nbsp; This provides from 1 to 64 character
306 clocks although some implementations may match in the character clock specified
307 by the <A HREF="#02">Start Horizontal Blanking</A> field, in which case
308 the range is 0 to 63.&nbsp; Note that if blanking extends past the end
309 of the scan line, it will end on the first match of this field on the next
310 scan line.</UL>
311 &nbsp;
312 <TABLE BORDER WIDTH="600" CELLPADING="2" >
313 <CAPTION ALIGN=TOP><A NAME="04"></A><B>Start Horizontal Retrace Register
314 (Index 04h)</B></CAPTION>
315
316 <TR ALIGN=CENTER VALIGN=CENTER>
317 <TD WIDTH="75">7</TD>
318
319 <TD WIDTH="75">6</TD>
320
321 <TD WIDTH="75">5</TD>
322
323 <TD WIDTH="75">4</TD>
324
325 <TD WIDTH="75">3</TD>
326
327 <TD WIDTH="75">2</TD>
328
329 <TD WIDTH="75">1</TD>
330
331 <TD WIDTH="75">0</TD>
332 </TR>
333
334 <TR ALIGN=CENTER VALIGN=CENTER>
335 <TD COLSPAN="8" WIDTH="600">Start Horizontal Retrace</TD>
336 </TR>
337 </TABLE>
338 &nbsp;
339 <UL>
340 <LI>
341 <B>Start Horizontal Retrace</B></LI>
342
343 <BR>This field specifies the character clock at which the VGA begins sending
344 the horizontal synchronization pulse to the display which signals the monitor
345 to retrace back to the left side of the screen.&nbsp; The end of this pulse
346 is controlled by the <A HREF="#05">End Horizontal Retrace</A> field.&nbsp;
347 This pulse may appear anywhere in the scan line, as well as set to a position
348 beyond the <A HREF="crtcreg.htm#00">Horizontal Total</A> field which effectively
349 disables the horizontal synchronization pulse.</UL>
350 &nbsp;
351 <TABLE BORDER WIDTH="600" CELLPADING="2" >
352 <CAPTION ALIGN=TOP><A NAME="05"></A><B>End Horizontal Retrace Register
353 (Index 05h)</B></CAPTION>
354
355 <TR ALIGN=CENTER VALIGN=CENTER>
356 <TD WIDTH="75">7</TD>
357
358 <TD WIDTH="75">6</TD>
359
360 <TD WIDTH="75">5</TD>
361
362 <TD WIDTH="75">4</TD>
363
364 <TD WIDTH="75">3</TD>
365
366 <TD WIDTH="75">2</TD>
367
368 <TD WIDTH="75">1</TD>
369
370 <TD WIDTH="75">0</TD>
371 </TR>
372
373 <TR ALIGN=CENTER VALIGN=CENTER>
374 <TD WIDTH="75">EHB5</TD>
375
376 <TD COLSPAN="2" WIDTH="150">Horiz. Retrace Skew</TD>
377
378 <TD COLSPAN="5" WIDTH="375">End Horizontal Retrace</TD>
379 </TR>
380 </TABLE>
381 &nbsp;
382 <UL>
383 <LI>
384 <B>EHB5 -- End Horizontal Blanking (bit 5)</B></LI>
385
386 <BR>This contains bit 5 of the End Horizontal Blanking field.&nbsp; See
387 the <A HREF="#03">End Horizontal Blanking Register</A> for details.
388 <LI>
389 <B>Horiz. Retrace Skew -- Horizontal Retrace Skew</B></LI>
390
391 <BR>This field delays the start of the horizontal retrace period by the
392 number of character clocks equal to the value of this field.&nbsp; From
393 observation, this field is programmed to 0, with the exception of the 40
394 column text modes where this field is set to 1.&nbsp; The VGA hardware
395 simply acts as if this value is added to the <A HREF="#04">Start Horizontal
396 Retrace</A> field.&nbsp; According to IBM documentation, "<I>For certain
397 modes, the 'horizontal retrace' signal takes up the entire blanking interval.
398 Some internal timings are generated by the falling edge of the 'horizontal
399 retrace' signal. To ensure that the signals are latched properly, the 'retrace'
400 signal is started before the end of the 'display enable' signal and then
401 skewed several character clock times to provide the proper screen centering.</I>"&nbsp;
402 This does not appear to be the case, leading me to believe this is yet
403 another holdout from the IBM EGA implementations that do require the use
404 of this field.
405 <LI>
406 <B>End Horizontal Retrace</B></LI>
407
408 <BR>This field specifies the end of the horizontal retrace period, which
409 begins at the character clock specified in the <A HREF="#04">Start Horizontal
410 Retrace</A> field.&nbsp; The horizontal retrace signal is enabled until
411 the lower 5 bits of the character counter match the 5 bits of this field.&nbsp;
412 This provides for a horizontal retrace period from 1 to 32 character clocks.&nbsp;
413 Note that some implementations may match immediately instead of 32 clocks
414 away, making the effective range 0 to 31 character clocks.</UL>
415 &nbsp;
416 <TABLE BORDER WIDTH="600" CELLPADING="2" >
417 <CAPTION ALIGN=TOP><A NAME="06"></A><B>Vertical Total Register (Index 06h)</B></CAPTION>
418
419 <TR ALIGN=CENTER VALIGN=CENTER>
420 <TD WIDTH="75">7</TD>
421
422 <TD WIDTH="75">6</TD>
423
424 <TD WIDTH="75">5</TD>
425
426 <TD WIDTH="75">4</TD>
427
428 <TD WIDTH="75">3</TD>
429
430 <TD WIDTH="75">2</TD>
431
432 <TD WIDTH="75">1</TD>
433
434 <TD WIDTH="75">0</TD>
435 </TR>
436
437 <TR ALIGN=CENTER VALIGN=CENTER>
438 <TD COLSPAN="8" WIDTH="600">Vertical Total</TD>
439 </TR>
440 </TABLE>
441 &nbsp;
442 <UL><B>Vertical Total</B>
443 <BR>This contains the lower 8 bits of the Vertical Total field.&nbsp; Bits
444 9-8 of this field are located in the <A HREF="#07">Overflow Register</A>.
445 This field determines the number of scanlines in the active display and
446 thus the length of each vertical retrace.&nbsp; This field contains the
447 value of the scanline counter at the beginning of the last scanline in
448 the vertical period.</UL>
449 &nbsp;
450 <TABLE BORDER WIDTH="600" CELLPADING="2" >
451 <CAPTION ALIGN=TOP><A NAME="07"></A><B>Overflow Register (Index 07h)</B></CAPTION>
452
453 <TR ALIGN=CENTER VALIGN=CENTER>
454 <TD WIDTH="75">7</TD>
455
456 <TD WIDTH="75">6</TD>
457
458 <TD WIDTH="75">5</TD>
459
460 <TD WIDTH="75">4</TD>
461
462 <TD WIDTH="75">3</TD>
463
464 <TD WIDTH="75">2</TD>
465
466 <TD WIDTH="75">1</TD>
467
468 <TD WIDTH="75">0</TD>
469 </TR>
470
471 <TR ALIGN=CENTER VALIGN=CENTER>
472 <TD WIDTH="75">VRS9</TD>
473
474 <TD WIDTH="75">VDE9</TD>
475
476 <TD WIDTH="75">VT9</TD>
477
478 <TD WIDTH="75">LC8</TD>
479
480 <TD WIDTH="75">SVB8</TD>
481
482 <TD WIDTH="75">VRS8</TD>
483
484 <TD WIDTH="75">VDE8</TD>
485
486 <TD WIDTH="75">VT8</TD>
487 </TR>
488 </TABLE>
489 &nbsp;
490 <UL>
491 <LI>
492 <B>VRS9 -- Vertical Retrace Start (bit 9)</B></LI>
493
494 <BR>Specifies bit 9 of the Vertical Retrace Start field.&nbsp; See the
495 <A HREF="#10">Vertical Retrace Start Register</A> for details.
496 <LI>
497 <B>VDE9 -- Vertical Display End (bit9)</B></LI>
498
499 <BR>Specifies bit 9 of the Vertical Display End field.&nbsp; See the <A HREF="#12">Vertical
500 Display End Register</A> for details.
501 <LI>
502 <B>VT9 -- Vertical Total (bit 9)</B></LI>
503
504 <BR>Specifies bit 9 of the Vertical Total field.&nbsp; See the <A HREF="#06">Vertical
505 Total Register</A> for details.
506 <LI>
507 <B>LC8 -- Line Compare (bit 8)</B></LI>
508
509 <BR>Specifies bit 8 of the Line Compare field. See the <A HREF="#18">Line
510 Compare Register</A> for details.
511 <LI>
512 <B>SVB8 -- Start Vertical Blanking (bit 8)</B></LI>
513
514 <BR>Specifies bit 8 of the Start Vertical Blanking field.&nbsp; See the
515 <A HREF="#15">Start Vertical Blanking Register</A> for details.
516 <LI>
517 <B>VRS8 -- Vertical Retrace Start (bit 8)</B></LI>
518
519 <BR>Specifies bit 8 of the Vertical Retrace Start field.&nbsp; See the
520 <A HREF="#10">Vertical Retrace Start Register</A> for details.
521 <LI>
522 <B>VDE8 -- Vertical Display End (bit 8)</B></LI>
523
524 <BR>Specifies bit 8 of the Vertical Display End field.&nbsp; See the <A HREF="#12">Vertical
525 Display End Register</A> for details.
526 <LI>
527 <B>VT8 -- Vertical Total (bit 8)</B></LI>
528
529 <BR>Specifies bit 8 of the Vertical Total field.&nbsp; See the <A HREF="#06">Vertical
530 Total Register</A> for details.</UL>
531 &nbsp;
532 <TABLE BORDER WIDTH="600" CELLPADING="2" >
533 <CAPTION ALIGN=TOP><A NAME="08"></A><B>Preset Row Scan Register (Index
534 08h)</B></CAPTION>
535
536 <TR ALIGN=CENTER VALIGN=CENTER>
537 <TD WIDTH="75">7</TD>
538
539 <TD WIDTH="75">6</TD>
540
541 <TD WIDTH="75">5</TD>
542
543 <TD WIDTH="75">4</TD>
544
545 <TD WIDTH="75">3</TD>
546
547 <TD WIDTH="75">2</TD>
548
549 <TD WIDTH="75">1</TD>
550
551 <TD WIDTH="75">0</TD>
552 </TR>
553
554 <TR ALIGN=CENTER VALIGN=CENTER>
555 <TD WIDTH="75"></TD>
556
557 <TD COLSPAN="2" WIDTH="150">Byte Panning</TD>
558
559 <TD COLSPAN="5" WIDTH="375">Preset Row Scan</TD>
560 </TR>
561 </TABLE>
562 &nbsp;
563 <UL>
564 <LI>
565 <B>Byte Panning</B></LI>
566
567 <BR>The value of this field is added to the <A HREF="crtcreg.htm#0D">Start
568 Address Register</A> when calculating the display memory address for the
569 upper left hand pixel or character of the screen. This allows for a maximum
570 shift of 15, 31, or 35 pixels without having to reprogram the <A HREF="crtcreg.htm#0D">Start
571 Address Register</A>.
572 <LI>
573 <B>Preset Row Scan</B></LI>
574
575 <BR>This field is used when using text mode or any mode with a non-zero
576 <A HREF="crtcreg.htm#09">Maximum Scan Line</A> field to provide for more
577 precise vertical scrolling than the <A HREF="crtcreg.htm#0D">Start Address
578 Register</A> provides. The value of this field specifies how many scan
579 lines to scroll the display upwards. Valid values range from 0 to the value
580 of the <A HREF="crtcreg.htm#09">Maximum Scan Line</A> field. Invalid values
581 may cause undesired effects and seem to be dependent upon the particular
582 VGA implementation.</UL>
583 &nbsp;
584 <TABLE BORDER WIDTH="600" CELLPADING="2" >
585 <CAPTION ALIGN=TOP><A NAME="09"></A><B>Maximum Scan Line Register (Index
586 09h)</B></CAPTION>
587
588 <TR ALIGN=CENTER VALIGN=CENTER>
589 <TD WIDTH="75">7</TD>
590
591 <TD WIDTH="75">6</TD>
592
593 <TD WIDTH="75">5</TD>
594
595 <TD WIDTH="75">4</TD>
596
597 <TD WIDTH="75">3</TD>
598
599 <TD WIDTH="75">2</TD>
600
601 <TD WIDTH="75">1</TD>
602
603 <TD WIDTH="75">0</TD>
604 </TR>
605
606 <TR ALIGN=CENTER VALIGN=CENTER>
607 <TD WIDTH="75">SD</TD>
608
609 <TD WIDTH="75">LC9</TD>
610
611 <TD WIDTH="75">SVB9</TD>
612
613 <TD COLSPAN="5" WIDTH="375">Maximum Scan Line</TD>
614 </TR>
615 </TABLE>
616 &nbsp;
617 <UL><B>SD -- Scan Doubling<BR>
618 </B>"<I>When this bit is set to 1, 200-scan-line video data is converted
619 to 400-scan-line output. To do this, the clock in the row scan counter
620 is divided by 2, which allows the 200-line modes to be displayed as 400
621 lines on the display (this is called double scanning; each line is displayed
622 twice). When this bit is set to 0, the clock to the row scan counter is
623 equal to the horizontal scan rate.</I>"
624 <LI>
625 <B>LC9 -- Line Compare (bit 9)</B></LI>
626
627 <BR>Specifies bit 9 of the Line Compare field. See the <A HREF="#18">Line
628 Compare Register</A> for details.
629 <LI>
630 <B>SVB9 -- Start Vertical Blanking (bit 9)</B></LI>
631
632 <BR>Specifies bit 9 of the Start Vertical Blanking field.&nbsp; See the
633 <A HREF="#15">Start Vertical Blanking Register</A> for details.
634 <LI>
635 <B>Maximum Scan Line</B></LI>
636
637 <BR>In text modes, this field is programmed with the character height -
638 1 (scan line numbers are zero based.) In graphics modes, a non-zero value
639 in this field will cause each scan line to be repeated by the value of
640 this field + 1.</UL>
641 &nbsp;
642 <TABLE BORDER WIDTH="600" CELLPADING="2" >
643 <CAPTION ALIGN=TOP><A NAME="0A"></A><B>Cursor Start Register (Index 0Ah)</B></CAPTION>
644
645 <TR ALIGN=CENTER VALIGN=CENTER>
646 <TD WIDTH="75">7</TD>
647
648 <TD WIDTH="75">6</TD>
649
650 <TD WIDTH="75">5</TD>
651
652 <TD WIDTH="75">4</TD>
653
654 <TD WIDTH="75">3</TD>
655
656 <TD WIDTH="75">2</TD>
657
658 <TD WIDTH="75">1</TD>
659
660 <TD WIDTH="75">0</TD>
661 </TR>
662
663 <TR ALIGN=CENTER VALIGN=CENTER>
664 <TD WIDTH="75"></TD>
665
666 <TD WIDTH="75"></TD>
667
668 <TD WIDTH="75">CD</TD>
669
670 <TD COLSPAN="5" WIDTH="375">Cursor Scan Line Start</TD>
671 </TR>
672 </TABLE>
673 &nbsp;
674 <UL>
675 <LI>
676 <B>CD -- Cursor Disable</B></LI>
677
678 <BR>This field controls whether or not the text-mode cursor is displayed.
679 Values are:
680 <UL>
681 <LI>
682 0 -- Cursor Enabled</LI>
683
684 <LI>
685 1 -- Cursor Disabled</LI>
686 </UL>
687
688 <LI>
689 <B>Cursor Scan Line Start</B></LI>
690
691 <BR>This field controls the appearance of the text-mode cursor by specifying
692 the scan line location within a character cell at which the cursor should
693 begin, with the top-most scan line in a character cell being 0 and the
694 bottom being with the value of the <A HREF="#09">Maximum Scan Line</A>
695 field.</UL>
696 &nbsp;
697 <TABLE BORDER WIDTH="600" CELLPADING="2" >
698 <CAPTION ALIGN=TOP>&nbsp;<A NAME="0B"></A><B>Cursor End Register (Index
699 0Bh)</B></CAPTION>
700
701 <TR ALIGN=CENTER VALIGN=CENTER>
702 <TD WIDTH="75">7</TD>
703
704 <TD WIDTH="75">6</TD>
705
706 <TD WIDTH="75">5</TD>
707
708 <TD WIDTH="75">4</TD>
709
710 <TD WIDTH="75">3</TD>
711
712 <TD WIDTH="75">2</TD>
713
714 <TD WIDTH="75">1</TD>
715
716 <TD WIDTH="75">0</TD>
717 </TR>
718
719 <TR ALIGN=CENTER VALIGN=CENTER>
720 <TD WIDTH="75"></TD>
721
722 <TD COLSPAN="2" WIDTH="150">Cursor Skew</TD>
723
724 <TD COLSPAN="5" WIDTH="375">Cursor Scan Line End</TD>
725 </TR>
726 </TABLE>
727 &nbsp;
728 <UL>
729 <LI>
730 <B>CSK -- Cursor Skew</B></LI>
731
732 <BR>This field was necessary in the EGA to synchronize the cursor with
733 internal timing. In the VGA it basically is added to the cursor location.
734 In some cases when this value is non-zero and the cursor is near the left
735 or right edge of the screen, the cursor will not appear at all, or a second
736 cursor above and to the left of the actual one may appear. This behavior
737 may not be the same on all VGA compatible adapter cards.
738 <LI>
739 <B>Cursor Scan Line End</B></LI>
740
741 <BR>This field controls the appearance of the text-mode cursor by specifying
742 the scan line location within a character cell at which the cursor should
743 end, with the top-most scan line in a character cell being 0 and the bottom
744 being with the value of the <A HREF="#09">Maximum Scan Line</A> field.
745 If this field is less than the <A HREF="#0A">Cursor Scan Line Start</A>
746 field, the cursor is not drawn. Some graphics adapters, such as the IBM
747 EGA display a split-block cursor instead.</UL>
748 &nbsp;
749 <TABLE BORDER WIDTH="600" CELLPADING="2" >
750 <CAPTION ALIGN=TOP><A NAME="0C"></A><B>Start Address High Register (Index
751 0Ch)</B></CAPTION>
752
753 <TR ALIGN=CENTER VALIGN=CENTER>
754 <TD WIDTH="75">7</TD>
755
756 <TD WIDTH="75">6</TD>
757
758 <TD WIDTH="75">5</TD>
759
760 <TD WIDTH="75">4</TD>
761
762 <TD WIDTH="75">3</TD>
763
764 <TD WIDTH="75">2</TD>
765
766 <TD WIDTH="75">1</TD>
767
768 <TD WIDTH="75">0</TD>
769 </TR>
770
771 <TR ALIGN=CENTER VALIGN=CENTER>
772 <TD COLSPAN="8" WIDTH="600">Start Address High</TD>
773 </TR>
774 </TABLE>
775 &nbsp;
776 <UL>
777 <LI>
778 <B>Start Address High</B></LI>
779
780 <BR>This contains specifies bits 15-8 of the Start Address field. See the
781 <A HREF="#0D">Start Address Low Register</A> for details.</UL>
782 &nbsp;
783 <TABLE BORDER WIDTH="600" CELLPADING="2" >
784 <CAPTION ALIGN=TOP><A NAME="0D"></A><B>Start Address Low Register (Index
785 0Dh)</B></CAPTION>
786
787 <TR ALIGN=CENTER VALIGN=CENTER>
788 <TD WIDTH="75">7</TD>
789
790 <TD WIDTH="75">6</TD>
791
792 <TD WIDTH="75">5</TD>
793
794 <TD WIDTH="75">4</TD>
795
796 <TD WIDTH="75">3</TD>
797
798 <TD WIDTH="75">2</TD>
799
800 <TD WIDTH="75">1</TD>
801
802 <TD WIDTH="75">0</TD>
803 </TR>
804
805 <TR ALIGN=CENTER VALIGN=CENTER>
806 <TD COLSPAN="8" WIDTH="600">Start Address Low</TD>
807 </TR>
808 </TABLE>
809 &nbsp;
810 <UL>
811 <LI>
812 <B>Start Address Low</B></LI>
813
814 <BR>This contains the bits 7-0 of the Start Address field. The upper 8
815 bits are specified by the <A HREF="#0C">Start Address High Register</A>.
816 The Start Address field specifies the display memory address of the upper
817 left pixel or character of the screen. Because the standard VGA has a maximum
818 of 256K of memory, and memory is accessed 32 bits at a time, this 16-bit
819 field is sufficient to allow the screen to start at any memory address.
820 Normally this field is programmed to 0h, except when using virtual resolutions,
821 paging, and/or split-screen operation. Note that the VGA display will wrap
822 around in display memory if the starting address is too high. (This may
823 or may not be desirable, depending on your intentions.)</UL>
824 &nbsp;
825 <TABLE BORDER WIDTH="600" CELLPADING="2" >
826 <CAPTION><A NAME="0E"></A><B>Cursor Location High Register (Index 0Eh)</B></CAPTION>
827
828 <TR ALIGN=CENTER VALIGN=CENTER>
829 <TD WIDTH="75">7</TD>
830
831 <TD WIDTH="75">6</TD>
832
833 <TD WIDTH="75">5</TD>
834
835 <TD WIDTH="75">4</TD>
836
837 <TD WIDTH="75">3</TD>
838
839 <TD WIDTH="75">2</TD>
840
841 <TD WIDTH="75">1</TD>
842
843 <TD WIDTH="75">0</TD>
844 </TR>
845
846 <TR ALIGN=CENTER VALIGN=CENTER>
847 <TD COLSPAN="8" WIDTH="600">Cursor Location High</TD>
848 </TR>
849 </TABLE>
850 &nbsp;
851 <UL>
852 <LI>
853 <B>Cursor Location High</B></LI>
854
855 <BR>This field specifies bits 15-8 of the Cursor Location field. See the
856 <A HREF="#0F">Cursor Location Low Register</A> for details.</UL>
857 &nbsp;
858 <TABLE BORDER WIDTH="600" CELLPADING="2" >
859 <CAPTION ALIGN=TOP><A NAME="0F"></A><B>Cursor Location Low Register (Index
860 0Fh)</B></CAPTION>
861
862 <TR ALIGN=CENTER VALIGN=CENTER>
863 <TD WIDTH="75">7</TD>
864
865 <TD WIDTH="75">6</TD>
866
867 <TD WIDTH="75">5</TD>
868
869 <TD WIDTH="75">4</TD>
870
871 <TD WIDTH="75">3</TD>
872
873 <TD WIDTH="75">2</TD>
874
875 <TD WIDTH="75">1</TD>
876
877 <TD WIDTH="75">0</TD>
878 </TR>
879
880 <TR ALIGN=CENTER VALIGN=CENTER>
881 <TD COLSPAN="8" WIDTH="600">Cursor Location Low</TD>
882 </TR>
883 </TABLE>
884 &nbsp;
885 <UL>
886 <LI>
887 <B>Cursor Location Low</B></LI>
888
889 <BR>This field specifies bits 7-0 of the Cursor Location field. When the
890 VGA hardware is displaying text mode and the text-mode cursor is enabled,
891 the hardware compares the address of the character currently being displayed
892 with sum of value of this field and the sum of the <A HREF="#0B">Cursor
893 Skew</A> field. If the values equal then the scan lines in that character
894 specified by the <A HREF="#0A">Cursor Scan Line Start</A> field and the
895 <A HREF="#0B">Cursor Scan Line End</A> field are replaced with the foreground
896 color.</UL>
897 &nbsp;
898 <TABLE BORDER WIDTH="600" CELLPADING="2" >
899 <CAPTION ALIGN=TOP><A NAME="10"></A><B>Vertical Retrace Start Register
900 (Index 10h)</B></CAPTION>
901
902 <TR ALIGN=CENTER VALIGN=CENTER>
903 <TD WIDTH="75">7</TD>
904
905 <TD WIDTH="75">6</TD>
906
907 <TD WIDTH="75">5</TD>
908
909 <TD WIDTH="75">4</TD>
910
911 <TD WIDTH="75">3</TD>
912
913 <TD WIDTH="75">2</TD>
914
915 <TD WIDTH="75">1</TD>
916
917 <TD WIDTH="75">0</TD>
918 </TR>
919
920 <TR ALIGN=CENTER VALIGN=CENTER>
921 <TD COLSPAN="8" WIDTH="600">Vertical Retrace Start</TD>
922 </TR>
923 </TABLE>
924 &nbsp;
925 <UL>
926 <LI>
927 <B>Vertical Retrace Start</B></LI>
928
929 <BR>This field specifies bits 7-0 of the Vertical Retrace Start field.&nbsp;
930 Bits 9-8 are located in the <A HREF="#07">Overflow Register</A>.&nbsp;
931 This field controls the start of the vertical retrace pulse which signals
932 the display to move up to the beginning of the active display.&nbsp; This
933 field contains the value of the vertical scanline counter at the beginning
934 of the first scanline where the vertical retrace signal is asserted.</UL>
935 &nbsp;
936 <TABLE BORDER WIDTH="600" CELLPADING="2" >
937 <CAPTION ALIGN=TOP><A NAME="11"></A><B>Vertical Retrace End Register (Index
938 11h)</B></CAPTION>
939
940 <TR ALIGN=CENTER VALIGN=CENTER>
941 <TD WIDTH="75">7</TD>
942
943 <TD WIDTH="75">6</TD>
944
945 <TD WIDTH="75">5</TD>
946
947 <TD WIDTH="75">4</TD>
948
949 <TD WIDTH="75">3</TD>
950
951 <TD WIDTH="75">2</TD>
952
953 <TD WIDTH="75">1</TD>
954
955 <TD WIDTH="75">0</TD>
956 </TR>
957
958 <TR ALIGN=CENTER VALIGN=CENTER>
959 <TD WIDTH="75">Protect</TD>
960
961 <TD WIDTH="75">Bandwidth</TD>
962
963 <TD WIDTH="75"></TD>
964
965 <TD WIDTH="75"></TD>
966
967 <TD COLSPAN="4" WIDTH="300">Vertical Retrace End</TD>
968 </TR>
969 </TABLE>
970 &nbsp;
971 <UL>
972 <LI>
973 <B>Protect -- CRTC Registers Protect Enable</B></LI>
974
975 <BR>This field is used to protect the video timing registers from being
976 changed by programs written for earlier graphics chipsets that attempt
977 to program these registers with values unsuitable for VGA timings.&nbsp;
978 When this field is set to 1, the CRTC register indexes 00h-07h ignore write
979 access, with the exception of bit 4 of the <A HREF="#07">Overflow Register</A>,
980 which holds bit 8 of the <A HREF="#18">Line Compare</A> field.
981 <LI>
982 <B>Bandwidth -- Memory Refresh Bandwidth</B></LI>
983
984 <BR>Nearly all video chipsets include a few registers that control memory,
985 bus, or other timings not directly related to the output of the video card.&nbsp;
986 Most VGA/SVGA implementations ignore the value of this field; however,
987 in the least, IBM VGA adapters do utilize it and thus for compatibility
988 with these chipsets this field should be programmed.&nbsp; This register
989 is used in the IBM VGA hardware to control the number of DRAM refresh cycles
990 per scan line.&nbsp; The three refresh cycles per scanline is appropriate
991 for the IBM VGA horizontal frequency of approximately 31.5 kHz.&nbsp; For
992 horizontal frequencies greater than this, this setting will work as the
993 DRAM will be refreshed more often.&nbsp; However, refreshing not often
994 enough for the DRAM can cause memory loss.&nbsp; Thus at some point slower
995 than 31.5 kHz the five refresh cycle setting should be used.&nbsp; At which
996 particular point this should occur, would require better knowledge of the
997 IBM VGA's schematics than I have available.&nbsp; According to IBM documentation,
998 "<I>Selecting five refresh cycles allows use of the VGA chip with 15.75
999 kHz displays.</I>" which isn't really enough to go by unless the mode you
1000 are defining has a 15.75 kHz horizontal frequency.
1001 <LI>
1002 <B>Vertical Retrace End</B></LI>
1003
1004 <BR>This field determines the end of the vertical retrace pulse, and thus
1005 its length.&nbsp; This field contains the lower four bits of the vertical
1006 scanline counter at the beginning of the scanline immediately after the
1007 last scanline where the vertical retrace signal is asserted.</UL>
1008 &nbsp;
1009 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1010 <CAPTION ALIGN=TOP><A NAME="12"></A><B>Vertical Display End Register (Index
1011 12h)</B></CAPTION>
1012
1013 <TR ALIGN=CENTER VALIGN=CENTER>
1014 <TD WIDTH="75">7</TD>
1015
1016 <TD WIDTH="75">6</TD>
1017
1018 <TD WIDTH="75">5</TD>
1019
1020 <TD WIDTH="75">4</TD>
1021
1022 <TD WIDTH="75">3</TD>
1023
1024 <TD WIDTH="75">2</TD>
1025
1026 <TD WIDTH="75">1</TD>
1027
1028 <TD WIDTH="75">0</TD>
1029 </TR>
1030
1031 <TR ALIGN=CENTER VALIGN=CENTER>
1032 <TD COLSPAN="8" WIDTH="600">Vertical Display End</TD>
1033 </TR>
1034 </TABLE>
1035 &nbsp;
1036 <UL>
1037 <LI>
1038 <B>Vertical Display End</B></LI>
1039
1040 <BR>This contains the bits 7-0 of the Vertical Display End field.&nbsp;
1041 Bits 9-8 are located in the <A HREF="#07">Overflow Register</A>.&nbsp;
1042 The field contains the value of the vertical scanline counter at the beggining
1043 of the scanline immediately after the last scanline of active display.</UL>
1044 &nbsp;
1045 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1046 <CAPTION ALIGN=TOP><A NAME="13"></A><B>Offset Register (Index 13h)</B></CAPTION>
1047
1048 <TR ALIGN=CENTER VALIGN=CENTER>
1049 <TD WIDTH="75">7</TD>
1050
1051 <TD WIDTH="75">6</TD>
1052
1053 <TD WIDTH="75">5</TD>
1054
1055 <TD WIDTH="75">4</TD>
1056
1057 <TD WIDTH="75">3</TD>
1058
1059 <TD WIDTH="75">2</TD>
1060
1061 <TD WIDTH="75">1</TD>
1062
1063 <TD WIDTH="75">0</TD>
1064 </TR>
1065
1066 <TR ALIGN=CENTER VALIGN=CENTER>
1067 <TD COLSPAN="8" WIDTH="600">Offset</TD>
1068 </TR>
1069 </TABLE>
1070 &nbsp;
1071 <UL>
1072 <LI>
1073 <B>Offset</B></LI>
1074
1075 <BR>This field specifies the address difference between consecutive scan
1076 lines or two lines of characters. Beginning with the second scan line,
1077 the starting scan line is increased by twice the value of this register
1078 multiplied by the current memory address size (byte = 1, word = 2, double-word
1079 = 4) each line. For text modes the following equation is used:
1080 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>Offset = Width / ( MemoryAddressSize
1081 * 2 )</B>
1082 <BR>and in graphics mode, the following equation is used:
1083 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <B>Offset = Width
1084 / ( PixelsPerAddress * MemoryAddressSize * 2 )</B>
1085 <BR>where Width is the width in pixels of the screen. This register can
1086 be modified to provide for a virtual resolution, in which case Width is
1087 the width is the width in pixels of the virtual screen. PixelsPerAddress
1088 is the number of pixels stored in one display memory address, and MemoryAddressSize
1089 is the current memory addressing size.</UL>
1090 &nbsp;
1091 <BR>&nbsp;
1092 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1093 <CAPTION ALIGN=TOP><A NAME="14"></A><B>Underline Location Register (Index
1094 14h)</B></CAPTION>
1095
1096 <TR ALIGN=CENTER VALIGN=CENTER>
1097 <TD WIDTH="75">7</TD>
1098
1099 <TD WIDTH="75">6</TD>
1100
1101 <TD WIDTH="75">5</TD>
1102
1103 <TD WIDTH="75">4</TD>
1104
1105 <TD WIDTH="75">3</TD>
1106
1107 <TD WIDTH="75">2</TD>
1108
1109 <TD WIDTH="75">1</TD>
1110
1111 <TD WIDTH="75">0</TD>
1112 </TR>
1113
1114 <TR ALIGN=CENTER VALIGN=CENTER>
1115 <TD WIDTH="75"></TD>
1116
1117 <TD WIDTH="75">DW</TD>
1118
1119 <TD WIDTH="75">DIV4</TD>
1120
1121 <TD COLSPAN="5" WIDTH="375">Underline Location</TD>
1122 </TR>
1123 </TABLE>
1124 &nbsp;
1125 <UL><B>DW - Double-Word Addressing<BR>
1126 </B>"<I>When this bit is set to 1, memory addresses are doubleword addresses.
1127 See the description of the word/byte mode bit (bit 6) in the CRT Mode Control
1128 Register</I>"
1129 <BR><B>DIV4 - Divide Memory Address Clock by 4<BR>
1130 </B>"<I>When this bit is set to 1, the memory-address counter is clocked
1131 with the character clock divided by 4, which is used when doubleword addresses
1132 are used.</I>"
1133 <BR><B>Underline Location<BR>
1134 </B>"<I>These bits specify the horizontal scan line of a character row
1135 on which an underline occurs. The value programmed is the scan line desired
1136 minus 1.</I>"</UL>
1137 &nbsp;
1138 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1139 <CAPTION ALIGN=TOP><A NAME="15"></A><B>Start Vertical Blanking Register
1140 (Index 15h)</B></CAPTION>
1141
1142 <TR ALIGN=CENTER VALIGN=CENTER>
1143 <TD WIDTH="75">7</TD>
1144
1145 <TD WIDTH="75">6</TD>
1146
1147 <TD WIDTH="75">5</TD>
1148
1149 <TD WIDTH="75">4</TD>
1150
1151 <TD WIDTH="75">3</TD>
1152
1153 <TD WIDTH="75">2</TD>
1154
1155 <TD WIDTH="75">1</TD>
1156
1157 <TD WIDTH="75">0</TD>
1158 </TR>
1159
1160 <TR ALIGN=CENTER VALIGN=CENTER>
1161 <TD COLSPAN="8" WIDTH="600">Start Vertical Blanking</TD>
1162 </TR>
1163 </TABLE>
1164 &nbsp;
1165 <UL>
1166 <LI>
1167 <B>Start Vertical Blanking</B></LI>
1168
1169 <BR>This contains bits 7-0 of the Start Vertical Blanking field.&nbsp;
1170 Bit 8 of this field is located in the <A HREF="#07">Overflow Register</A>,
1171 and bit 9 is located in the <A HREF="#09">Maximum Scan Line Register</A>.&nbsp;
1172 This field determines when the vertical blanking period begins, and contains
1173 the value of the vertical scanline counter at the beginning of the first
1174 vertical scanline of blanking.</UL>
1175 &nbsp;
1176 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1177 <CAPTION ALIGN=TOP><A NAME="16"></A><B>End Vertical Blanking Register (Index
1178 16h)</B></CAPTION>
1179
1180 <TR ALIGN=CENTER VALIGN=CENTER>
1181 <TD WIDTH="75">7</TD>
1182
1183 <TD WIDTH="75">6</TD>
1184
1185 <TD WIDTH="75">5</TD>
1186
1187 <TD WIDTH="75">4</TD>
1188
1189 <TD WIDTH="75">3</TD>
1190
1191 <TD WIDTH="75">2</TD>
1192
1193 <TD WIDTH="75">1</TD>
1194
1195 <TD WIDTH="75">0</TD>
1196 </TR>
1197
1198 <TR ALIGN=CENTER VALIGN=CENTER>
1199 <TD WIDTH="75"></TD>
1200
1201 <TD COLSPAN="7" WIDTH="525">End Vertical Blanking</TD>
1202 </TR>
1203 </TABLE>
1204 &nbsp;
1205 <UL>
1206 <LI>
1207 <B>End Vertical Blanking</B></LI>
1208
1209 <BR>This field determines when the vertical blanking period ends, and contains
1210 the value of the vertical scanline counter at the beginning of the vertical
1211 scanline immediately after the last scanline of blanking.</UL>
1212 &nbsp;
1213 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1214 <CAPTION ALIGN=TOP><A NAME="17"></A><B>CRTC Mode Control Register (Index
1215 17h)</B></CAPTION>
1216
1217 <TR ALIGN=CENTER VALIGN=CENTER>
1218 <TD WIDTH="75">7</TD>
1219
1220 <TD WIDTH="75">6</TD>
1221
1222 <TD WIDTH="75">5</TD>
1223
1224 <TD WIDTH="75">4</TD>
1225
1226 <TD WIDTH="75">3</TD>
1227
1228 <TD WIDTH="75">2</TD>
1229
1230 <TD WIDTH="75">1</TD>
1231
1232 <TD WIDTH="75">0</TD>
1233 </TR>
1234
1235 <TR ALIGN=CENTER VALIGN=CENTER>
1236 <TD WIDTH="75">SE</TD>
1237
1238 <TD WIDTH="75">Word/Byte</TD>
1239
1240 <TD WIDTH="75">AW</TD>
1241
1242 <TD WIDTH="75"></TD>
1243
1244 <TD WIDTH="75">DIV2</TD>
1245
1246 <TD WIDTH="75">SLDIV</TD>
1247
1248 <TD WIDTH="75">MAP14</TD>
1249
1250 <TD WIDTH="75">MAP13</TD>
1251 </TR>
1252 </TABLE>
1253 &nbsp;
1254 <UL><B>SE -- Sync Enable<BR>
1255 </B>"<I>When set to 0, this bit disables the horizontal and vertical retrace
1256 signals and forces them to an inactive level. When set to 1, this bit enables
1257 the horizontal and vertical retrace signals. This bit does not reset any
1258 other registers or signal outputs.</I>"
1259 <BR><B>Word/Byte -- Word/Byte Mode Select<BR>
1260 </B>"<I>When this bit is set to 0, the word mode is selected. The word
1261 mode shifts the memory-address counter bits to the left by one bit; the
1262 most-significant bit of the counter appears on the least-significant bit
1263 of the memory address outputs.&nbsp; The doubleword bit in the Underline
1264 Location register (0x14) also controls the addressing. When the doubleword
1265 bit is 0, the word/byte bit selects the mode. When the doubleword bit is
1266 set to 1, the addressing is shifted by two bits. When set to 1, bit 6 selects
1267 the byte address mode.</I>"
1268 <BR><B>AW -- Address Wrap Select<BR>
1269 </B>"<I>This bit selects the memory-address bit, bit MA 13 or MA 15, that
1270 appears on the output pin MA 0, in the word address mode. If the VGA is
1271 not in the word address mode, bit 0 from the address counter appears on
1272 the output pin, MA 0. When set to 1, this bit selects MA 15. In odd/even
1273 mode, this bit should be set to 1 because 256KB of video memory is installed
1274 on the system board. (Bit MA 13 is selected in applications where only
1275 64KB is present. This function maintains compatibility with the IBM Color/Graphics
1276 Monitor Adapter.)</I>"
1277 <BR><B>DIV2 -- Divide Memory Address clock by 2<BR>
1278 </B>"<I>When this bit is set to 0, the address counter uses the character
1279 clock. When this bit is set to 1, the address counter uses the character
1280 clock input divided by 2. This bit is used to create either a byte or word
1281 refresh address for the display buffer.</I>"
1282 <BR><B>SLDIV -- Divide Scan Line clock by 2<BR>
1283 </B>"<I>This bit selects the clock that controls the vertical timing counter.
1284 The clocking is either the horizontal retrace clock or horizontal retrace
1285 clock divided by 2. When this bit is set to 1. the horizontal retrace clock
1286 is divided by 2. Dividing the clock effectively doubles the vertical resolution
1287 of the CRT controller. The vertical counter has a maximum resolution of
1288 1024 scan lines because the vertical total value is 10-bits wide. If the
1289 vertical counter is clocked with the horizontal retrace divided by 2, the
1290 vertical resolution is doubled to 2048 scan lines.</I>"
1291 <BR><B>MAP14 -- Map Display Address 14<BR>
1292 </B>"<I>This bit selects the source of bit 14 of the output multiplexer.
1293 When this bit is set to 0, bit 1 of the row scan counter is the source.
1294 When this bit is set to 1, the bit 14 of the address counter is the source.</I>"
1295 <BR><B>MAP13 -- Map Display Address 13<BR>
1296 </B>"<I>This bit selects the source of bit 13 of the output multiplexer.
1297 When this bit is set to 0, bit 0 of the row scan counter is the source,
1298 and when this bit is set to 1, bit 13 of the address counter is the source.
1299 The CRT controller used on the IBM Color/Graphics Adapter was capable of
1300 using 128 horizontal scan-line addresses. For the VGA to obtain 640-by-200
1301 graphics resolution, the CRT controller is&nbsp; programmed for 100 horizontal
1302 scan lines with two scan-line addresses per character row. Row scan&nbsp;
1303 address bit 0 becomes the most-significant address bit to the display buffer.
1304 Successive scan lines of&nbsp; the display image are displaced in 8KB of
1305 memory. This bit allows compatibility with the graphics modes of earlier
1306 adapters.</I>"</UL>
1307 &nbsp;
1308 <TABLE BORDER WIDTH="600" CELLPADING="2" >
1309 <CAPTION ALIGN=TOP><A NAME="18"></A><B>Line Compare Register (Index 18h)</B></CAPTION>
1310
1311 <TR ALIGN=CENTER VALIGN=CENTER>
1312 <TD WIDTH="75">7</TD>
1313
1314 <TD WIDTH="75">6</TD>
1315
1316 <TD WIDTH="75">5</TD>
1317
1318 <TD WIDTH="75">4</TD>
1319
1320 <TD WIDTH="75">3</TD>
1321
1322 <TD WIDTH="75">2</TD>
1323
1324 <TD WIDTH="75">1</TD>
1325
1326 <TD WIDTH="75">0</TD>
1327 </TR>
1328
1329 <TR ALIGN=CENTER VALIGN=CENTER>
1330 <TD COLSPAN="8" WIDTH="600">Line Compare Register</TD>
1331 </TR>
1332 </TABLE>
1333 &nbsp;
1334 <UL>
1335 <LI>
1336 <B>Line Compare Register</B></LI>
1337
1338 <BR>This field specifies bits 7-0 of the Line Compare field. Bit 9 of this
1339 field is located in the <A HREF="#09">Maximum Scan Line Register</A>, and
1340 bit 8 of this field is located in the <A HREF="#07">Overflow Register</A>.
1341 The Line Compare field specifies the scan line at which a horizontal division
1342 can occur, providing for split-screen operation. If no horizontal division
1343 is required, this field should be set to 3FFh. When the scan line counter
1344 reaches the value in the Line Compare field, the current scan line address
1345 is reset to 0 and the Preset Row Scan is presumed to be 0. If the <A HREF="attrreg.htm#10">Pixel
1346 Panning Mode</A> field is set to 1 then the Pixel Shift Count and Byte
1347 Panning fields are reset to 0 for the remainder of the display cycle.</UL>
1348 Notice: All trademarks used or referred to on this page are the property
1349 of their respective owners.
1350 <BR>All pages are Copyright &copy; 1997, 1998, J. D. Neal, except where
1351 noted. Permission for utilization and distribution
1352 <BR>is subject to the terms of the <A HREF="license.htm">FreeVGA Project
1353 Copyright License</A>.
1354 </BODY>
1355 </HTML>