home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uwm.edu!ogicse!zephyr.ens.tek.com!vice!bobb
- From: bobb@vice.ICO.TEK.COM (Robert Beauchaine)
- Newsgroups: comp.lang.pascal
- Subject: Re: Changing the colorpalette in Textmode?
- Message-ID: <10203@vice.ICO.TEK.COM>
- Date: 20 Aug 92 21:05:24 GMT
- Article-I.D.: vice.10203
- References: <1992Aug20.130835.137@csghsg5a.bitnet> <1992Aug20.180431.23873@uwasa.fi>
- Organization: Tektronix, Inc., Beaverton, OR.
- Lines: 66
-
- In article <1992Aug20.180431.23873@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes:
- >In article <1992Aug20.130835.137@csghsg5a.bitnet> 89612048s@csghsg5a.bitnet writes:
- >>In the normal Textmode you can display 8 backgroundcolors and
- >>16 Foregroundcolors. Is it possible to use all 16 colors for
- >>Fore- and Background. And is it possible to change the 16
- >
- >I am sorry that I have lost the reference, but it is possible.
- >(Better scanty information than none). I seem to recall that for
- >the additional 8 background colors one gives up the blink attribute.
- >Hopefully someone else recalls the details or has a pointer to them.
- >But this is definitely on.
- >
-
- For EGA/VGA monitors, a simple BIOS call will do the trick:
-
- procedure egahi; { Allows 16 foreground/background colors }
- var regs : registers;
- begin
- with regs do begin
- ah := $10;
- al := 3;
- bl := 0;
- end;
- intr($10,regs);
- end;
-
- procedure egablink; { Allows 16 foreground, 8 background, and
- 8 blinking background colors }
- var regs : registers;
- begin
- with regs do begin
- ah := $10;
- al := 3;
- bl := 1;
- end;
- intr($10,regs);
- end;
-
- It's not so simple for a CGA. Bit #5 (starting from 0) in the
- mode-control register (port $3d8) controls the blink enable of the
- monitor. 0 implies no blink (hi intensity background), 1 gives
- blinking foreground. Unfortunately, port $3d8 is a write-only
- port, so doing a read/or/write won't work. You have to look into
- the BIOS to find the current video mode and create a word to send
- to the port yourself. Here are the bit meanings:
-
- BIT CLEAR SET
- 6,7 not used
- 5 blink disable blink enable
- 4 normal resolution high resolution (640x200)
- 3 video disabled video enabled
- 2 color mode black-and-white mode
- 1 Alphanumeric mode grahpics mode
- 0 40x25 alphanumeric 80x25 alphanumeric
-
- Obviously, some bit combinations don't make sense. But it will
- work; I've done it before.
-
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
-
- Bob Beauchaine bobb@vice.ICO.TEK.COM
-
- C: The language that combines the power of assembly language with the
- flexibility of assembly language.
-
- Real friends don't let friends use UNIX.
-