home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4932 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  2.8 KB

  1. 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
  2. From: bobb@vice.ICO.TEK.COM (Robert Beauchaine)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Changing the colorpalette in Textmode?
  5. Message-ID: <10203@vice.ICO.TEK.COM>
  6. Date: 20 Aug 92 21:05:24 GMT
  7. Article-I.D.: vice.10203
  8. References: <1992Aug20.130835.137@csghsg5a.bitnet> <1992Aug20.180431.23873@uwasa.fi>
  9. Organization: Tektronix, Inc., Beaverton,  OR.
  10. Lines: 66
  11.  
  12. In article <1992Aug20.180431.23873@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes:
  13. >In article <1992Aug20.130835.137@csghsg5a.bitnet> 89612048s@csghsg5a.bitnet writes:
  14. >>In the normal Textmode you can display 8 backgroundcolors and
  15. >>16 Foregroundcolors. Is it possible to use all 16 colors for
  16. >>Fore- and Background. And is it possible to change the 16
  17. >
  18. >I am sorry that I have lost the reference, but it is possible. 
  19. >(Better scanty information than none).  I seem to recall that for
  20. >the additional 8 background colors one gives up the blink attribute. 
  21. >Hopefully someone else recalls the details or has a pointer to them. 
  22. >But this is definitely on. 
  23. >
  24.  
  25.   For EGA/VGA monitors, a simple BIOS call will do the trick:
  26.  
  27.   procedure egahi; { Allows 16 foreground/background colors }
  28.   var regs : registers;
  29.   begin
  30.     with regs do begin
  31.       ah := $10;
  32.       al := 3;
  33.       bl := 0;
  34.     end;
  35.     intr($10,regs);
  36.   end;
  37.  
  38.   procedure egablink;  { Allows 16 foreground, 8 background, and
  39.              8 blinking background colors }
  40.   var regs : registers;
  41.   begin
  42.     with regs do begin
  43.       ah := $10;
  44.       al := 3;
  45.       bl := 1;
  46.     end;
  47.     intr($10,regs);
  48.   end;
  49.  
  50.   It's not so simple for a CGA.  Bit #5 (starting from 0) in the
  51.   mode-control register (port $3d8) controls the blink enable of the
  52.   monitor.  0 implies no blink (hi intensity background), 1 gives
  53.   blinking foreground.  Unfortunately, port $3d8 is a write-only
  54.   port, so doing a read/or/write won't work.  You have to look into
  55.   the BIOS to find the current video mode and create a word to send
  56.   to the port yourself.  Here are the bit meanings:
  57.  
  58.   BIT        CLEAR               SET
  59.   6,7        not used
  60.   5          blink disable       blink enable
  61.   4          normal resolution   high resolution (640x200)
  62.   3          video disabled      video enabled
  63.   2          color mode          black-and-white mode
  64.   1          Alphanumeric mode   grahpics mode
  65.   0          40x25 alphanumeric  80x25 alphanumeric
  66.  
  67.   Obviously, some bit combinations don't make sense.  But it will
  68.   work; I've done it before.
  69.  
  70. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 
  71.  
  72. Bob Beauchaine bobb@vice.ICO.TEK.COM 
  73.  
  74. C: The language that combines the power of assembly language with the 
  75.    flexibility of assembly language.
  76.  
  77. Real friends don't let friends use UNIX.
  78.