Mail Archives: djgpp/1997/04/25/09:10:18
From: | Shawn Hargreaves <shawn AT talula DOT demon DOT co DOT uk>
|
To: | djgpp AT delorie DOT com
|
MMDF-Warning: | Parse error in original version of preceding line at relay-11.mail.demon.net
|
Subject: | Re: Changing the color palette
|
Date: | Fri, 25 Apr 1997 11:13:11 +0100
|
MIME-Version: | 1.0
|
Message-ID: | <861971208.09281.0@[194.129.18.166]>
|
Roger Noss writes:
> From http://www.execulink.com/~pweeks/chapter.html, I read that you can
> change a color in the palette by writing to 0x3c8 and 0x3c9. I tried it and
> it works.
>
> Does anyone know when the palette is changed: instantaneously or on the next
> vertical retrace?
Instantaneously. But it's not a good idea to change it at any times other than
the retrace, because:
a) When doing fades, this can produce nasty phase effects as bands of
slightly different colors move up or down the screen.
b) Most cards can't read and write the palette registers at the same time. This
means that whenever you modify them, there is a moment when the display
circuitry is unable to access them, so it outputs a few pixels of garbage to
the screen. This is described as "snow", and doesn't look very good!
It's much better to wait for a vertical retrace before you modify the palette:
take a look at Denthor's VGA tutorials in the PCGPE for more information
about this (ftp://x2ftp.oulu.fi/pub/msdos/programming/gpe/).
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk
"Beauty is a French phonetic corruption of a short cloth neck ornament"
- Raw text -