Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!hpda!hpcuhc!hpcupt3!defaria@hpcupt3.cup.hp.com From: defaria@hpcupt3.cup.hp.com (Andy DeFaria) Newsgroups: comp.lang.pascal Subject: Re: setting foreground text colors Message-ID: <45670025@hpcupt3.cup.hp.com> Date: 24 Jun 91 22:38:24 GMT References: <27270@adm.brl.mil> Organization: Hewlett Packard, Cupertino Lines: 28 >/ hpcupt3:comp.lang.pascal / STANKULI%UWF.BITNET@cunyvm.cuny.edu ( stan kulikowski ii) / 11:48 am Jun 21, 1991 / > > i have been playing with the rom bios routines in my ps/2 . the following >procedure uses the video services to change the background color. > > procedure SET_BACKGROUND (COLOR : integer); > begin > CLEAR (REGISTER); (* Sets them all to 0 *) > REGISTER.ah := $10; > REGISTER.bh := COLOR; > intr ($10,REGISTER); > end; (* SET_BACKGROUND procedure *) > > when i call this the background switches to the right color (0-15) leaving >the text chars displayed in whatever color they were in. > > what i have not figured out is how to set the foreground color of the chars >to whatever i want. i have been using R.T. Stevens (1989) Graphics Programming >in C as my reference, but to no avail. > > does anyone have a tp procedure which sets the foreground color to whatever >color you want for subsequent writelns? i can do this when ansi.sys is >installed with the escape codes to the screen, but i would like to handle >this from the rom bios video services if i can. Why not simply use TP's own TextBackground (I believe that's what it's called) and TextColor procedures? They are in the CRT unit I believe and do the job for you. RTFM or use the help to look them up.