.TH VGA 8
.SH NAME
vga \- configure a VGA card
.SH SYNOPSIS
.B aux/vga
[
.B -cdilmpv
]
[
.I mode
]
.SH DESCRIPTION
.B Aux/vga
configures a VGA controller for various display sizes and depths.
Using the monitor type specified in
.B /env/monitor
(default
.BR vga )
and the
.I mode
given as argument
(default
.BR 640x480x1 ), 
.B aux/vga
uses the database of known VGA controllers and monitors in
.B /lib/vgadb
(see
.IR vgadb (6))
to configure
the display via the devices provided by
.IR vga (3).
The options are:
.TP
.B  -c
force the use of the software cursor even if the VGA card is capable of using
a hardware graphics cursor.
.TP
.B  -d
include the color palette in whatever actions are performed,
usually printing the contents.
.TP
.B  -i
when used with
.B -p
display the register values that will be loaded.
.TP
.B  -l
load the desired mode.
.TP
.BI  -m monitor
override the
.B /env/monitor
value.
.B /env/monitor
is usually set by including it in the
.B plan9.ini
file read by the PC boot program
.IR b.com (8).
.TP
.B -p
print the current or expected register values at appropriate points depending on
other options.
.TP
.B -v
print a trace of the functions called.
.PP
.I Mode
is of the form
.IB X x Y x Z
, where
.IR X ,
.IR Y ,
and
.I Z
are numbers specifying the display height, width, and depth respectively.
The mode must appear in 
.B /lib/vgadb
as a value for one of the monitor entries.
The usual modes are
.BR 640x480x[18] ,
.BR 800x600x[18] ,
.BR 1024x768x[18][i] ,
.BR 1280x1024x[18][i] ,
.BR 1376x1024x8 ,
and
.BR 1600x1200x8 .
A trailing
.L i
indicates interlaced operation.
.SH EXAMPLES
Change the display resolution:
.IP
.EX
aux/vga -l 1600x1200x8
.EE
.PP
Print the current VGA controller registers.
It is usually best to redirect the output of a
.B -p
command to a file to prevent confusion caused by using the VGA
controller while trying to dump its state:
.IP
.EX
aux/vga -p>/tmp/x
.EE
.PP
Force the VGA controller to a known state:
.IP
.EX
aux/vga -m vga -l
.EE
.PP
Print the current VGA controller state and what would be loaded
into it for a new resolution, but don't do the load:
.IP
.EX
aux/vga -ip 1376x1024x8>/tmp/x
.EE
.PP
.SH FILES
.TF /env/monitor
.TP
.B /env/monitor
display type (default
.IR vga ).
.TP
.B /lib/vgadb
VGA configuration file.
.SH SOURCE
.B /sys/src/cmd/aux/vga
.SH SEE ALSO
.IR vga (3),
.IR vgadb (6),
.IR b.com (8)
.SH BUGS
.B Aux/vga
makes every effort possible to verify that the mode it is about
to load is valid and will bail out with an error message 
before setting any registers if it encounters a problem.
However, things can go wrong, especially when playing with a
new VGA controller or monitor setting.
It is useful in such cases to have
the above command for setting the controller to a known state
at your fingertips.
