1 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
\r
2 ³ Introduction to Programming the SVGA Cards ³
\r
3 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
\r
5 Written for the PC-GPE by Mark Feldman
\r
6 e-mail address : u914097@student.canberra.edu.au
\r
7 myndale@cairo.anu.edu.au
\r
9 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
\r
10 ³ THIS FILE MAY NOT BE DISTRIBUTED ³
\r
11 ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³
\r
12 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
\r
15 ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
19 I assume no responsibility whatsoever for any effect that this file, the
\r
20 information contained therein or the use thereof has on you, your sanity,
\r
21 computer, spouse, children, pets or anything else related to you or your
\r
22 existance. No warranty is provided nor implied with this information.
\r
25 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
26 ³ SVGA Section Overview ³
\r
27 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
\r
29 The vast majority of the information presented in the PC-GPE was obtained
\r
30 from the book "Programmer's Guide to the EGA and VGA Cards - Includes Super
\r
31 VGAs, Second Edition" by Richard Ferraro, ISBN 0-201-57025-4, published
\r
32 by Addison-Wesley. This book is by far the most comprehensive VGA/SVGA
\r
33 reference I have seen to date and is more than worth it's price tag. I
\r
34 heartily recommend it to anyone wishing to do any serious graphics
\r
35 programming for the PC.
\r
37 The PC-GPE SVGA section was originally not going to be included in version 1
\r
38 due to the fact that I have only been able to verify that the info on the
\r
39 Paradise SVGA is correct. I will include it however, in the hope that
\r
40 everyone (and I mean *EVERYONE*) who reads these files and tries out the
\r
41 routines will e-mail me with the results they get so I can make the
\r
42 modifications in time for version 2.
\r
44 I will need to know these things:
\r
46 1) Your SVGA board name
\r
48 2) The id and revision number of the chip inside (if possible)
\r
50 3) What you tried and the results you got. This applies to *all* routines,
\r
51 bank switching, chip detection etc.... I need to know everything!
\r
53 If a routine doesn't work as expected then let me know if it's doing anything
\r
54 at all. "The routine is stuffed you idiot" won't exactly help me much, but
\r
55 "I can only read pixels in bank 0 you idiot" just might......
\r
57 And of course there's always the chance that I've misunderstood my references
\r
58 so I need to have my mistakes pointed out to me as well. I'm a big boy...I
\r
61 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
62 ³ Writing to the VGA Ports ³
\r
63 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
\r
65 Many of the PC-GPE SVGA texts have the PortW Pascal command as follows:
\r
67 PortW[PORTNUM] := VALUE;
\r
69 This command writes a 16 bit word to the port, the same as the asm op code:
\r
73 The effect of this code is the same as the following two Pascal statements:
\r
75 Port[PORTNUM] := Lo(VALUE);
\r
76 Port[PORTNUM + 1] := Hi(VALUE);
\r
78 I'm not sure if this is common to all the PC ports or only works on the
\r
79 VGA. (Perhaps someone could enlighten me?)
\r
81 The PortW command is very handy when writing to the SVGA extended registers.
\r
82 The SVGA register sets are all extensions of the VGA register sets and
\r
83 use an indexed addressing scheme to cut down on the number of ports they
\r
84 use. The texts often have register maps which look similar to the following:
\r
86 PR0A Address Offset A
\r
87 Index : 09h at port 3CEh
\r
88 Read/Write at port 3CFh
\r
89 ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿
\r
90 ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³
\r
91 ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ
\r
92 ÀÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÙ
\r
95 For this particular map, the register name is PR0A Offset A. To select the
\r
96 register and get it ready for reading and/or writing you write the value
\r
97 09h to port 3CEh (the index port). The register can then be read from or
\r
98 written to port 3CFh (the read/write port).
\r
100 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
104 In real mode, the PC has addresses A000:0000-B000:FFFF allocated for video
\r
105 memory, although most graphics modes only use the A000 segment.
\r
107 If you set an SVGA card to 640x480x256 color mode (for example) then there
\r
108 will be a total of 307200 pixels on the screen. Since each pixel takes up
\r
109 one byte in 256 color modes around 300K of video memory will be used to
\r
110 store the screen data. In most cases all this memory is accessed through the
\r
111 A000 segment. When you initially set the mode, bank 0 on the card will be
\r
112 active and anything you read to or write from this segment will be in the
\r
113 first 64K bytes in video memory (i.e. lines 0-101 and the first 256 bytes in
\r
114 line number 102). If you want to access the next 64K you must switch the
\r
115 card to bank number 1 so that the A000 segment now maps to the second bank,
\r
118 The problem here is that each card has a different method of doing the bank
\r
119 switching. The PC-GPE files contain info on how to do the bank switching for
\r
120 a number of the most commonly used SVGA cards. The VESA standard helped
\r
121 inject some sanity into the otherwise chaotic world of SVGA programming by
\r
122 introducing a "standard" method of bank switching for all cards.
\r
124 A note should be made here about bank granularity. In the section above I
\r
125 assumed that bank 0 corresponded to the first 64K, bank 1 to the next etc..
\r
126 ie each bank has a 64K granularity. This is true for most cards, but some
\r
127 do have smaller granularities (see the table below). The Paradise for
\r
128 instance has a 4K granularity. It's very similar in concept to the PC's
\r
129 segmented memory, segments are 64K long but they have a 16 byte granularity.
\r
130 The Paradise chip's banks are also 64K long, but they have a 4K granularity.
\r
131 All the bank switching code given in the PC-GPE SVGA files adjust for this
\r
132 so that your code can assume the card has a 64K granularity in all cases.
\r
135 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
139 There are a few SVGA libraries available via anonymouse ftp. I haven't had
\r
140 a chance to use any of them yet, but I've heard some of them are pretty good,
\r
141 so they might be worth checking out. Here's two C libraries that I know of:
\r
143 site: ftp.fasttax.com
\r
144 directory: /pc/graphic/scitech/beta
\r
145 filename: svkt44bl.zip
\r
147 site: garbo.uwasa.fi
\r
148 directory: /pc/programming
\r
149 filename: SVGACC20.ZIP
\r
152 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
153 ³ Common SVGA Cards ³
\r
154 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
\r
156 The PC-GPE files contain information on programming the 7 VGA "standards"
\r
157 as covered by Ferraro. According to Ferraro the majority of SVGA cards on
\r
158 the market today conform to one of these standards. The standards are
\r
159 Ati, Chips and Technologies, Genoa, Paradise, Trident, Tseng and Video7.
\r
160 I've also included a file on the VESA specifications (VESASP12.TXT). VESA
\r
161 seems to be the way to go now since public domain drivers are available for
\r
162 most cards and you only need to write one set of graphics drivers if you use
\r
163 it. VESA BIOS calls can be slow however, so if your program needs to do LOTS
\r
164 of bank switching then you may need to work with the cards on a hardware
\r
167 The following is a list of common SVGA's along with the chip it is based on,
\r
168 the number of banks the card contains and the modes they support. The GR
\r
169 field is the bank granularity. This information was obtained by examining
\r
170 the configuration files in the shareware program VPIC. VPIC is a great
\r
171 little program which supports numerous graphics file formats as well
\r
172 as all the cards listed below (and a few more). VPIC can be obtained via
\r
173 anonymous ftp from oak.oakland.edu, directory /pub/msdos/gif, filename
\r
174 vpic. I tried to contact the author so I'd feel better about blatently
\r
175 ripping all the info out of his data files but he doesn't seem to have an
\r
176 e-mail address. Are you out there Bob Montgomery?
\r
178 Quite a number of the chip sets in the list are not mentioned in Ferraro. If
\r
179 anyone has information on programming any of them drop me a line.
\r
181 Each mode in the table below has a mode number. To set the mode, load the AX
\r
182 register with this value and do an interrupt 10h. Some modes below have two
\r
183 numbers. In these cases load AX with the first number and BX with the second
\r
184 before calling interrupt 10h.
\r
186 Only 16 and 256 color are presented in the table below. True-color modes
\r
187 are not included in this version.
\r
190 Board Chip Banks Modes Resolution Col GR
\r
191 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
\r
193 Acumos ACUMOS 8 5Eh 640x400 256 64k
\r
194 5Fh 640x480 256 64k
\r
195 5Ch 800x256 256 64k
\r
199 5dh 1024x768 16 64k
\r
201 Ahead A Chip AHEADA 4/8 60h 640x400 256 64k
\r
202 61h 640x480 256 64k
\r
203 62h 800x600 256 64k
\r
205 74h 1024x768 16 64k
\r
207 Ahead B Chip AHEADB 8/16 60h 640x400 256 64k
\r
208 61h 640x480 256 64k
\r
209 62h 800x600 256 64k
\r
210 63h 1024x768 256 64k
\r
212 74h 1024x768 16 64k
\r
214 ATI VGA Wonder ATI OLD 4/8 61h 640x400 256 32k
\r
215 62h 640x480 256 32k
\r
216 63h 800x600 256 32k
\r
218 65h 1024x768 16 64k
\r
220 ATI VGA Wonder+ ATI NEW 4/8/16 61h 640x400 256 32k
\r
221 62h 640x480 256 32k
\r
222 63h 800x600 256 32k
\r
223 64h 1024x768 256 32k
\r
225 55h 1024x768 16 32k
\r
227 ATI Ultra 8514A GA ATI NEW 4/8/16 61h 640x400 256 32k
\r
228 62h 640x480 256 32k
\r
229 63h 800x600 256 32k
\r
231 55h 1024x768 16 32k
\r
233 ATI XL ATI NEW 4/8/16 61h 640x400 256 32k
\r
234 62h 640x480 256 32k
\r
235 63h 800x600 256 32k
\r
236 64h 1024x768 256 32k
\r
238 55h 1024x768 16 32k
\r
240 Chips & Technology Chips and 4/8 78h 640x400 256 16k
\r
241 Technologies 79h 640x480 256 16k
\r
242 7Ah 720x540 256 16k
\r
243 7Bh 800x600 256 16k
\r
246 72h 1024x768 16 16k
\r
248 Cirrus Logic GD54 VESA 16/64 4F02h,100h 640x400 256 4k
\r
249 4F02h,101h 640x480 256 4k
\r
250 4F02h,103h 800x600 256 4k
\r
251 4F02h,105h 1024x768 256 4k
\r
252 4F02h,102h 800x600 16 4k
\r
253 4F02h,104h 1024x768 16 4k
\r
255 Definicon, 16 Bit TSENG 4000 8/16 2dh 640x350 256 64k
\r
256 2fh 640x400 256 64k
\r
257 2eh 640x480 256 64k
\r
258 30h 800x600 256 64k
\r
259 38h 1024x768 256 64k
\r
261 37h 1024x768 16 64k
\r
262 3Dh 1280x1024 16 64k
\r
264 Diamond 24x PARADISE 4/16 5eh 640x400 256 4k
\r
267 60h 1024x768 256 4k
\r
271 64h 1280x1024 16 4k
\r
273 Diamond Speedstar 24 TSENG 4000 8/16 2dh 640x350 256 64k
\r
274 2fh 640x400 256 64k
\r
275 2eh 640x480 256 64k
\r
276 30h 800x600 256 64k
\r
277 38h 1024x768 256 64k
\r
279 37h 1024x768 16 64k
\r
281 Everex EV-673 EVEREX 4/8 70h,13h 640x350 256 64k
\r
282 70h,14h 640x400 256 64k
\r
283 70h,15h 512x480 256 64k
\r
284 70h,30h 640x480 256 64k
\r
285 70h,31h 800x600 256 64k
\r
286 70h,02h 800x600 16 64k
\r
287 70h,20h 1024x768 16 64k
\r
289 Everev 678 TRIDENT 4/8 70h,14h 640x400 256 64k
\r
290 8800 70h,15h 512x480 256 64k
\r
291 70h,30h 640x480 256 64k
\r
292 70h,31h 800x600 256 64k
\r
293 70h,02h 800x600 16 64k
\r
294 70h,20h 1024x768 16 64k
\r
296 Everex Vision VGA HC TSENG 4000 8/16 2fh 640x400 256 64k
\r
297 2eh 640x480 256 64k
\r
299 Genoa 5400 TSENG 3000 4/8 2dh 640x350 256 64k
\r
300 2eh 640x480 256 64k
\r
301 30h 800x600 256 64k
\r
303 37h 1024x768 16 64k
\r
305 Genoa 6400 GENOA 4/8 2bh 640x350 256 64k
\r
306 2eh 640x480 256 64k
\r
307 30h 800x600 256 64k
\r
309 37h 1024x768 16 64k
\r
311 Genoa 7900 24 bit TSENG 4000 8/16 2dh 640x350 256 64k
\r
312 2fh 640x400 256 64k
\r
313 2eh 640x480 256 64k
\r
314 30h 800x600 256 64k
\r
315 38h 1024x768 256 64k
\r
317 37h 1024x768 16 64k
\r
319 Headland 1024i HEADLAND 4/8 6F05h,66h 640x400 256 64k
\r
320 6F05h,67h 640x480 256 64k
\r
321 6F05h,68h 720x540 256 64k
\r
322 6F05h,69h 800x600 256 64k
\r
323 6F05h,61h 720x540 16 64k
\r
324 6F05h,62h 800x600 16 64k
\r
325 6F05h,65h 1024x768 16 64k
\r
327 Hi Res 512 ZYMOS 4/8 5ch 640x400 256 64k
\r
328 5dh 640x480 256 64k
\r
329 5eh 800x600 256 64k
\r
331 5fh 1024x768 16 64k
\r
333 Maxxon TRIDENT 8800 4/8 5ch 640x400 256 64k
\r
334 5dh 640x480 256 64k
\r
335 5eh 800x600 256 64k
\r
337 5fh 1024x768 16 64k
\r
339 C&T MK82452 CHIPS AND 8 78h 640x400 256 16k
\r
340 TECHNOLOGIES 79h 640x480 256 16k
\r
342 72h 1024x768 16 16k
\r
344 NCR 77C22 NCR 8/16 5eh 640x400 256 64k
\r
345 5fh 640x480 256 64k
\r
346 5ch 800x600 256 64k
\r
347 62h 1024x768 256 64k
\r
349 5dh 1024x768 16 64k
\r
351 OAK OAK 8/16 53h 640x480 256 64k
\r
352 54h 800x600 256 64k
\r
353 59h 1024x768 256 64k
\r
355 56h 1024x768 16 64k
\r
358 Fahrenheight 1280 S3 8/16 4F02h,201h 640x480 256 64k
\r
359 4F02h,203h 800x600 256 64k
\r
360 4F02h,205h 1024x768 256 64k
\r
361 4F02h,202h 800x600 16 64k
\r
362 4F02h,204h 1024x768 16 64k
\r
363 4F02h,206h 1280x960 16 64k
\r
364 4F02h,206h 1280x1024 16 64k
\r
367 Designer II TSENG 4000 8/16 2dh 640x350 256 64k
\r
368 2fh 640x400 256 64k
\r
369 2eh 640x480 256 64k
\r
370 30h 800x600 256 64k
\r
371 38h 1024x768 256 64k
\r
373 37h 1024x768 16 64k
\r
375 Paradise VGA Pro PARADISE 4/16 5eh 640x400 256 4k
\r
378 60h 1024x768 256 4k
\r
382 Primus P2000 GA PRIMUS 8/16 2dh 640x480 256 64k
\r
383 2bh 800x600 256 64k
\r
384 31h 1024x768 256 64k
\r
385 37h 1280x1024 256 64k
\r
387 30h 1024x768 16 64k
\r
388 36h 1280x1024 16 64k
\r
390 Compaq QVision QVISION 8/16 32h 640x480 256 4k
\r
391 38h 1024x768 256 4k
\r
397 Realtek RTVGA REALTEK 8/16 25h 640x400 256 64k
\r
398 26h 640x480 256 64k
\r
399 27h 800x600 256 64k
\r
400 28h 1024x768 256 64k
\r
402 21h 1024x768 16 64k
\r
403 2Ah 1280x1024 16 64k
\r
405 Realtek RTVGA REALTEK 8/16 25h 640x400 256 64k
\r
406 26h 640x480 256 64k
\r
407 27h 800x600 256 64k
\r
408 28h 1024x768 256 64k
\r
410 21h 1024x768 16 64k
\r
411 2Ah 1280x1024 16 64k
\r
413 S3 Graphics Accelerator S3 8/16 4F02h,201h 640x480 256 64k
\r
414 4F02h,203h 800x600 256 64k
\r
415 4F02h,205h 1024x768 256 64k
\r
416 4F02h,202h 800x600 16 64k
\r
417 4F02h,204h 1024x768 16 64k
\r
418 4F02h,206h 1280x960 16 64k
\r
420 STB EM 16 TSENG 4000 8/16 2dh 640x350 256 64k
\r
421 78h 640x400 256 64k
\r
422 2eh 640x480 256 64k
\r
423 30h 800x600 256 64k
\r
424 38h 1024x768 256 64k
\r
426 37h 1024x768 16 64k
\r
428 Phoebes TRIDENT 8800CS 4/8 5ch 640x400 256 64k
\r
429 5dh 640x480 256 64k
\r
431 5fh 1024x768 16 64k
\r
433 Maxxon TRIDENT 8800CS 4/8 5ch 640x400 256 64k
\r
434 5dh 640x480 256 64k
\r
435 5eh 800x600 256 64k
\r
437 5fh 1024x768 16 64k
\r
439 Trident 8900 TRIDENT 8900 8/16 5Ch 640x400 256 64k
\r
440 5Dh 640x480 256 64k
\r
441 5Eh 800x600 256 64k
\r
442 62h 1024x768 256 64k
\r
444 5Fh 1024x768 16 64k
\r
446 Tseng ET-3000 TSENG ET3000 4/8 2dh 640x350 256 64k
\r
447 2eh 640x480 256 64k
\r
448 30h 800x600 256 64k
\r
451 37h 1024x768 16 64k
\r
453 Tseng ET-4000 TSENG ET4000 8/16 2dh 640x350 256 64k
\r
454 2fh 640x400 256 64k
\r
455 2eh 640x480 256 64k
\r
456 30h 800x600 256 64k
\r
457 38h 1024x768 256 64k
\r
459 37h 1024x768 16 64k
\r
461 Video 7 VRAM VIDEO7 4/8 6f05h,66h 640x400 256 64k
\r
462 6f05h,67h 640x480 256 64k
\r
463 6f05h,68h 720x540 256 64k
\r
464 6f05h,69h 800x600 256 64k
\r
465 6f05h,61h 720x540 16 64k
\r
466 6f05h,62h 800x600 16 64k
\r
467 6f05h,65h 1024x768 16 64k
\r
469 Western Digital 90C PARADISE 4/8 5eh 640x400 256 4k
\r