papa%USC-CSE%ECLA@sri-unix.UUCP (07/05/84)
From: Marco Papa <papa%USC-CSE@ECLA> After I posted my original message, I got just one answer (from Chris Schmandt), and by then I had already solved the problem. Anyway, here's is the problem and the possible solutions. My message concerned how to switch from the color adapter to the monochrome adapter (and viceversa) without wiping out the contents of the monitor you are switching to (all IBM published methods wipe out the target monitor display). The first solution is as follows. Copy the code of the SET_MODE BIOS source code (see p. A-50 of the XT Technical Reference Manual), with two changes: delete the code that "FILLS REGEN AREA WITH BLANKS" and then the one that changes the CRT_PALETTE byte in the Video Display Data Area. This solution works fairly well (and it is the one that has been usually suggested) except that whenever you switch to the color display a sudden blink and flicker appears on the display. This is due to the fact that the code for SET_MODE always resets the 6845. This is very annoying to the eye. The second solution does not have any problem and is a lot shorter in terms of code. The program keeps internally two copies of the VIDEO DISPLAY DATA AREA (see p. A-4 of the Tech Ref.): one for the color adapter and one for the mono adapter. Whenever a MONO --> COLOR switch is requested the current values in the BIOS VIDEO AREA are saved in the appropriate internal area, and the previously saved values for the color adapter are loaded in the BIOS VIDEO AREA. This requires very few instructions and no flicker is produced. The COLOR --> MONO switch works the same way. Of course, in any case, the EQUIP_FLAG must be changed to report the currently active adapter. Marco Papa ARPA, CSNET: papa.usc-cse@csnet-relay UUCP: ..!randvax!uscvax!papa