PDA

View Full Version : ATI Config program 'mask' parameter



per
September 8th, 2010, 01:08 PM
If you are familiar with the 18800 class ATI EGA/VGA cards, you migth have noticed that there are a parameter for ECONFIG/VCONFIG/VINSTALL named 'mask' (it is followed by three 8-bit hexadecimal numbers). This parameter is demonstrated twice in the readme, where it explains how to disable/enable palette optimization for graphics emulation to a TTL mono monitor. There is also another example displaying how to enable the special 160x100@16 "tweaked" CGA mode durning VGA operation.

The parameters are:

ECONFIG/VCONFIG/VINSTALL MASK BA FF 40

ECONFIG/VCONFIG/VINSTALL MASK BA BF 00

ECONFIG/VCONFIG/VINSTALL EGA C80
ECONFIG/VCONFIG/VINSTALL CGA
ECONFIG/VCONFIG/VINSTALL MASK B8 FB 00
ECONFIG/VCONFIG/VINSTALL MASK B4 FF 20

First of all, there is a clear pattern present here; Only one bit is deviant in one of the two last numbers. Secondly, one of the two last numbers are allways FF (second number) or 00 (third number). Because of this, I have concluded that those two values are for bit-manipulation of some register. From the trend described two lines before this, I have concluded that the second number is ANDed with the register, and the third number is ORed with the register. As it turns out, the first numbers actually correspond to register numbers when we take this document into account: http://www.artofhacking.com/IET/PRGM/live/aoh_ati.htm . In fact, register/Index BA actually controlls several settings for different emulation modes.

If my theory is rigth, the two instructions from the manual sets and resets the "reserved" bit in the BA register. Moving on to the CGA tweaked-mode emulation commands, those first sets EGA 80-character emulation, then sets CGA emulation, and the mask commands re-enables all the VGA registers for some reason before write protecting something called "CR80-86" and "CR140-144".

So, my theory is that the parameter syntax is as follows:

ECONFIG/VCONFIG/VINSTALL MASK 'IndexNr' 'AndVal' 'OrVal'

1CEh register 'IndexNr' = ((1CEh register 'IndexNr') AND 'AndVal') OR 'OrVal'

Any thougths on this?