home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / altvb10b.zip / HLPFILES.ZIP / COLOURS.HLP < prev    next >
Text File  |  1990-10-25  |  7KB  |  173 lines

  1. ┌────────────────────────────────────────────────────┐
  2. │            SCREEN COLOURS AND ATTRIBUTES           │
  3. └────────────────────────────────────────────────────┘
  4.  
  5. The Monochrome and Colour  display boards on IBM-PC/XT
  6. and compatible computers support an 80-column, 25-line
  7. screen image,  thus allowing 80 * 25 = 2000 characters
  8. to be displayed at the same time. The screen is memory
  9. mapped to video RAM which starts at paragraph B000 Hex
  10. in mono systems and B800 Hex in colour machines.  Each
  11. location having an even-numbered address, contains the
  12. ASCII  value of  the character  at  the  corresponding
  13. screen position, and each odd-numbered location has an
  14. ATTRIBUTE  byte,  which  determines the way  that  the
  15. adjacent character is displayed.  Thus a standard text
  16. screen takes up 4000 bytes of video memory.
  17.  
  18. In  mono systems, the characters displayed may  have a
  19. number of attributes, apart from the normal text mode.
  20. Depending  on the  attribute byte  setting, characters
  21. may appear in high-intensity,  in inverse-video, blink
  22. or underlined. The ASSEMBLY.LIB Library module and its
  23. associated  definition  file,  ASSEMBLY.FUN,  provides
  24. several routines which allow  your Q-BASIC programs to
  25. write  text directly to the display with an  attribute
  26. which you supply.  The following  is an explanation of
  27. how to determine the best  attribute for your specific
  28. application.
  29.  
  30. The appearance of the character is actually controlled
  31. by the individual bit settings of its' attribute byte.
  32. These bits perform the following functions :
  33.         Blink         Intensity
  34.              Background       Foreground
  35.         ┌───┬───┬───┬───┬───┬───┬───┬───┐
  36.         │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  37.         └───┴───┴───┴───┴───┴───┴───┴───┘
  38.           │               │
  39.           │               └─ 0  Normal intensity
  40.           │                  1  High intensity
  41.           │
  42.  
  43.           0  The character does not blink
  44.           1  The character blinks
  45.  
  46. With one exception, the two groups of three bits which
  47. represent the foreground and background characteristic
  48. should be either set or reset to give the following :
  49.  
  50. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  51. │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ =   0 The character
  52. └───┴───┴───┴───┴───┴───┴───┴───┘       is invisible.
  53.  
  54. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  55. │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ 1 │ 1 │ =   7 White on black
  56. └───┴───┴───┴───┴───┴───┴───┴───┘       (normal video)
  57.  
  58. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  59. │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ =   1 Normal video
  60. └───┴───┴───┴───┴───┴───┴───┴───┘       (underlined)
  61.  
  62. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  63. │ 0 │ 1 │ 1 │ 1 │ 0 │ 0 │ 0 │ 0 │ =  70 Black on white
  64. └───┴───┴───┴───┴───┴───┴───┴───┘      (inverse video)
  65.  
  66. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  67. │ 0 │ 1 │ 1 │ 1 │ 0 │ 1 │ 1 │ 1 │ = 119 White on white
  68. └───┴───┴───┴───┴───┴───┴───┴───┘       (filled block)
  69.  
  70.  
  71. The decimal number to the right of the bit box, is the
  72. decimal number you should supply to Q-BASIC  functions
  73. to set the attribute you require.
  74.  
  75. To make the character blink add 128 to attribute given
  76. and to display it in intense video add 8.
  77.  
  78. These added  values set the blink and  intensity bits,
  79. respectively.
  80.  
  81.  
  82. ┌────────────────────────────────────────────────────┐
  83. │                     COLOURS                        │
  84. └────────────────────────────────────────────────────┘
  85.  
  86. In colour systems,  the procedure  is exactly the same
  87. except that the two groups  of bits  which control the
  88. foreground  and  background  characteristics,  can  be
  89. individually set to determine the display colours. The
  90. three bits of each group produce eight different color
  91. combinations  and setting the intensity bit  gives the
  92. foreground a range of eight further colours. Underline
  93. characters are not produced in colour mode.
  94.  
  95.  
  96.  
  97.  
  98.         Blink         Intensity
  99.              Background       Foreground
  100.         ┌───┬───┬───┬───┬───┬───┬───┬───┐
  101.         │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  102.         └───┴───┴───┴───┴───┴───┴───┴───┘
  103.           3   R   G   B   │   R   G   B
  104.           │   e   r   l   │
  105.           │   d   e   u   └── 0  normal intensity
  106.           │       e   e       1  high intensity
  107.           │       n
  108.  
  109.           0  The character does not blink
  110.           1  The character blinks
  111.  
  112.  
  113. ┌────────────────────────────────────────────────────┐
  114. │   Colours available in alphanumeric (text) mode.   │
  115. ├────────────────────────────────────────────────────┤
  116. │   Intensity   R       G       B      Colour        │
  117. └────────────────────────────────────────────────────┘
  118.         0       0       0       0      Black
  119.         0       0       0       1      Blue
  120.         0       0       1       0      Green
  121.         0       0       1       1      Cyan
  122.         0       1       0       0      Red
  123.         0       1       0       1      Magenta
  124.         0       1       1       0      Brown
  125.         0       1       1       1      Light Grey
  126.         1       0       0       0      Dark Grey
  127.         1       0       0       1      Light Blue
  128.         1       0       1       0      Light Green
  129.  
  130.  
  131. ┌────────────────────────────────────────────────────┐
  132. │   Colours available in alphanumeric mode. (cont.)  │
  133. ├────────────────────────────────────────────────────┤
  134. │   Intensity   R       G       B      Colour        │
  135. └────────────────────────────────────────────────────┘
  136.         1       0       1       1      Light Cyan
  137.         1       1       0       0      Light Red
  138.         1       1       0       1      Light Magenta
  139.         1       1       1       0      Yellow
  140.         1       1       1       1      White
  141.  
  142.  
  143.  
  144.  
  145. Examples:
  146.  
  147. Blink          Intense
  148.       R   G   B       R   G   B
  149. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  150. │ 0 │ 0 │ 0 │ 1 │ 1 │ 1 │ 1 │ 1 │ =  31 Intense White
  151. └───┴───┴───┴───┴───┴───┴───┴───┘       on Blue
  152.  
  153. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  154. │ 0 │ 0 │ 1 │ 1 │ 0 │ 0 │ 0 │ 0 │ =  48 Black on Cyan
  155. └───┴───┴───┴───┴───┴───┴───┴───┘
  156.  
  157. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  158. │ 1 │ 0 │ 0 │ 0 │ 1 │ 1 │ 0 │ 1 │ = 141 Magenta/Black
  159. └───┴───┴───┴───┴───┴───┴───┴───┘      (intense blink)
  160.  
  161.  
  162. ┌───┬───┬───┬───┬───┬───┬───┬───┐
  163. │ 0 │ 1 │ 0 │ 0 │ 1 │ 1 │ 1 │ 0 │ =  78 Yellow on Red
  164. └───┴───┴───┴───┴───┴───┴───┴───┘
  165.  
  166. Other nice colour settings include :
  167.  
  168. 13  Magenta on Black      14  Yellow on Black
  169. 27  Cyan on Blue          30  Yellow on Blue
  170. 32  Black on Green        96  Black on Brown
  171.  
  172.  
  173. Christy Gemmell                          25th May 1988