Contents of the VGA_PAL.DOC file
VGA_PAL : VGA/MCGA palette loader
by Patrick Mueller, May 1990.
VGA_PAL is a program to view and set VGA/MCGA palette registers.
This allows you to change any of the colors displayed on your
VGA_PAL reads from the stdin device and writes to the stdout
device, so you can run it either is a prompted mode (by just
typing VGA_PAL) or a batch mode (by having input redirected to it
from a file or output from another program).
VGA_PAL is written in Microsoft C, and compiled with Microsoft
QuickC. The source is included.
The commands VGA_PAL accepts are:
Print all register settings.
Print first 16 register settings.
Print vga register settings for one color
SET x r g b
Set color x with red, green and blue values r g b.
If x is ON, palette will be reloaded on mode changes.
If x is OFF, palette will be remain during mode changes.
The machine default is to reload the palette on mode
changes, which causes the palette to be reloaded
to the power-on defaults whenever a MODE command
is executed (or the MODE is changed via bios().
Quits. The program will also quit if input is coming
from a redirected file and the end of the file is
Display help information.
Included are four default palette files:
default.pal - loads registers with default power-on settings.
reverse.pal - reverses all colors
wash.pal - dulls colors to produce washed out effect
wild.pal - enhances all colors a bit
To load one of these palettes in, execute the command
VGA_PAL < DEFAULT.PAL
To turn the MODELOAD switch on or off, you can execute
ECHO MODELOAD OFF | VGA_PAL
For VGA and MCGA adapters, there are 256 registers called the
palette registers that determine what colors are displayed
on your screen. For instance, when a program wants to display
something in black, it uses color 0. Blue is color 1, etc.
The standard mapping is:
0 : black
1 : blue
2 : green
3 : cyan
4 : red
5 : magenta
6 : brown
7 : white
8 : grey
9 : bright blue
10 : bright green
11 : bright cyan
12 : bright red
13 : bright magenta
14 : yellow
15 : bright white
Older display adapters only support 16 colors. VGA and MCGA adapters
support 256 colors. Since many programs (other than games) must
support older adapters, they only allow you to use colors 0 .. 15.
The actual color displayed is determined by the palette register
for that color number. Each palette register contains 3 values:
the amount of red in the color, the amount of green in the color,
and the amount of blue in the color (RGB). The color value may
be between 0 (no color) and 63 (as much of that color as there is).
For example, the color 0, black, will generally have values of 0
for red, green and blue. Red will have some value for red, but
0s for blue and green. See the file default.pal for the default
colors used by the system.