🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #388

ATI Wonder VGA and 256 colors - a summary

#388
From: Torkil Hammer
Date: Thu, 03 May 1990 17:58
48 lines
2610 bytes
I asked for leads about the BGI and CHR formats used by Borland,
and this is what I got:

1. Several people said that if I mail Borland a floppy, they will
   fill it up with BGI and CHR goodies.  They didn't.  Your mileage
   may vary.

2. Several people told me that these goodies are available from Simtel.
   They are.  To get started, read the 'frequently asked questions'
   list that Ray Chen publishes (Thanks, Ray!!) and be prepared for
   some adventure.  The bottom line is that if you can read this,
   you can also get files from Simtel, by ftp, email or other.

3. This is what I have found from experiments:
   It is possible to get 16 colors from a 256K palette from VGA
   mode 0x12 using the standard Turbo library, and the mode 0x13 driver
   available from simtel gives you the 256 colors from the 256K palette
   but there is a catch:

     You can use either the EGA Palette registers (16 colors from a
     64 color palette) or the VGA Color registers (16 or 256 colors
     depending on VGA mode from a palette of 262144 colors) but not
     both at the same time.
     
     To use the EGA registers, simply use setpalette(i,EGAcolor[i]);
     EGAcolor is a byte in the 0..63 range, encoded as 00rgbRGB with
     [rgb] = 33% intensity and [RGB] = 67%.

     To use the VGA registers, use setrgbpalette(i,r[i],g[i],b[i])
     where r,g,b is a byte is the 0..63 range directly specifying
     the intensity.  setrgbpalette() works in mode 0x12, which is the
     640x480 dots by 16 colors supported by the standard VGA driver,
     and in mode 0x13, which is 320x200 dots by 256 colors supported
     by the VGA256.BGI driver you get from Simtel.

     Either way, a statement like fillstyle(SOLID_FILL,13) selects
     the color in the EGA or VGA register 13.

     Here is the catch:  Before using the VGA color registers, you must
     neutralize the EGA palette registers by the statement
        for (i=0; i<16; i++) setpalette(i,i);
     or else your rainbow will get ugly spots.  This applies to mode
     0x12 and 0x13.

     BTW, This is for an ATI Wonder board using Turbo C 2.0  Again, your
     mileage may vary.

Torkil Hammer
Technical Details
Message-ID: <3384@psivax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!psivax!torkil

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!psivax!torkil
From: torkil@psivax.UUCP (Torkil Hammer)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: ATI Wonder VGA and 256 colors - a summary
Summary: Yours for the taking
Message-ID: <3384@psivax.UUCP>
Date: 3 May 90 17:58:43 GMT
Distribution: usa
Organization: Pacesetter Systems Inc., Sylmar, CA
Lines: 48