home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PCGPEV10.ZIP / VIDEO7.TXT < prev    next >
Text File  |  1994-05-10  |  7KB  |  198 lines

  1.  
  2.                  ┌──────────────────────────────────┐
  3.                  │ Programming the Video7 SVGA Chip │
  4.                  └──────────────────────────────────┘
  5.  
  6.                  Written for the PC-GPE by Mark Feldman
  7.             e-mail address : u914097@student.canberra.edu.au
  8.                              myndale@cairo.anu.edu.au
  9.  
  10.                   Please read the file SVGINTRO.TXT
  11.               (Graphics/SVGA/Intro PC-GPE menu option)
  12.  
  13.              ┌───────────────────────────────────────────┐
  14.              │      THIS FILE MAY NOT BE DISTRIBUTED     │
  15.              │ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. │
  16.              └───────────────────────────────────────────┘
  17.  
  18.  
  19. ┌────────────┬───────────────────────────────────────────────────────────────
  20. │ Disclaimer │
  21. └────────────┘
  22.  
  23. I assume no responsibility whatsoever for any effect that this file, the
  24. information contained therein or the use thereof has on you, your sanity,
  25. computer, spouse, children, pets or anything else related to you or your
  26. existance. No warranty is provided nor implied with this information.
  27.  
  28. ┌───────────────────┬────────────────────────────────────────────────────────
  29. │ Video7 Extensions │
  30. └───────────────────┘
  31.  
  32. To modify any of the Video7 extended registers you must enable the
  33. extensions. Disable them once you are done.
  34.  
  35. To enable extensions:
  36.  
  37. PortW[$3C4] := $EA06;
  38.  
  39. To disable extensions:
  40.  
  41. PortW[$3C4] := $AE06;
  42.  
  43.  
  44.  
  45. ┌──────────────────────────────────┬─────────────────────────────────────────
  46. │ Identifying the Video7 SVGA Chip │
  47. └──────────────────────────────────┘
  48.  
  49. The presence of a Video7 chip can be detected with the following procedure:
  50.  
  51. var old_value, new_value, id : byte;
  52.  
  53. EnableVideo7Extensions;
  54. Port[$3D4] := $0C;
  55. old_value := Port[$3D5];
  56. Port[$3D5] := $55;
  57. new_value := Port[$3D5];
  58. Port[$3D4] := $1F;
  59. id := Port[$3D5];
  60. Port[$3D4] := $0C;
  61. Port[$3D5] := old_value;
  62. DisableVideo7Extentions;
  63.  
  64. { Check that register value is $55 Xor $EA }
  65. if id = $BF then
  66.   card is a video7
  67. else
  68.   card isn't a video7
  69.  
  70.  
  71. ┌──────────────────────────────────────────┬─────────────────────────────────
  72. │ Identifying which Video7 Chip is Present │
  73. └──────────────────────────────────────────┘
  74.  
  75. Once you know that the video card has a video7 in it you can read the Chip
  76. Revision register to find out which chip it is:
  77.  
  78. Port[$3C4] := $8E;
  79. chip := Port[$3C5];
  80.  
  81.               ┌────────────────────────────────────────┐
  82.               │ Value in                               │
  83.               │ chip variable     Video7 Chip          │
  84.               ├────────────────────────────────────────┤
  85.               │ 40h-49h           1024i                │
  86.               │ 50h-59h           V7VGA Version 5      │
  87.               │ 70h-7Eh           V7VGA FASTWRITE/VRAM │
  88.               │ 80h-FFh           VEGA VGA             │
  89.               └────────────────────────────────────────┘
  90.  
  91. ┌───────────────────────────────┬────────────────────────────────────────────
  92. │ Video7 Graphics Display Modes │
  93. └───────────────────────────────┘
  94.  
  95.                   ┌──────────────────────────────────┐
  96.                   │ Mode     Resolution      Colors  │
  97.                   ├──────────────────────────────────┤
  98.                   │ 60h      752x410          16     │
  99.                   │ 61h      720x540          16     │
  100.                   │ 62h      800x600          16     │
  101.                   │ 63h      1024x768         2      │
  102.                   │ 64h      1024x768         4      │
  103.                   │ 65h      1024x768         16     │
  104.                   │ 66h      640x400          256    │
  105.                   │ 67h      640x480          256    │
  106.                   │ 68h      720x540          256    │
  107.                   │ 69h      800x600          256    │
  108.                   └──────────────────────────────────┘
  109.  
  110. ┌───────────────────────┬────────────────────────────────────────────────────
  111. │ Video7 Display Memory │
  112. └───────────────────────┘
  113.  
  114. Remeber, the extensions must be enabled before calling any of the following
  115. procedures.
  116.  
  117. The Video7 version 1-3 chips use a ridiculously complex method to switch
  118. banks (in my opinion at least), so for these chips I'll only include the code
  119. to bank switch and leave the technical info on what it does and why it does
  120. it till a future PC-GPE version (if ever).
  121.  
  122. The version 1-3 chips map two banks to host memory A000:0000-FFFFh. One bank
  123. is used for read operations, the other is used for write operations. For 256
  124. color modes there are 16 64k banks (numbered 0 - 15 for the following
  125. procedures). One really "stuffed in the head" thing about these chips (from
  126. a programmers point of view anyway) is that both bank registers use a common
  127. SVGA register to store their 2 low order bits, so if you set the Read Bank
  128. number, the Write Bank number's 2 low order bits will be set the same as the
  129. Read Bank number's 2 low order bits.
  130.  
  131. The Write Bank number for 256 color modes can be set with the following
  132. procedure:
  133.  
  134. Port[$3C4] := $F9;
  135. Port[$3C5] := bank_number and 1;
  136. Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);
  137. Port[$3C4] := $F6;
  138. Port[$3C5] := (Port[$3C5] and $FC) or (bank_number shr 2);
  139.  
  140. The Read Bank number for 256 color modes can be set with the following
  141. procedure:
  142.  
  143. Port[$3C4] := $F9;
  144. Port[$3C5] := bank_number and 1;
  145. Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);
  146. Port[$3C4] := $F6;
  147. Port[$3C5] := (Port[$3C5] and $F3) or (bank_number and $0C);
  148.  
  149. By version 4 Headlands Technologies had gotten their act together and
  150. adopted a more "sane" bank switching scheme. Version 4 supports both single
  151. and duel paging schemes. There are 16 64k long banks, and a 64k granularity
  152. with the techniques used here.
  153.  
  154. The single paging scheme maps a bank to host memory A000:0000-FFFFh for
  155. both read and write operations. The single paging scheme is the
  156. default for version 4, but can also be set with the following procedure:
  157.  
  158. Port[$3C4] := $E0;
  159. Port[$3C5] := Port[$3C5] and $7F
  160.  
  161. The Single/Write Bank Register is used to select which bank to map to
  162. host memory:
  163.  
  164.           Index : E8h at port 3C4h
  165.           Read/Write at port 3C5h
  166.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  167.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  168.           └───┴───┴───┴───┴───┴───┴───┴───┘
  169.             └─────┬─────┘
  170.                  Bank
  171.  
  172. A bank can be selected with the following procedure:
  173.  
  174. PortW[$3C4] := (bank_number shl 12) + $E8;
  175.  
  176. In duel paging mode one bank is mapped to A000:0000-FFFF for write operations
  177. and another for read operations. Duel paging mode can be selected with the
  178. following procedure:
  179.  
  180. Port[$3C4] := $E0;
  181. Port[$3C5] := Port[$3C5] or $80;
  182.  
  183. The Single/Write Bank Register (see above) is used to select which bank to
  184. map to host memory for writing operations. The Read Bank Register selects
  185. which bank to use for read operations:
  186.  
  187.           Index : E9h at port 3C4h
  188.           Read/Write at port 3C5h
  189.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  190.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  191.           └───┴───┴───┴───┴───┴───┴───┴───┘
  192.             └─────┬─────┘
  193.                  Bank
  194.  
  195. A read bank can be selected with the following procedure:
  196.  
  197. PortW[$3C4] := (bank_number shl 12) + $E9;
  198.