home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / graphdoc / ramdac.txt < prev    next >
Text File  |  1994-01-18  |  14KB  |  482 lines

  1. RAMDACs
  2.  
  3. AcuMos:
  4. ADAC1        15/16/24 bit.
  5.  
  6. Analog Devices:
  7. ADV471       6bit DAC       15 overlay registers
  8. ADV475       6bit DAC       15 overlay registers
  9. ADV476       6bit DAC
  10. ADV477       8bit DAC       15 overlay registers
  11. ADV478       6/8bit DAC     15 overlay registers
  12.  
  13. ATI:
  14. ATI68830     15/16/24bit    Up to 80 MHz    !
  15. ATI68860     15/16/24bit    ???
  16. ATI68875     15/16/24bit    Up to 135 MHz   ! Used in ATI Graphics Ultra + and 
  17.                             Pro.  Same as TI34075 ??
  18.  
  19. AT&T:
  20. ATT20c490    15/16/24 bit.  6/8 bit DAC.
  21. ATT20c491    15/16/24 bit.  6/8 bit DAC w/gamma correction
  22. ATT20c492    15/16/18 bit   6bit DACs. w/gamma correction
  23. ATT20c493    15/16/18 bit   6bit DACs
  24. ATT20c497    24bit          ?
  25.  
  26. Avance Logic:
  27. ALG1101      16-bit.        Appears to be different from the other HiColor
  28.                             DACs.
  29.  
  30. Avasem:
  31. AV3676       6bit DAC
  32.  
  33. Brooktree:
  34. Bt476        6bit DAC.
  35. Bt478        6/8bit DAC.
  36. Bt481
  37. Bt482
  38. Bt484        15/16/24bit    6/8bit DAC. Has hardware cursor.
  39. Bt485        15/16/24bit    6/8bit DAC. Has hardware cursor.
  40.  
  41. Cirrus Logic
  42. CL-GD5200    15/16/24 bit   Same as Acumos ADAC1 
  43.  
  44. Diamond:
  45. SS2410       15/24 bit.     
  46.  
  47. Inmos:
  48. IMSG171
  49. IMSG176      6bit DAC
  50. IMSG178
  51.  
  52. MUSIC:
  53. MU9C1710     8 bit ??
  54. MU9C4870     15/16 bit      Similar to Sierra "Mark 3".
  55. MU9C4910     15/16/24bit
  56.  
  57. OAK:
  58. OTI66        6bit DAC
  59. OTI66HC      15/16bit       Similar to Sierra "Mark 3"
  60.  
  61. Samsung:
  62. KDA476       6bit DAC
  63.  
  64. Sierra  "Mark1":       Only works if the VGA controller can send a byte on
  65.                        both the rising AND falling edge of the dot clock.
  66. SC11481      15-bit.        6-bit DAC.   Overlay.
  67. SC11486      15-bit.        6-bit DAC.
  68. SC11488      15 bit.        6/8 bit DAC. Overlay.
  69.  
  70. Sierra  "Mark2":
  71. SC11482      15-bit.        6-bit DAC.   Overlay.
  72. SC11483      15-bit.        6-bit DAC.
  73. SC11484      15-bit.        6/8 bit DAC. Overlay.
  74.  
  75. Sierra  "Mark3":
  76. SC11485      15/16 bit.     6-bit DAC.   Overlay.
  77. SC11487      15/16 bit.     6-bit DAC. 
  78. SC11489      15/16 bit.     6/8 bit DAC. Overlay.
  79.  
  80. SC15025      15/16/24 bit.
  81. SC15026      15/16/24 bit.
  82.  
  83. UMC:
  84. UM70c178     15/16 bit          Similar to Sierra "Mark 3"
  85.  
  86.  
  87. 15-bit modes have 5 bits of each basic color:
  88. bit  0- 4 blue.
  89.      5- 9 green.
  90.     10-14 red.
  91. The pixel is stored in two bytes in Intel style (little endian).
  92.  
  93. 16-bit modes have 5 bits of red and blue, and 6 bits of green:
  94. bits 0- 4  blue.
  95.      5-10  green.
  96.     11-15  red.
  97. The pixel is stored in two bytes in Intel style (little endian).
  98.  
  99. 24-bit modes have 8 bits of each basic color:
  100. bits 0- 7  blue.
  101.      8-15  green
  102.     16=23  red.
  103. The pixel is stored in three bytes in Intel style (little endian).
  104.  
  105.  
  106.  
  107. The DACs are addressed on port 3C6h-3C9h. Advanced DACs have 1 or 2 extra
  108. address lines (RS2 and RS3). These may be controlled from high address bits
  109. (A10-A15) or from registers.
  110. In the following +A is used if RS2 is set, +B is used if RS3 is set and +C if both RS2 and RS3 are set.
  111.  
  112.  
  113.  
  114. HiColor DACs:     (Sierra SC1148x, MUSIC MU9C4870, OAK OTI66HC, UMC UM70C178)
  115.  
  116. 3C6h+A  (R/W):  Command Register
  117. bit   5  (not SC11481/6/8)
  118.          If set two pixel clocks are used to latch the two bytes
  119.          needed for each pixel. Low byte is latched first.
  120.          If clear the low byte is latched on the rising edge of the
  121.          pixel clock and the high byte is latched on the falling edge.
  122.          Only some VGA chips (ET4000 and C&T655x0) can handle this.
  123.       6  (SC11485/7/9, OTI66HC, UM70C178) Set in 16bit (64k) modes (Only valid
  124.            if bit 7 set). On the SC11482/3/4 this bit is read/writable, but
  125.            has no function. On the SC11481/6/8 this bit does not exist.
  126.       7  Set in HiColor (32k/64k) modes, clear in palette modes.
  127. Note:  This register can also be accessed at 3C6h by reading 3C6h four times,
  128.        then all accesses to 3C6h will go the this register until one of the
  129.        registers 3C7h, 3C8h or 3C9h is accessed.
  130.  
  131. 3C7h+A  (R/W):  Overlay RAM Read Address              (SC11481/2/4/5/8/9 only)
  132. bit 0-3  Read index for the Overlay registers.
  133.  
  134. 3C8h+A  (R/W):  Overlay RAM Write Address             (SC11481/2/4/5/8/9 only)
  135. bit 0-3  Write index for the Overlay registers.
  136.  
  137. 3C9h+A  (R/W):  Overlay RAM                           (SC11481/2/4/5/8/9 only)
  138. bit 0-5  Data port for the overlay registers. Works like the PEL data register
  139.          (3C9h) except that the overlay registers are accessed and the Overlay
  140.          Address registers are used for indexes.
  141. Note: on the SC11484/8/9 the Color Look-up Table and the overlay registers are
  142.       24bits wide (rather than 18bits) if the 8/6 pin is high. 
  143.  
  144.  
  145.  
  146. Sierra SC15025/6 Truecolor DACs:
  147.  
  148. 3C6h+A  (R/W):  Command Register
  149. bit 5-7  Mode:  0: Normal, 3: 24bit, 4,5: 15bit, 6,7: 16bit
  150.       4  If set 3C7h is the index port and 3C8h the data port for an extra
  151.          register set:
  152.            index   8h:   DAC width. 00h: 6bit, 01h: 8bit
  153.                    9h:   53h
  154.                    Ah:   00h ??
  155.                    Bh:   DAC Speed. ACh: 135MHz, B1h: 80NHz
  156.                 Ch-Fh:   FFh ??
  157.                   10h:   00h ??
  158. Note:  This register can also be accessed at 3C6h by reading 3C6h four times,
  159.        then all accesses to 3C6h will go the this register until one of the
  160.        registers 3C7h, 3C8h or 3C9h is accessed.
  161.  
  162.  
  163.  
  164. AT&T 20c49x Truecolor DACs:
  165.  
  166. 3C6h+A  (R/W):  Command Register
  167. bit   1  (not 492,493) In mode 0 this bit when set selects 8bit DACs, when
  168.          clear 6bit DACs.
  169.     5-7  Mode:  0: Palette, 5: 15bit (32k), 6: 16bit (64k), 7: 24bit (16m)
  170. Note:  This register can also be accessed at 3C6h by reading 3C6h four times,
  171.        then all accesses to 3C6h will go the this register until one of the
  172.        registers 3C7h, 3C8h or 3C9h is accessed.
  173.  
  174.  
  175.  
  176. BrookTree Bt484, Bt485 Truecolor DACs:
  177.  
  178. 3C6h+A  (R/W):  Command Reg 0
  179. bit    1  Set if DAC and palette registers are 8bit DACs, clear if 6bit.
  180.        7  If clear the Status register is present at 3C&h+A, if set 3C8h
  181.           determines which register is present at 3C6h+A:
  182.             00h    Status Register
  183.             01h    Command Register 3
  184. 3C6h+B is the Command Register 3, if clear the Status Register
  185.          
  186.  
  187. 3C7h+A  (R/W):  Cursor Read Address
  188. bit 0-7  The PEL data register (0..255) to be read from 3C9h.
  189. Note: After reading the 3 bytes at 3C9h this register will increment,
  190.       pointing to the next data register.
  191.  
  192. 3C8h+A  (R/W):  Cursor Write Address
  193. bit 0-7  The PEL data register (0..255) to be written to 3C9h.
  194. Note: After writing the 3 bytes at 3C9h this register will increment, pointing
  195.       to the next data register.
  196.  
  197. 3C9h+A  (R/W):  Cursor Data
  198. bit 0-5  Color value
  199. Note:  Each read or write of this register will cycle through first the
  200.        registers for Red, Blue and Green, then increment the appropriate
  201.        address register.
  202. Note: the registers 3C7h-3C9h (+A) works like the normal 3C7h-3C9h registers,
  203.       except that a separate set of palette registers (16 overlay registers ?)
  204.       are being accessed.
  205.       Index 00h  Overscan color
  206.             01h  Cursor Background
  207.             02h  Cursor Foreground
  208.  
  209. 3C6h+B  (R/W):  Status Reg
  210. Note: The two registers at 3C6h+B are selected by bit 7 of 3C6h+A.
  211.  
  212. 3C6h+B  (R/W):  Command Reg 3
  213. Bit  0-1  Bits 8-9 of the Palette Write Address (3C8h)
  214.        2  Set if using 64x64 cursor, clear if 32x32 cursor.
  215.        3  Enable Clock Doubler if set ?
  216. Note: The two registers at 3C6h+B are selected by bit 7 of 3C6h+A.
  217.  
  218. 3C7h+B  (R/W):  Cursor Ram Data
  219. bit  0-7  Data port for the Hardware Cursor Map.
  220.           There are 2 128byte (32x32bit) maps. The map at offset 0 is the
  221.           cursor image and the one at 80h is the cursor shape.
  222.           To update the cursor map, write the start address to 3C8h and start
  223.           writing to this register. The index will increment for each byte.
  224.  
  225. 3C8h+B  (R/W):  Command Reg 1
  226. bit  0-7  Mode: 10h: 24bit, 30h: 15bit, 38h: 16bit, 40h: 8bit palette,
  227.            60h: 4bit palette
  228.  
  229. 3C9h+B  (R/W):  Command Reg 2
  230. bit  0-1  Cursor mode. 2 for Windows, 3 for X11, 0 for off ??
  231.        3  Set in interlaced modes ?
  232.      2-7  Always 8 ??
  233.  
  234. 3C6h+C  W(R/W):  Hardware Cursor X-position
  235. bit 0-1  The X-position of the rightmost pixel of the hardware cursor
  236.  
  237. 3C8h+C  W(R/W):  Hardware Cursor Y-position
  238. bit 0-11  The Y-position of the lower scanline of the hardware cursor
  239.  
  240.  
  241.  
  242.  
  243. Forcing HiColor DACs into command mode:
  244.  
  245. procedure dactocomm;   {switches DAC to command register}
  246. var x:word;
  247. begin
  248.   x:=inp($3C8);    {clear old state}
  249.   x:=inp($3C6);
  250.   x:=inp($3C6);
  251.   x:=inp($3C6);    {Read $3C6 4 times.}
  252.   x:=inp($3C6);
  253. end;
  254.  
  255. Now reads and writes to $3C6 will access the command register.
  256. Any access to $3C7-$3C9 will switch back to the PEL mask register.
  257.  
  258.  
  259. Forcing HiColor DACs into normal mode:
  260.  
  261. procedure dactopel;  {switches DAC back to normal mode}
  262. var x:word;
  263. begin
  264.   x:=inp($3C8);
  265. end;
  266.  
  267.  
  268.  
  269. function testdac:string;
  270. var
  271.   x,y,z,v,oldcommreg,oldpelreg:word;
  272.  
  273. type
  274.   pel=record
  275.         index,red,green,blue:byte;
  276.       end;
  277.  
  278. procedure readpelreg(index:word;var p:pel);
  279. begin
  280.   p.index:=index;
  281.   disable;
  282.   outp($3C7,index);
  283.   p.red  :=inp($3C9);
  284.   p.blue :=inp($3C9);
  285.   p.green:=inp($3C9);
  286.   enable;
  287. end;
  288.  
  289. procedure writepelreg(var p:pel);
  290. begin
  291.   disable;
  292.   outp($3C8,p.index);
  293.   outp($3C9,p.red);
  294.   outp($3C9,p.blue);
  295.   outp($3C9,p.green);
  296.   enable;
  297. end;
  298.  
  299. function setcomm(cmd:word):word;
  300. begin
  301.   dac2comm;
  302.   outp($3c6,cmd);
  303.   dac2comm;
  304.   setcomm:=inp($3c6);
  305. end;
  306.  
  307. procedure waitforretrace;
  308. begin
  309.   repeat until (inp(CRTC+6) and 8)=0;
  310.   repeat until (inp(CRTC+6) and 8)>0;    {Wait until we're in retrace}
  311. end;
  312.  
  313. function dacis8bit:boolean;
  314. var
  315.   pel2,x,v:word;
  316.   pel1:pel;
  317. begin
  318.   pel2:=inp($3C8);
  319.   readpelreg(255,pel1);
  320.   v:=pel1.red;
  321.   pel1.red:=255;
  322.   writepelreg(pel1);
  323.   readpelreg(255,pel1);
  324.   x:=pel1.red;
  325.   pel1.red:=v;
  326.   writepelreg(pel1);
  327.   outp($3C8,pel2);
  328.   dacis8bit:=(x=255);
  329. end;
  330.  
  331. function testdacbit(bit:word):boolean;
  332. begin
  333.   dac2pel;
  334.   outp($3C6,oldpel and (bit xor $FF));
  335.   dac2comm;
  336.   disable;
  337.   outp($3C6,oldcomm or bit);
  338.   v:=inp($3C6);
  339.   outp($3C6,v and (bit xor $FF));
  340.   enable;
  341.   testdacbit:=(v and bit)<>0;
  342. end;
  343.  
  344. begin
  345.  
  346.   setDAC(_dac8,'Normal');
  347.   dac2comm;
  348.   oldcomm:=inp($3C6);
  349.   dactopel;
  350.   oldpel:=inp($3c6);
  351.  
  352.   dac2comm;
  353.   outp($3c6,0);
  354.   dac8:=dacis8bit;
  355.   dac2pel;
  356.  
  357.   notcomm:=oldcomm xor 255;
  358.   outp($3c6,notcomm);
  359.   dac2comm;
  360.   v:=inp($3c6);
  361.   if v<>notcomm then
  362.     if (setcomm($E0) and $e0)<>$e0 then
  363.     begin           {Bits 5-7 of command register NOT writable.}
  364.       dac2pel;
  365.       x:=inp($3C6);
  366.       repeat
  367.         y:=x;         {wait for the same value twice}
  368.         x:=inp($3C6);
  369.       until (x=y);
  370.       z:=x;
  371.       dac2comm;
  372.       if daccomm<>$8E then
  373.       begin                 {If command register=$8e, we've got an SS24}
  374.         y:=8;
  375.         repeat
  376.           x:=inp($3C6);
  377.           dec(y);
  378.         until (x=$8E) or (y=0);
  379.       end
  380.       else x:=daccomm;
  381.       if x=$8e then setDAC(_dacss24,'SS24')
  382.                else setDAC(_dac15,'Sierra SC11486');
  383.       dac2pel;
  384.     end
  385.     else begin
  386.       if (setcomm($60) and $E0)=0 then
  387.       begin
  388.         if (setcomm(2) and 2)>0 then setDAC(_dacatt,'ATT 20c490')
  389.                                 else setDAC(_dacatt,'ATT 20c490');
  390.       end
  391.       else begin
  392.         x:=setcomm(oldcomm);
  393.         if inp($3c6)=notcomm then
  394.         begin
  395.           if setcomm($FF)<>$ff then setDAC(_dacadac1,'Acumos ADAC1')
  396.           else begin
  397.             dac8now:=dacis8bit;
  398.             dac2comm;
  399.             outp($3C6,(oldcomm or 2) and $FE);
  400.             dac8now:=dacis8bit;
  401.             if dac8now then
  402.               if dacis8bit then setDAC(_dacatt,'ATT 20c491')
  403.                            else setDAC(_dacCL24,'Cirrus 24bit DAC')
  404.             else setDAC(_dacatt,'ATT 20c492');
  405.           end;
  406.         end
  407.         else begin
  408.           if trigdac=notcomm then setDAC(_dacCL24,'Cirrus 24bit DAC')
  409.           else begin
  410.             dac2pel;
  411.             outp($3c6,$FF);
  412.             case trigdac of
  413.               $44:setDAC(_dacmus,'MUSIC ??');
  414.               $82:setDAC(_dacmus,'MUSIC MU9C4910');
  415.               $8e:setDAC(_dacss24,'Diamond SS2410');
  416.             else
  417.               if testdacbit($10) then setDAC(_dacsc24,'Sierra 16m')
  418.               else if testdacbit(4) then setDAC(_dacUnk9,'Unknown DAC #9')
  419.                                 else setDAC(_dac16,'Sierra 32k/64k');
  420.             end;
  421.           end;
  422.         end;
  423.       end;
  424.     end;
  425.  
  426.     dac2comm;
  427.     outp($3c6,oldcomm);
  428.   end;
  429.   dac2pel;
  430.   outp($3c6,oldpel);
  431.  
  432.   if (dactype=_dac8) and (DAC_RS2<>0) and (DAC_RS3<>0) then
  433.   begin
  434.     oldpel :=inp($3C6);
  435.     oldcomm:=inp($3C6+DAC_RS2);
  436.     outp($3C6+DAC_RS2,oldpel xor $FF);
  437.     if (inp($3C6)=oldpel) and (inp($3C6+DAC_RS2)=(oldpel xor $FF)) then
  438.       SetDAC(_dacBt484,'Brooktree Bt484');
  439.  
  440.     outp($3C6+DAC_RS2,oldcomm);
  441.     outp($3C6,oldpel);
  442.   end;
  443.  
  444.  
  445.  
  446.   if dactype=_dac8 then
  447.   begin
  448.     WaitforRetrace;
  449.     outp($3C8,222);
  450.     outp($3C9,$43);
  451.     outp($3C9,$45);
  452.     outp($3C9,$47);    {Write 'CEGEDSUN' + mode to DAC index 222}
  453.     outp($3C8,222);
  454.     outp($3C9,$45);
  455.     outp($3C9,$44);
  456.     outp($3C9,$53);
  457.     outp($3C8,222);
  458.     outp($3C9,$55);
  459.     outp($3C9,$4E);
  460.     outp($3C9,13);     {Should be in CEG mode now}
  461.     outp($3C6,255);
  462.     x:=(inp($3c6) shr 4) and 7;
  463.     if x<7 then
  464.     begin
  465.       setDAC(_dacCEG,'Edsun CEG rev. '+chr(x+48));
  466.       WaitforRetrace;
  467.       outp($3C8,223);
  468.       outp($3C9,0);    {Back in normal dac mode}
  469.     end;
  470.   end;
  471. end;
  472.  
  473.  
  474. This ID's all known DAC types, except:
  475.  - Sierra "mark2" and "Mark3" are all ID'd as Mark 3.
  476.  
  477.  - Avance Logic ALG1101 DAC can not be ID'd.
  478.  
  479.  - TI 34075, ATI 68830, 68860 and 68875 can not be ID'd
  480.  
  481.  - The Edsun CEG test has not been verified.
  482.