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

  1.  
  2.                  ┌───────────────────────────────────┐
  3.                  │ Programming the Trident 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. ┌───────────────────────────────────┬────────────────────────────────────────
  30. │ Identifying the Trident SVGA Card │
  31. └───────────────────────────────────┘
  32.  
  33. There are two Trident SVGA chips, the TVGA 8800 and 8900.
  34.  
  35. The Trident SVGA chips can be identified by attempting to change the
  36. Mode Control #1 register as follows:
  37.  
  38.           Index : 0Eh at port 3C4h
  39.           Read/write data from port 3C5h
  40.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  41.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  42.           └───┴───┴───┴───┴───┴───┴───┴───┘
  43.                                     │
  44.                                    PAGE
  45.  
  46. First write the value 0Eh to port 3C4h. Then read the value in from port
  47. 3C5h and save it. for rest Next write the value 00h to port 3C5h and
  48. read the value back in from the port. If bit 1 in the value read is set
  49. (ie = 1) then a trident chip is present. Finally write the original value
  50. back to port 3C5h to leave the SVGA adapter in it's original state.
  51.  
  52. ┌───────────────────────────────────────────┬────────────────────────────────
  53. │ Identifying which Trident Chip is Present │
  54. └───────────────────────────────────────────┘
  55.  
  56. The Trident chip can be identified with the following psuedo code :
  57.  
  58. Port[$3C4] := $0B
  59. Port[$3C5] := $00
  60. hardware_version_number := Port[$3C5]
  61. if hardware_version_number >= 3 then
  62.   chip is an 8900
  63. else
  64.   chip is an 8800
  65.  
  66. This procedure leaves the chip in "New Mode". New Mode and Old mode are
  67. discussed below.
  68.  
  69. ┌────────────────────────────────┬───────────────────────────────────────────
  70. │ Trident Graphics Display Modes │
  71. └────────────────────────────────┘
  72.  
  73.            ┌───────────────────────────────────────────────┐
  74.            │ Mode     Resolution       Colors    Chip      │
  75.            ├───────────────────────────────────────────────┤
  76.            │ 5Bh      800x600          16        8800/8900 │
  77.            │ 5Ch      640x400          256       8800/8900 │
  78.            │ 5Dh      640x480          256       8800/8900 │
  79.            │ 5Eh      800x600          256       8900      │
  80.            │ 5Fh      1024x768         16        8800/8900 │
  81.            │ 61h      768x1024         16        8800/8900 │
  82.            │ 62h      1024x768         256       8900      │
  83.            └───────────────────────────────────────────────┘
  84.  
  85. ┌────────────────────────┬───────────────────────────────────────────────────
  86. │ Trident Display Memory │
  87. └────────────────────────┘
  88.  
  89. Both Trident chips can map video memory in either 64K or 128K paging
  90. schemes. The 8800 defaults to the 128K paging scheme at power up. This
  91. scheme is known as the "Old Mode". The 8900 defaults to the 64K paging
  92. scheme, the "New Mode". This file will concentrate solely on the 64K new
  93. mode operation.
  94.  
  95. The new mode can be set with the following procedure:
  96.  
  97. Port[$3C4] := $0B               { Set the old mode 128K scheme }
  98. Port[$3C5] := $00
  99. dummy_variable := Port[$3C5]    { Toggle over to the new mode }
  100.  
  101. Trident bank switching is weird, REALLY weird! In new mode, the New Mode
  102. Control Register # 1 is used to select the active bank:
  103.  
  104.           Index : 0Eh at port 3C4h
  105.           Read/write data from port 3C5h
  106.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  107.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  108.           └───┴───┴───┴───┴───┴───┴───┴───┘
  109.                             └─┬─┘   │   │
  110.                             Bank  Page Seg
  111.  
  112. Bits 3-0 can be considered as a single 4 bit bank number. However, when
  113. you write to video memory the Trident inverts the Page bit to determine
  114. which bank should actually be written to. So if you set these bits to the
  115. value 0 (0000) then bank 0 will be used for all read operations and bank 2
  116. (0010) will be used for all write operations.
  117.  
  118. The following code will set the bank number for all read operations:
  119.  
  120. PortW[$3C4] := bank_number shl 8 + $0E;
  121.  
  122. The following code will set the bank number for all write operations:
  123.  
  124. PortW[$3C4] := (bank_number xor 2) shl 8 + $0E;
  125.  
  126. It is important to realise that setting the write bank number changes the
  127. read bank number, and visa-versa. How you are supposed to rapidly transfer
  128. blocks of data around on the Trident screen is beyond me.
  129.  
  130.