Documentation for Palet2a.com, Release 2a Overview -------- Palet.com is a TSR (Terminate, but Stay Resident) program that ties into int 10h and traps (or allows to pass) any changes to the values stored in the EGA registers. It occupies only 448 bytes of memory (exclusive of memory taken up by its environment). The program will not reload, but will pass any parameters to the resident portion when you call it subsequent times. Command line instructions palet ----- Entering this will display a usage screen to refresh your memory, it will not install the resident portion of palet. palet d (reset to default) -------- Entering this will install (if not already installed) the TSR portion of palet and write the default values stored within palet to the EGA registers. This is a good way to "clean everything up" after playing with setting the EGA regis- ters with the next command. The 'd' command should precede any other parameters on the command line. palet d1 d2 .... d16 (set EGA register values) -------------------- Entering this will set any or all of the sixteen EGA palette registers. The numbers d1, d2, etc. are two digit decimal numbers that represent one of the 64 valid values for the EGA colors. The numbers may be separated by a space, or you may run all digits together (in which case any single digit must be preceded by a zero, ie.: 7 4 16 is same as: 070416). It is not necessary to enter values for registers above the ones you wish to change. Values for registers you wish to remain unchanged can be replaced with a period, ie.: palet ..7....2 will change registers 3 and 8, and leave others unchanged. This command will change the EGA registers and by default, will set the 'X' switch, which will allow other programs to change the EGA registers also (see the exclude and exclude text commands). palet b[+|-] (blinking commands) Entering palet b+ will turn blinking on. Entering palet b- will turn it off. Entering palet b will turn it on if it was off and off if it was on. The original setting is off. Page 1 Documentation for Palet2a.com, Release 2a palet u[+|-|] (underlining commands) Entering palet u+ will turn underlining on at the bottom of the character. Entering palet u- will turn underlining off. Entering palet u, immediately followed by a one or two digit decimal number will turn underlining on if the line represented by the number is in the character and off otherwise. For example, palet u3 will underline (strike-out) at line 3. Just like the palette register numbers above, be sure that you follow a one-digit number with either a space or a letter. Finally, entering palet u will turn underlining on at the bottom of the character if it is off and off if it was on. The original setting is off. Technical note: palet learns where the bottom of the character is from Video BIOS data location 40:85. BIOS int 11H updates this value. If u+ doesn't work for your character set, you might want to check if its software does. palet e (exclude changes) ------- Entering this will set the exclude changes switch. Palet will now prevent any attempt to change the values in the EGA registers, no matter what display mode is set (text or graphics). If you have programs that display in graphics mode, but don't provide a way to set the colors used, then this is a way to do it. Some trial and error will usually show you which EGA registers the program is using so that you can set the registers to suit your preference. Generally, the easiest way to use palet for this is in a batch file, ie.: echo off palet d1 d2 .....d16 e program (program to run) palet d This file will set the registers of the EGA, make the change exclusive and load the program to run. Upon exiting the program, palet will set the EGA registers to the default value, leaving the exclude switch set. palet t (exclude text color changes) ------- This is a variation on the exclude command, as it will only trap text mode color changes, ie. attempts to change EGA register values while the display is in graphics mode will go through. palet x (turn off exclusions) ------- This command will turn off e or t exclusions, and allow other software to reset the EGA registers. palet f (disable palet) (turn oFf) ------- This command will disable palet. Any command with a legal argument will enable it again. Page 2 Documentation for Palet2a.com, Release 2a palet n (enable palet) (turn oN) ------- This command will enable palet. Use it after "palet f" if you don't want to change anything in the previous setup. Command usage ------------- All commands can be combined in any way, with the exception of the 'd' command, which when used, should precede all other parameters on the command line. examples: -------- palet ...4...16e will write the octal values 4 and 16 (4 and 14 dec- imal) to the 4th and 8th registers, and set the exclude switch. palet d..7....2t will write default values to 16 registers, then change the 3rd and 8th registers, and set the text exclude switch. palet dx will write default values to 16 registers, and turn off the exclude switches. Of course it would be silly to combine 'x' with 't' or 'e' in the same call. ----------------- Technical --------- When palet is called, it first checks for DOS 2.0 or higher, and the existence of the EGA, then 'hooks' itself into int 10h (video interrupt). EGA registers are reset (if requested in the parameters), and palet's internal switches are set (if specified in the parameters). Palet then removes most of itself from memory, leaving behind the TSR portion that monitors all calls to int 10h. A flag is used within palet to monitor the current display mode, this way palet can determine whether or not to allow changes to the EGA registers to pass (based on the 'E' and 'T' switch settings). Any display mode function call to the EGA will reset all EGA registers to the system default values. Palet will allow the display mode change to go through, then check the 'T' and 'E' switch settings, if the display mode has been changed to graphics, and the 'T' switch is set, then palet will allow any EGA register changes to pass, until the display mode is changed back to text. On the other hand, if the 'E' switch is set, then palet will immediately write the values stored in it's buffer area to the EGA registers, and trap any attempts to change those values. Any EGA register changes initiated by a call to palet will be allowed to pass with any switch settings (palet knows when it is called by itself). Page 3 Documentation for Palet2a.com, Release 2a A table of palet's default values is contained within the program code (out- side of the resident portion). By carefully patching palet with debug, you can customize the default values to your preference. DOS normally uses the 8th EGA register for its text color (white), and the 1st register for its background color; the 3rd EGA register normally contains the value for green. If you pre- fer green text on black, you can switch the values of the 3rd and 8th EGA reg- isters (this way you still have white available, albeit in the 3rd EGA regis- ter). Use debug to patch the locations below: address value now (hex) EGA register ---------------------------------------------- 0a00h 1fh Underline line 0a01h 0h Blink 0a02h 0h 1 0a03h 1h 2 0a04h 2h 3 0a05h 3h 4 0a06h 4h 5 0a07h 5h 6 0a08h 14h 7 0a09h 7h 8 0a0ah 38h 9 0a0bh 39h 10 0a0ch 3ah 11 0a0dh 3bh 12 0a0eh 3ch 13 0a0fh 3dh 14 0a10h 3eh 15 0a11h 3fh 16 example: debug palet.com -e 0a02 xxxx:0A02 00.{enter new value here, hex number between 0 and 3F} -w -q Do this carefully, and do not change values beyond 0a11h. Please note that programs which write directly to the EGA registers (and not using int 10h) will be able to defeat palet. Programs like this are considered 'ill-behaved' since they don't use standard DOS or EGA BIOS calls, but address the hardware directly. Page 4 Documentation for Palet2a.com, Release 2a Post Script ----------- Palet.com, Release 2 is a public domain program, no claims are made to its effectiveness or reliability. The original palette.com has been in use for some time with no problems, Release 2 should also cause no problems. Palet.com has evolved to it's current level through the joint efforts of Charles Lazo III and Tim Worley, whose collaboration began with an exchange of e-mail on CompuServe. Help support the 'hacker ethic', report any bugs, mod- ifications, or suggestions for improvements to: Charles Lazo III Tim Worley P.O. Box 452 or 1314 Poplar St. Hohenwald, TN 38462 Charlottesville, VA 22901 CIS ID [72210,17] CIS ID [71336,730] Palet can remain in continuing development if you so desire, but let's make it a joint effort. Page 5