Xref: utzoo comp.lang.pascal:6729 comp.os.msdos.programmer:5126 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!zephyr.ens.tek.com!vice!bobb From: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Newsgroups: comp.lang.pascal,comp.os.msdos.programmer Subject: Re: VGA (and other) border areas Message-ID: <7452@vice.ICO.TEK.COM> Date: 15 May 91 00:02:10 GMT References: <1991May14.204252.5492@ux1.cso.uiuc.edu> Reply-To: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Followup-To: comp.lang.pascal Organization: Tektronix, Inc., Beaverton, OR. Lines: 64 In article <1991May14.204252.5492@ux1.cso.uiuc.edu> amead@s.psych.uiuc.edu (alan mead) writes: >Can anyone tell me how to cause the border area of a normal display to >have a particular color? > >If possible, I'd like to do this in any video mode. > >I'm using a PS2 (model 50, but if it differs by model, I'd like to know >how to do it on any) with VGA, but I'm curious about CGA, SVGA and XVGA >(etc...) displays as well. > Well, my _Programmer's_Guide_to_the_EGA_and_VGA_cards_ tells me this. The border area color is controlled by the Overscan register (one of the VGA / EGA attribute control registers.). This register is indexed as port 11 hex from the base address of 3C0 hex. To access this port, you write 11 hex to port 3C0 to indicate which of the available ports is to receive the next byte. The following byte of information written to port 3C0 hex will be directed to the Overscan register. The overscan register is laid out as 6 bits as follows : 5 4 3 2 1 0 (bit) SR SG SB R G B where SR = secondary red SG = secondary green SB = secondary blue R = primary red G = primary green B = primary blue I won't go into detail about color mixing here, but will note that this register uses the same color coding scheme as the palette registers use for normal video. A Turbo Pascal code fragment to modify this register would be: const overscan_reg_base = $3C0; overscan_reg_index = $11; var color : byte; . . . port[overscan_reg_base] := overscan_reg_index; port[overscan_reg_base] := color; . . . /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Bob Beauchaine bobb@vice.ICO.TEK.COM C: The language that combines the power of assembly language with the flexibility of assembly language. "It seems that the less a statesman amounts to, the more he appears