The SuperVGA Test Library ------------------------- The SuperVGA Test Library is a set of routines for automatically detecting a number of different SuperVGA chipsets, and performing bank switching and extended page flipping on supported SuperVGA's. It will also detect the presence of HiColor and TrueColor video DAC's and provides support for video modes that use these DAC's. This library supports many of the extended features of today's SuperVGA adapters, such as being able to separately set the read and write banks and support for extended page flipping. Not all of these features are available on each SuperVGA, but providing support for them if they are available is made extremely easy. NOTE: All source code is formatted with 4 space tabs, including the assembly language source. NOTE: This library has '386 specific code in it, so it will _not_ work with machines without a '286 or lower processor. Using it in your own programs ----------------------------- There are two options you can use to include this stuff in your own programs. You can simply write you code to work with any VESA compatible SuperVGA card, and require that users of your programs load the Universal VESA TSR or something equivalent before use. Or alternatively, you can use the code directly to gain even higher performance. To make this even easier than before, I have built a number of libraries you can simply link into your code (tested with Borland C++ 3.1), and the corresponding header files. The routines are pretty basic, so check the code for documentation on how to use it (and see the test programs for ideas). Bug fixes, changes etc ---------------------- If you have a SuperVGA card that it not supported by this library, I would appreciate it if you mail me some code to to add support for your video card. If your video card supports extended page flipping or separate read/write banks, but support for this is not included in the library, I would apprecite it if you mail me some code to add support for this to the library also. Also, if the library misbehaves on your system, I would appreciate feedback on the problem so we can attempt to rectify it (see the list of cards that have been successfully tested, before mailing me a yes answer :-). I would appreciate it if people could fill in the following form and mail it back to me (see the read.me for for more details). ---------------------------------------------------------------------------- Name: ____________________________________________________ Email: ____________________________________________________ Library Version: ___________ SuperVGA board: ___________________________________________ Chipset Type: ___________________________________________ Demo Results: 16 color demo: Ran Correctly [ ], Incorrectly [ ], Unsupported [ ] If incorrectly, which parts did not work correctly: Bank Switching [ ], Separate read/write banks [ ], Page Flipping [ ] Explain: __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ 256 color demo: Ran Correctly [ ], Incorrectly [ ], Unsupported [ ] If incorrectly, which parts did not work correctly: Bank Switching [ ], Separate read/write banks [ ], Page Flipping [ ] Explain: __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ 32k color demo: Ran Correctly [ ], Incorrectly [ ], Unsupported [ ] If incorrectly, which parts did not work correctly: Bank Switching [ ], Separate read/write banks [ ], Page Flipping [ ] Explain: __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ 16m color demo: Ran Correctly [ ], Incorrectly [ ], Unsupported [ ] If incorrectly, which parts did not work correctly: Bank Switching [ ], Separate read/write banks [ ], Page Flipping [ ] Explain: __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ __________________________________________________ ---------------------------------------------------------------------------- Test programs ------------- The library has four test programs, for 16 color, 256 color, 32k color and 16 million color SuperVGA video modes. The tests are now more informative, providing you with a menu of video modes to test, and providing feedback on what is supposed to happen. Simply run the programs and follow the instructions. Note that some video adapters support the 64k (16 bit) video modes. These are essentially the same as the 32k color video modes, but have a diffent layout for the bits in each pixel (usually 1 extra bit of green), and thus are a great cause of pain as bitmaps are not compatible between the two modes. This kit does not support the 64k color video modes (most video cards that support 64k color also support 32k colors). If any of the programs do not work correctly, you will probably see garbage on the screen or stange results (at least not what the program says should happen). SuperVGA Support: ----------------- The following SuperVGA chipsets are supported: - VESA Compatible SuperVGA's - ATI Technologies 18800, 28800 - Ahead A & B - Chips & Technologies 82c451/452/453 - Everex - Genoa Systems GVGA - OAK Technologies OTI-037C, OTI-067, OTI-077 - Paradise PVGA1A, WD90C00/10/11/30/31 - NCR 77C20/21/22E - Trident 88/8900 - Video7 V7VGA versions 1-5 - Tseng Labs ET3000, ET4000 - AcuMos AVGA2, AVGA3 - S3 86c911/924/801/806/928 - Advance Logic AL2101 SuperVGA - MXIC 86010 SuperVGA - Primus 2000 SuperVGA - RealTek 3106 SuperVGA - Cirrus CL-GD 5422 SuperVGA Extended page flipping is currently available on the following adapters: - VESA Compatible SuperVGA's - ATI Technologies 18800, 28800 - Ahead B - Chips & Technologies 82c452/453 - Paradise - NCR 77C20/21/22E SuperVGA - Trident 88/8900 - Video7 V7VGA versions 1-5 - Tseng Labs ET3000, ET4000 - S3 86c911/924/801/805/928 - Primus 2000 SuperVGA - Cirrus CL-GD 5422 SuperVGA The following adapters support separate read and write banks for faster performance in certain areas: - VESA Compatible SuperVGA's - ATI Technologies 18800-1, 28800 - Ahead B - Genoa Systems GVGA - Paradise WD90C10 and up - Video7 V7VGA version 5 or later - Tseng Labs ET3000, ET4000 - MXIC 86010 SuperVGA - Primus 2000 SuperVGA Areas needing clearing up ------------------------- - The RealTek RT3106 SuperVGA has bank switching registers in 3D6h and 3D7h. The register in 3D7h works by default for reading and writing, but there must be some way of putting this card in a mode that can use separate read/write banks. Also, I would like to figure out how to do extended page flipping on this card. - The biggest problem seems to be with the incompatible mode numbering schemes for video cards based on the ET4000 chipset with True Color video DAC's. The HiColor modes seem to be all compatible, but the True Color 640x480 24 bit mode is an add on and different cards have different numbers and methods to invoke this mode. Anyone have a solution to this problem? - The new Genoa 7900 seems to be a problem, since it uses a different mode number than other ET4000 based cards for 640x480 24 bit graphics mode. If I can figure out a way of detecting that the board is a Genoa 7900 then we can solve the problem. Anyone know how to do this? Problems -------- All S3 cards are VESA compatible, but some like the STB WIND/X have stuffed BIOSes. This driver has fixed to work with these cards in 256 color modes, but not in 1024x768x16 VESA mode 104h, since the incorrect scanline value is also returned. However, the S3 also supports 800x600x16, 1024x768x16 and 1280x1024x16 accelerated video modes (20xh mode numbers). These video modes are in a packed 16 color mode, where two pixels are packed into a single byte. These modes are not supported directly by this test kit, but could be supported by a special S3 video driver (using the accelerator). Thus the only S3 video modes supported directly by these test programs are the VESA 10xh video modes (which are not accelerated). Also I have noticed that setting up the 20xh modes on S3's stuffs up the video palette, but using the VESA 10xh numbers doesn't. Another problem that I found was that the 86c911 chip seems to have trouble doing page flipping in the 1024x768x16 video mode (VESA mode number 102h, not S3 mode number 202h). This problem is non-existant on the 86c924. SuperVGA chipsets successfully tested ------------------------------------- - VESA - ET4000 with HiColor, 1024k - ET4000 with TrueColor, 1024k (MegaEva/2 board) - Diamond Speedstar 24 (ET4000 with SS24 TrueColor DAC) - S3 86c911, 1024k - S3 86c924 with HiColor, 1024k - Trident 8900C, 512k - Oak OTI-037C, 512k - Oak OTI-067C, 256k - RealTek RT3106, 1024k - Primus P2000 - Paradise WD90c30 (and laptop version) The following is a list of SuperVGA chipset manufacturers and BIOS mode numbers for the standard 16 color and 256 color SuperVGA video modes. ============================================================================= VESA ---- Width Height Colors ----- ------ ------ 0x102 800 600 16 0x104 1024 768 16 0x106 1280 1024 16 0x100 640 400 256 0x101 640 480 256 0x103 800 600 256 0x105 1024 768 256 0x107 1280 1024 256 0x10D 320 200 32,768 0x110 640 480 32,768 0x113 800 600 32,768 0x116 1024 768 32,768 0x119 1280 1024 32,768 0x10E 320 200 65,536 0x111 640 480 65,536 0x114 800 600 65,536 0x117 1024 768 65,536 0x11A 1280 1024 65,536 0x10F 320 200 16,777,216 0x112 640 480 16,777,216 0x115 800 600 16,777,216 0x118 1024 768 16,777,216 0x11B 1280 1024 16,777,216 AX=4F02 BX=MODE ============================================================================= CIRRUS 5422 ----------- Width Height Colors Chip ----- ------ ------ ---- 0x58 800 600 16 CL-GD 5422 0x5D 1024 768 16 CL-GD 5422 0x6C 1280 1024 16 CL-GD 5422 0x5F 640 480 256 CL-GD 5422 0x5C 800 600 256 CL-GD 5422 0x60 1024 768 256 CL-GD 5422 0x66 640 480 32,768 CL-GD 5422 0x67 800 600 32,768 CL-GD 5422 0x70 320 200 16,777,216 CL-GD 5422 0x71 640 480 16,777,216 CL-GD 5422 AX=MODE ============================================================================= ACUMOS ------ Width Height Colors Chip ----- ------ ------ ---- 0x58 800 600 16 AVGA1 0x5D 1024 768 16 AVGA1 0x5E 640 400 256 AVGA1 0x5F 640 480 256 AVGA1 0x5C 800 600 256 AVGA1 AX=MODE ============================================================================= AHEAD ----- Width Height Colors Chip ----- ------ ------ ---- 0x71 or 0x6A 800 600 16 A, B 0x74 1024 768 16 A, B 0x60 640 400 256 A, B 0x61 640 480 256 A, B 0x62 800 600 256 A, B 0x63 1024 768 256 B AX=MODE ============================================================================= AL2101 ------ Width Height Colors Chip ----- ------ ------ ---- 0x2B 800 600 16 AL2101 0x30 1024 768 16 AL2101 0x36 1280 1024 16 AL2101 0x29 640 400 256 AL2101 0x2A 640 480 256 AL2101 0x2C 800 600 256 AL2101 0x31 1024 768 256 AL2101 0x37 1280 1024 256 AL2101 0x40 320 200 65,536 AL2101 0x42 640 400 65,536 AL2101 0x43 640 480 65,536 AL2101 0x44 800 600 65,536 AL2101 AX=MODE ============================================================================= ATI --- Width Height Colors Chip ----- ------ ------ ---- 0x54 800 600 16 18800 up 0x55 1024 768 16 18800-1 up 0x61 640 400 256 18800 up 0x62 640 480 256 18800 up 0x63 800 600 256 18800 up 0x64 1024 768 256 28800 up 0x72 640 480 32,768 28800-4 (15 bit DAC) 0x73 800 600 32,768 28800-4 (15 bit DAC) AX=MODE ============================================================================= CHIPS & TECH ------------ Width Height Colors Chip ----- ------ ------ ---- 0x70 or 0x6A 800 600 16 451 up 0x72 1024 768 16 452 up 0x78 640 400 256 451 up 0x79 640 480 256 452 up 0x7B 800 600 256 453 0x7E 1024 768 256 453 AX=MODE ============================================================================= EVEREX ------ Width Height Colors Chip ----- ------ ------ ---- 0x02 800 600 16 all 0x20 1024 768 16 Ev629, Ev678 0x21 1280 1024 16 Ev629, Ev678 0x13 640 350 256 all 0x14 640 400 256 all 0x30 640 480 256 Ev629, Ev678 0x31 800 600 256 Ev629, Ev678 0x32 1024 768 256 Ev629, Ev678 0x62h 320 200 32,768 Viewpoint TC 0x71h 640 480 32,768 Viewpoint TC 0x77h 640 480 16,777,216 Viewpoint TC AX=0x70 BL=MODE ============================================================================= GENOA ----- Width Height Colors Chip ----- ------ ------ ---- 0x79 or 0x6A 800 600 16 GVGA 0x5F 1024 768 16 GVGA 0x5B 640 350 256 GVGA 0x7E 640 400 256 GVGA 0x5C 640 480 256 GVGA 0x5E or 0x6C 800 600 256 GVGA AX=MODE Other Genoa boards are based on the Tseng ET3000 and ET4000 chipsets and use standard Tseng video mode numbers. ============================================================================= MXIC ---- Width Height Colors Chip ----- ------ ------ ---- 0x55 800 600 16 MXIC 0x56 1024 768 16 MXIC 0x57 640 350 256 MXIC 0x58 640 400 256 MXIC 0x59 640 480 256 MXIC 0x5A 800 600 256 MXIC 0x5B 1024 768 256 MXIC AX=MODE ============================================================================= NCR --- Width Height Colors Chip ----- ------ ------ ---- 0x58 800 600 16 77C20,21,22E 0x5D 1024 768 16 77C20,21,22E 0x67 1280 1024 16 77C22E 0x5E 640 400 256 77C20,21,22E 0x5F 640 480 256 77C20,21,22E 0x5C 800 600 256 77C20,21,22E 0x62 1024 768 256 77C22E 0x6A 1280 1024 256 77C22E 0x70 640 480 32,768 77C22E (15 bit DAC) 0x71 800 600 32,768 77C22E (15 bit DAC) 0x78 640 480 65,536 77C22E (15/16 bit DAC) 0x79 800 600 65,546 77C22E (15/16 bit DAC) AX=MODE ============================================================================= OAK TECH -------- Width Height Colors Chip ----- ------ ------ ---- 0x52 800 600 16 OTI-037C up 0x56 1024 768 16 OTI-067 up 0x58 1280 1024 16 OTI-067 up 0x53 640 480 256 OTI-067 up 0x54 800 600 256 OTI-067 up 0x59 1024 768 256 OTI-077 0x5B 640 400 32,768 OTI-077 (15 bit DAC) 0x5C 640 480 32,768 OTI-077 (15 bit DAC) AX=MODE ============================================================================= PARADISE -------- Width Height Colors Chip ----- ------ ------ ---- 0x58 800 600 16 pVGA1A,WDC90Cxx 0x5D 1024 768 16 WDC90Cxx 0x64 1280 1024 16 WDC90C31 0x5E 640 400 256 pVGA1A,WDC90Cxx 0x5F 640 480 256 pVGA1A,WDC90Cxx 0x5C 800 600 256 WDC90C1x,WDC90C3x 0x60 1024 768 256 WDC90C3x 0x62 640 480 32,768 WDC90C3x (15 bit DAC) 0x63 800 600 32,768 WDC90C3x (15 bit DAC) AX=MODE ============================================================================= PRIMUS ------ Width Height Colors Chip ----- ------ ------ ---- 0x2A 800 600 16 P2000 0x30 1024 768 16 P2000 0x36 1280 1024 16 P2000 0x2C 640 400 256 P2000 0x2D 640 480 256 P2000 0x2B 800 600 256 P2000 0x31 1024 768 256 P2000 0x37 1280 1024 256 P2000 0x42 640 350 32,768 P2000 (15 bit DAC) 0x43 640 400 32,768 P2000 (15 bit DAC) 0x44 640 480 32,768 P2000 (15 bit DAC) 0x45 800 600 32,768 P2000 (15 bit DAC) AX=MODE ============================================================================= REALTEK ------- Width Height Colors Chip ----- ------ ------ ---- 0x1F 800 600 16 RT 3106 0x21 1024 768 16 RT 3106 0x2A 1280 1024 16 RT 3106 0x25 640 400 256 RT 3106 0x26 640 480 256 RT 3106 0x27 800 600 256 RT 3106 0x28 1024 768 256 RT 3106 0x37 1280 1024 256 RT 3106 AX=MODE ============================================================================= S3 -- Width Height Colors Chip ----- ------ ------ ---- 0x102 800 600 16 86c911 up 0x104 1024 768 16 86c911 up 0x108 1280 1024 16 86c911 up 0x101 640 480 256 86c911 up 0x103 800 600 256 86c911 up 0x105 1024 768 256 86c911 up Acclerated modes: ----------------- 0x202 800 600 16 86c911 up 0x204 1024 768 16 86c911 up 0x208 1280 1024 16 86c911 up 0x201 640 480 256 86c911 up 0x203 800 600 256 86c911 up 0x205 1024 768 256 86c911 up 0x301 640 480 32,768 86c911 up AX=0x4F02 BX=MODE ============================================================================= TRIDENT ------- Width Height Colors Chip ----- ------ ------ ---- 0x5B 800 600 16 8800,8900 0x5F 1024 768 16 8800,8900 0x5C 640 400 256 8800,8900 0x5D 640 480 256 8800,8900 0x5E 800 600 256 8900 0x62 1024 768 256 8900 AX=MODE ============================================================================= TSENG ----- Width Height Colors Chip ----- ------ ------ ---- 0x29 800 600 16 ET3000,ET4000 0x37 1024 768 16 ET3000,ET4000 0x3D 1280 1024 16 ET4000 0x2D 640 350 256 ET3000,ET4000 0x2F 640 400 256 ET4000 0x2E 640 480 256 ET3000,ET4000 0x30 800 600 256 ET3000,ET4000 0x38 1024 768 256 ET4000 AX=MODE ET4000 with 15/16 and 24 bit DAC's ---------------------------------- Width Height Colors Chip ----- ------ ------ ---- 0x2D 640 350 32/64k ET4000 (15/16 bit DAC) 0x2F 640 400 32/64k ET4000 (15/16 bit DAC) 0x2E 640 480 32/64k ET4000 (15/16 bit DAC) 0x30 800 600 32/64k ET4000 (15/16 bit DAC) 0x2DFF 640 350 16 mil ET4000 (24 bit DAC) 0x2FFF 640 400 16 mil ET4000 (24 bit DAC) 0x2EFF 640 480 16 mil ET4000 (24 bit DAC) AX=0x10F0 BL=MODE AX=0x10F2 BL = 01h Set 15 bit HiColor mode 02h Set 16 bit HiColor mode ET4000 with SS24 24 bit DAC (SpeedStar 24) ------------------------------------------ Width Height Colors Chip ----- ------ ------ ---- 0x2E 640 480 16,777,216 ET4000 (24 bit DAC) AX=0x10E0 BL=MODE ET4000 with SS24 24 bit DAC (Genoa 7900) ---------------------------------------- Width Height Colors Chip ----- ------ ------ ---- 0x3E 640 480 16,777,216 ET4000 (24 bit DAC) AX=0x10F0 BL=MODE ============================================================================= VIDEO7 ------ Width Height Colors Chip ----- ------ ------ ---- 0x62 800 600 16 V7VGA 0x65 1024 768 16 V7VGA 0x66 640 400 256 V7VGA 0x67 640 480 256 V7VGA 0x69 800 600 256 V7VGA 0x6A 1024 768 256 V7VGA AX=0x6F05 BL=MODE ============================================================================= References: ----------- Richard Wilton: Programmer's Guide to PC & PS/2 Video Systems. Microsoft Press 1987. ISBN 1-55615-103-9 Richard F. Ferraro: Programmer's guide to the EGA and VGA cards 2nd ed. Addison-Wesley 1990. ISBN 0-201-57025-4 George Sutty and Steve Blair: Advanced Programmers Guide to the EGA/VGA. Brady Books 1988. ISBN 0-13-729039-X Jake Richter & Bud Smith: Graphics Programming for the 8514/A. M&T Books 1990. ISBN 1-55851-074-5 Jake Richter: Power Programming... The IBM XGA. MIS Press 1992. ISBN 1-55828-127-4 S3 Software Development Kit, version 2.0 John Bridge's VGAKIT52. (Simtel: vga/vgakit52.zip) Finn Thoegersen's VGADOC2.ZIP (Simtel: vga/vgadoc2.zip) +------------------------------------------+-------------------------------+ | Kendall Bennett | Internet: | | RMIT Advanced Computer Graphics Centre | kjb@citri.edu.au | | CITRI Building, 723 Swanston Street | rcskb@minyos.xx.rmit.oz.au | | Carlton Victoria 3053 AUSTRALIA. | | +------------------------------------------+-------------------------------+