Documentation of the AdvanceCAB vga utility.
1 Synopsis
vga [/l] [/u] [/a] [/c CONFIG] [/d] [/e]
2 Description
The `vga` utility is a TSR (Terminate and Stay Resident) VGA BIOS wrapper that substitutes the default list of VGA video modes with a list of favorite modes which work best with your video hardware.
The `vga.exe` executable can be used as a standard executable or it can also be loaded as a `sys` driver in the `config.sys` with `device=`. Please note that the `sys` version cannot be unloaded.
At startup the configuration file `vga.rc`, created with the utility `vgav`, is read and all the modelines present are activated. The format of this configuration file is specified in the document `advv.txt`.
These are some example rc files:
| ntsc.rc | NTSC TV. | |
| pal.rc | PAL TV. | |
| standard.rc | Arcade Standard Resolution (15 kHz). | |
| medium.rc | Arcade Medium Resolution (25 kHz). | |
| extended.rc | Arcade Extended Resolution (16.5 kHz). | |
| pcvga.rc | VGA PC Monitor. | |
| pcsvga60.rc | SVGA PC Multisync Monitor. |
From all the modelines in the configuration file three of them are chosen for the standard VGA modes 1h, 3h and 13h.
| 1h | width of 40*9 or 40*8 pixels. | |
| 3h | width of 80*9 or 80*8 pixels. | |
| 13h | width of 320 pixels and height of 200 pixels. |
All the other modelines are used to adjust any other VGA mode detected. When the current video mode width and height match a modeline, the modeline is automatically applied.
3 Options
These are the command line options supported:
| /l |
| Load the utility in memory and adjust the current video mode if a corresponding mode is defined in the config file. |
| /u |
| Unload the utility. |
| /a |
| Adjust the current video mode if a corresponding mode is defined in the config file without loading the utility in memory. |
| /c CONFIG |
| Use an arbitrary configuration file for the /l and /a commands. |
| /d |
| Disable all video output from other programs. This option works only if the program is loaded in memory. Remember to re-enable the video output before running your programs. |
| /e |
| Enable the video output. |
You can force a video mode reset in text mode using the standard DOS command:
mode co80 |
or with the `video` utility.
4 Cards
This utility should work with any VGA-compatible board.
5 How It Works
This utility intercepts all VGA BIOS calls and if it detects a ModeSet call for a known mode it uses its own version of the mode.
At any call of interrupt 08h and 21h some VGA registers are read. If a VGA mode with the size of a known modeline is detected, the mode is adjusted to match the mode defined in the configuration file.
The disabling of the video output works by ignoring all int 10h calls.
6 Limitations
Only the modelines compatible with VGA hardware are used.
The text modes can use only the pixel clocks 28.322, 25.175, 14.161 and 12.587 MHz. The graphics modes can use only the pixel clocks 14.161, 12.587, 7.080 and 6.293 MHz.
7 Examples
Load it:
vga /l |
Load it with an arbitrary configuration file:
vga /l /c c:\myconf.rc |
Unload it:
vga /u |
Load it in the config.sys file:
device=c:\cab\vga.exe /l /c c:\cab\vga.rc |
Adjust the current video mode in the config.sys without loading in memory the utility:
device=c:\cab\vga.exe /a /c c:\cab\vga.rc |
Adjust the current video mode in the config.sys and disable all the video output:
device=c:\cab\vga.exe /l /d /c c:\cab\vga.rc |
The latter is probably the most interesting use. You can load `vga` as soon as possible to adjust the video output and prevent other programs from writing to the screen. You can also use the `video` utility to load an arbitrary image to display. After the system is initialized you can insert in the autoexec.bat the command:
c:\cab\vga /e |
to re-enable the video output.
8 Bugs
The configuration file is checked only for the `device_video_modeline` options. All the other options are ignored.

