🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #4895

Re: A faster alternative to (Microsoft's) _remapallpalette.

#4895
From: csq031
Date: Tue, 26 Feb 1991 18:04
27 lines
1963 bytes
In article <8705@castle.ed.ac.uk> elee24@castle.ed.ac.uk (H Bruce) writes:

>I am using the 320 X 200 X 256 colour graphics mode to display
>greyscale images. This involves setting up each of the 256 entries in
>the palette with a grey scale. Using the _remapallpalette function
>this takes several seconds for what must be a trivial task. I guess
>the BIOS is getting in the way.  Assuming I have a "register
>compatible" VGA card (which almost all of them are) I should be able
>to write directly to the VGA chip.  Does anyone know the relevant port
>addresses for programming the VGA palette ?

What it looks like is that the remapallpallete calls the function to 
remap one color 256 times.  If you go direct to Bios, you can pass
a pointer to an array of RGB triples and a count of colors to update, and
do the whole palette at once.

You could also go to hardware.  The best way I've found to figure out
VGA programming is to look at the fractint sources.  (Fractint is a fractal
generator)  Fractint has a VGA driver that works transparently with nearly
all VGA cards.  They also do palette remapping with outsb, interrupts disabled.
This updates the entire palette set instantly on the user time scale.


--
             Kent Williams --- williams@umaxc.weeg.uiowa.edu 
"'Is this heaven?' --- 'No, this is Iowa'" - from the movie "Field of Dreams"
"This isn't heaven, ... this is Cleveland" - Harry Allard, in "The Stupids Die"
Technical Details
Message-ID: <4634@ns-mx.uiowa.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!ns-mx!umaxc.weeg.uiowa.edu!csq031
References: <8705@castle.ed.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!ns-mx!umaxc.weeg.uiowa.edu!csq031
From: csq031@umaxc.weeg.uiowa.edu
Newsgroups: comp.os.msdos.programmer
Subject: Re: A faster alternative to (Microsoft's) _remapallpalette.
Message-ID: <4634@ns-mx.uiowa.edu>
Date: 26 Feb 91 18:04:50 GMT
References: <8705@castle.ed.ac.uk>
Sender: news@ns-mx.uiowa.edu
Reply-To: csq031@umaxc.weeg.uiowa.edu ()
Distribution: comp
Organization: U of Iowa, Iowa City, IA
Lines: 27