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

  1.  
  2.                   ┌─────────────────────────────────┐
  3.                   │ Programming the Tseng 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. │ Identifying the Tseng SVGA Card │
  30. └─────────────────────────────────┘
  31.  
  32. Tseng Labs have produced two SVGA Chips, the ET3000 and the ET4000.
  33.  
  34. The Tseng SVGA chips can be identified by attempting to change the
  35. Miscellaneous register as follows:
  36.  
  37.           Index : 06h at port 3C0h
  38.           Read/write data from port 3C1h
  39.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  40.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  41.           └───┴───┴───┴───┴───┴───┴───┴───┘
  42.                     └─┬─┘
  43.                      High
  44.  
  45. Output the value 6 to port 3C0h and read a byte from port 3C1h. Modify
  46. the high field in this byte (eg new byte = byte XOR 30h) and write this
  47. new byte to port 3C1h. Read the byte from port 3C1h and see if the byte
  48. was successfully modified, if it was then a Tseng chip is present. Having
  49. done this, write the original byte back to port 3C1h to leave the graphics
  50. adapter in it's original state.
  51.  
  52. ┌─────────────────────────────────────────┬──────────────────────────────────
  53. │ Identifying which Tseng Card is Present │
  54. └─────────────────────────────────────────┘
  55.  
  56. The ET4000 can be distinguished from the ET3000 by attempting to change the
  57. ET4000 Extended Start Address register as follows:
  58.  
  59.           Index : 33h at port 3D4h
  60.           Read/write data from port 3D5h
  61.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  62.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  63.           └───┴───┴───┴───┴───┴───┴───┴───┘
  64.                             └─┬─┘   └─┬─┘
  65.                              CAD     DAD
  66.  
  67. The same technique is used as was used to identify the presence of a
  68. Tseng chip, both fields should be modified, written, tested for a successful
  69. write and then restored to their original values. If the change was
  70. successful an ET4000 chip is present, otherwise an ET3000 chip is.
  71.  
  72. ┌──────────────────────────────┬─────────────────────────────────────────────
  73. │ Tseng Graphics Display Modes │
  74. └──────────────────────────────┘
  75.  
  76.             ┌─────────────────────────────────────┐
  77.             │ Mode     Resolution       Colors    │
  78.             ├─────────────────────────────────────┤
  79.             │ 25h      640x480          16        │
  80.             │ 29h      800x600          16        │
  81.             │ 2Dh      640x350          256       │
  82.             │ 2Eh      640x480          256       │
  83.             │ 2Fh      640x400          256       │
  84.             │ 30h      800x600          256       │
  85.             │ 37h      1024x768         16        │
  86.             │ 38h      1024x768         256       │
  87.             └─────────────────────────────────────┘
  88.  
  89. All graphics modes in the above table are supported by the ET4000. I am not
  90. sure which modes are supported by the ET3000.
  91.  
  92. ┌──────────────────────┬─────────────────────────────────────────────────────
  93. │ Tseng Display Memory │
  94. └──────────────────────┘
  95.  
  96. In my opinion the Tseng memory mapping was designed to prevent graphics
  97. programmers from suffering nervous breakdowns!
  98.  
  99. Two banks can be mapped to the segment A000:0000-FFFFh, one for
  100. reading and one for writing. The banks can be selected by writing to
  101. the Segment Select Registers at port 3Cdh:
  102.  
  103. ET3000 Segment Select Register:
  104.           Port 3CDh
  105.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  106.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  107.           └───┴───┴───┴───┴───┴───┴───┴───┘
  108.                     └───┬───┘   └───┬───┘
  109.                       Read         Write
  110.                       Bank         Bank
  111.  
  112. ET4000 Segment Select Register:
  113.           Port 3CDh
  114.           ┌───┬───┬───┬───┬───┬───┬───┬───┐
  115.           │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  116.           └───┴───┴───┴───┴───┴───┴───┴───┘
  117.             └─────┬─────┘   └─────┬─────┘
  118.                  Read           Write
  119.                  Bank           Bank
  120.  
  121. Both of these registers can be read from as well as written to.
  122.  
  123. Each bank is 64K long, has a 64K granularity and is mapped to host
  124. memory A000:0000-FFFFh.
  125.  
  126. ┌─────────────────────┬──────────────────────────────────────────────────────
  127. │ DPMI and the ET4000 │
  128. └─────────────────────┘
  129.  
  130. Apparently the ET4000 chip is capable of linear addressing in dos protect-
  131. mode programs. To enable this feature write the value 36h to port 3D4h,
  132. read the value from port 3D5h, set the lower nibble (bits 0 -> 3) to the
  133. value 1 and rewrite the value to port 3D5h. Resetting these bits to the
  134. value 0 puts the chip back in regular segmented addressing mode.
  135.  
  136. I have no information where or how the entire ET4000 memory would then be
  137. mapped to linear memory. If anyone has more information on this or has a
  138. Tseng card they are willing to try it on let me know.
  139.  
  140.