home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / VGADOC4B.ZIP / INTRO.TXT < prev    next >
Text File  |  1995-09-29  |  15KB  |  341 lines

  1. Introduction.
  2.  
  3. This is intended as a collection of documentation about all the various
  4. display adapters for the IBM PC series (and relatives). This is NOT intended
  5. as an introduction to basic VGA programming or as a ready-to-use library.
  6. There are numerous books available on the subject with much better general
  7. VGA/graphics programming sections. Neither is this intended to cover
  8. benchmarking, highlevel graphics algorithms, graphics file formats or specific
  9. graphics programs.
  10.  
  11. This compilation (c) Copyright 1991-95 Finn Thoegersen. All Rights Reserved.
  12. See the file README.1ST for contact information and conditions for use and
  13. distribution. This file MUST be included unmodified in all distributions.
  14.  
  15.  
  16.  
  17. Terminology/style:
  18.  
  19. The BIOS calls are mostly taken directly from Ralf Brown's interrupt list
  20. and tends to follow its style and structure.
  21.  
  22. The register descriptions are sorted by the register number.
  23.  
  24. All register addresses, data values et cetera are given in hexadecimal.
  25.  
  26. 3d4h means 3D4h when in color mode and 3B4h when in monochrome mode.
  27.  
  28. 3CEh index 3 means register 3CEh is set to 3 and register 3CFh is the
  29.      data port. See notes on register 3C0h under VGA registers.
  30.      On some cards write operations can be done with a single OUTW
  31.      instruction. This may fail on some cards or machines.
  32.      ATI cards require the index to be updated before each access to
  33.      the dataport.
  34.  
  35. (R)   means the register is Read Only.
  36. (W)   means the register is Write Only.
  37. (R/W) means the register is both Readable and Writable.
  38.  
  39. Sometimes the size of the registers is given as:
  40.   W(R/W):   The register is 2 bytes (16 bits) long. If the register is
  41.             indexed, the low byte is in the low index (n) and the high byte is
  42.             in the high index (n+1) unless otherwise indicated.
  43.   3(R/W):   The register is 3 bytes (24 bits) long. The lowest byte is in the
  44.             low index (n), the middle byte is in the middle index (n+1) and
  45.             the upper byte in the high index (n+2).
  46.  
  47.  
  48. Examples are in Turbo Pascal for readability (your mileage may vary,
  49. I don't discuss politics, choice of computer, editor, keyboard,
  50. programming language or other religious matters on the net  :-) ).
  51. Seriously while assembler can be more precise and/or efficient for the
  52. low-level register access, the complexity and volume of assembler can make
  53. even simple examples totally incomprehensible to all but experts.
  54. Also when I started this my "C" was not up to the task, so ...
  55.  
  56.  
  57. A short translation of terms:
  58.  
  59. Pascal:         C:                  Assembler:         Description:
  60.  
  61. x:byte;         unsigned char x;    x  DB ?            8 bit unsigned byte
  62.  
  63. y:word;         unsigned int y;     y  DW ?            16 bit unsigned word.
  64.  
  65. z:integer;      int z;              z  DW ?            16 bit signed word.
  66.  
  67. w:longint;      long w;             w  DD ?            32 bit signed Dword
  68.  
  69. s:string[20];   char s[21];         x DB 20 dup(?)     a 20 character string
  70.  
  71. $ABCD           0xABCD              0ABCDh             The value 43981
  72.                                                           (ABCD hex)
  73.  
  74. x:=port[$3CC]   x=inp(0x3CC)        MOV DX,03CCh       Read an 8bit value from
  75.                                     IN AL,DX           I/O port $3CC.
  76.  
  77. y:=portw[$3CE]  y=inpw(0x3CE)       MOV DX,03CEh       Read a 16bit value from
  78.                                     IN AX,DX           I/O ports $3CE and $3CF
  79.  
  80. port[$3C2]:=x   outp(0x3C2,x)       MOV DX,03C2h       Write an 8bit value to
  81.                                     OUT DX,AL          I/O port $3C2.
  82.  
  83. portw[$3CE]:=y  outpw(0x3CE,y)      MOV DX,03CEh       Write a 16bit value to
  84.                                     OUT DX,AX          I/O ports $3CE and $3CF
  85.  
  86. a shr 3         a>>3                SHR AX,3           Shifts a 3 bits rights
  87.                                                        (Divides by 8).
  88.  
  89. a shl 3         a<<3                SHL AX,3           Shifts a 3 bits left
  90.  
  91. inc(a)          a++                 INC [a]            Increments a by 1
  92.  
  93. dec(a)          a--                 DEC [a]            Decrements a by 1
  94.  
  95. {Comment}       /* comment */       ;comment           Comments.
  96. 'string'        "string"            DB "string"        Text string
  97.  
  98. procedure x;    void x(void)        x PROC             A procedure/function
  99. var x:integer;    {                  ;Alloc x on stack with no parameters
  100. begin               int x;           _code_            a local variable
  101.   _code_            _code_           ;reset stack      and main body.
  102. end;              }                  RET
  103.  
  104. function y:     int y(void)        Well you            A function returning
  105.   integer;        {                figure it out!      an integer.
  106. begin
  107.   y:=123;           return(123)
  108. end;              }
  109.  
  110.  
  111.  
  112. The examples use a number of simple rutines:
  113.  
  114. procedure vio(ax:word);    {Calls interrupt 10h with register AX=parameter ax
  115.                           other registers can be set in the rp structure.
  116.                           rp.ax is set to the return value in the AX register}
  117.  
  118. function inp(reg:word):byte;   {returns a byte from I/O port REG.}
  119.  
  120. procedure outp(reg,val:word);  {writes the byte VAL to I/O port REG}
  121.  
  122. function rdinx(pt,inx:word):word;   {read register PT index INX}
  123.  
  124. procedure wrinx(pt,inx,val:word);   {write VAL to register PT index INX}
  125.  
  126. procedure modinx(pt,inx,mask,nwv:word);
  127.                                 {In register PT index INX change the bits
  128.                                  indicated by MASK to the ones in NWV
  129.                                  keeping the other bits unchanged).
  130.  
  131. function tstrg(pt,msk:word):boolean;   {Returns true if the bits specified in
  132.                                         MSK are read/writable in register PT}
  133.  
  134. function testinx(pt,rg:word):boolean;  {Returns true if all 8 bits of register
  135.                                         PT index RG are read/writable}
  136.  
  137. function testinx2(pt,rg,msk:word):boolean;
  138.                                    {Returns true if the bits specified in MSK
  139.                                     are read/writable in register PT index RG}
  140.  
  141. procedure dac2pel;                 {Forces the DAC back to PEL (normal) mode}
  142.  
  143. procedure dac2comm;                {Enter command mode of HiColor DACs}
  144.  
  145.  
  146.  
  147.  
  148. References:
  149.  
  150. Richard F. Ferraro's Programmer's guide to the EGA and VGA cards 2nd ed.
  151. Addison-Wesley 1990. ISBN 0-201-57025-4.
  152.  
  153. Richard F. Ferraro's Programmer's guide to the EGA, VGA  and Super VGA cards:
  154.  including XGA cards, 3rd ed. Addison-Wesley 1994. ISBN 0-201-62490-7.
  155.  
  156. George Sutty and Steve Blair's Advanced Programmers Guide to Super VGAs.
  157. Brady Books 1990. ISBN 0-13-010455-8.
  158.  
  159. John Mueller and Wallace Wang's The Ultimate DOS Programmer's Manual.
  160. Windcrest/McGraw-Hill 1990. ISBN 0-8306-3434-3.
  161.  
  162. Jake Richter's Power Programming the IBM XGA.
  163. MIS Press 1992. ISBN 1-55828-127-4 (1-55828-124-9 with disc).
  164.  
  165. Ralf Brown's interrupt list version 47.
  166.     (Simtel: info/inter47a.zip - info/inter47f.zip)
  167.   This is based on contributions from many people, including:
  168.     Dennis Grinberg    dennis+@cs.cmu.edu         MCGA/VGA
  169.     Michael A. Moran   Michael@cup.portal.com     VGA INT 10h
  170.     Gary E. Miller     GEM@cup.portal.com         Paradise, WD90c & Diamond
  171.                                                   Stealth 24X VGA
  172.     Michael Shiels     mshiels@ziebmef.uucp       ATI VIP INT 10h
  173.     Robert Seals       rds95@leah.Albany.EDU      ATI VGA Wonder modes
  174.     Peter Sawatzki     IN307@DHAFEU11.BITNET      Video7 extended INT 10
  175.     Ben Myers          0003571400@mcimail.com     Everex Viewpoint VGA, NCR
  176.                                                   77c22 modes
  177.     Mark Livingstone   markl@csource.oz.au        TVGA video modes
  178.     Patrick Ibbetson   ibbetsom@nes.nersc.gov     NEL Electronics BIOS, Cirrus
  179.                                                   chipsets
  180.     A. Peter Blicher   Oakland, CA                Genoa Super EGA
  181.     Tim Farley         tim@magee.mhs.compuserve.com    XGA
  182.     Bent Lynggaard     lynggaard@risoe.dk         misc video
  183.     Frank Klemm        pfk@rz.uni-jena.de         Diamond Speedstar 24X
  184.     Mikael Rydberg     Sweden                     Cirrus/UM587/etc video modes
  185.     Jens Vollmar       Erlangen, Germany          Trident/C&T video
  186.     Aki Korhonen       aki@holonet.net            Cirrus Logic BIOS
  187.     Alexi Lookin       alexi@riaph.irkutsk.su     Realtek RTVGA, Avance Logic,
  188.                                                   C&T video
  189.     Win Osterholt      2:512/56.198               Cirrus Logic BIOS 3.02
  190.   And many, many others...
  191.  
  192.  
  193. John Bridge's VGAKIT52.
  194.     (Simtel: vga/vgakit52.zip)
  195.  
  196. Fractint v18.1 source (primarily video.asm).
  197.     (Simtel: graphics/frasr181.zip)
  198.  
  199. Configuration files and drivers from amongst others:
  200.   CSHOW:        (Simtel:  graphics/cshw860a.zip)
  201.   VPIC:         (Simtel:  gif/vpic60.zip)
  202.   VUIMAGE:      (Simtel:  gif/vuimg340.zip)
  203.   SVGA:         (Simtel:  gif/svga112.zip)
  204.  
  205. XFree86 3.1.2 - X11 Unix SVGA driver. Available from:
  206.    ftp.x.org:             /contrib/XFree86
  207.    ftp.physics.su.oz.au:  /XFree86
  208.    ftp.win.tue.nl:        /pub/XFree86
  209.    ftp.prz.tu-berlin.de:  /pub/pc/src/XFree86
  210. The XFree86 team includes:
  211.    Robert Baron       Robert.Baron@ernst.mach.cs.cmu.edu
  212.    David Dawes        dawes@physics.su.oz.au
  213.    Dirk Hohndel       hohndel@informatik.uni-wuerzburg.de
  214.    Glenn Lai          glenn@cs.utexas.edu
  215.    Rich Murphey       Rich@Rice.edu
  216.    Jon Tombs          jon@gtex02.us.es
  217.    David Wexelblat    dwex@goblin.org, dwex@aib.com
  218.    Thomas Wolfram     wolf@prz.tu-berlin.de
  219.    Orest Zborowski    orestz@microsoft.com
  220. E-mail regarding XFree86 should be sent to xfree86@physics.su.oz.au
  221.  
  222. PCVISION plus Frame Grabber User's Manual.
  223.  
  224. Enhanced Graphics Adapter Reference Manual from HP.
  225.  
  226. Commodore Advanced Graphics Adapter (AGA) manual.
  227.  
  228. Data sheet for the Analog Devices ADV7160,ADV7162
  229.  
  230. Data sheets for the Chips and Technologies Inc
  231.    82c455A, 82c456, 82c457, 82c480, 65520/530, 82c425, 82c426, 82c9001A.
  232.  
  233. Technical Reference Manual for the Cirrus Logic CL-GD542x True Color VGA
  234.  Family, January 1994
  235.  
  236. Data sheet for the IC Designs ICD2061A
  237.  
  238. Data sheets for the MUSIC MU9c1880 and MU9c9750
  239.  
  240. Data sheets for the NCR 77c22E+ and 77c32BLT
  241.  
  242. Data sheets for the S3 86c911, 86c801/5, 86c928 and 86c964
  243.  
  244. Data sheet for the Tseng ET3000 and ET4000/W32
  245.  
  246. Data sheets for the Western Digital PVGA1A and WD90c24A
  247.  
  248. Data sheet for the Yamaha 6388 VPDC.
  249.  
  250. Programmer's Guide to the Mach32 Registers (ATI P/N: REG688000-15)
  251. VGA Wonder Programmer's Reference Manual (ATI P/N: PRG2888000-13)
  252. ATI Mouse Driver Programmer's Reference Manual (ATI P/N: PRG188200-12)
  253. Mach64 BIOS Kit (P/N: BIO-C012XX1-04), VGA Register Guide (P/N:
  254.  VGA-C012XX1-04), Register Reference Guide (P/N: RRG-C012XX1-04) and
  255.  Programmer's Guide (P/N: PRG-C012XX1-04)
  256.  
  257. Truevision Targa+ Hardware Technical Reference Manual.
  258.  
  259. Device Drivers Kit (DDK)'s for Microsoft Windows 3.1, Windows for Workgroups
  260.  3.11, Windows NT 3.51 and Windows 95 (pre-release).
  261.  
  262.  
  263. The following have donated reference material:
  264. H.R.R van Roosmalen and E. Zoer,
  265.    Delft University of Technology,
  266.    The Netherlands    huub@dutetvd.ET.TUDelft.NL  (no longer valid)
  267. Kendall Bennett       kjb@cgl.citri.edu.au
  268. Joel Finch            jfinch@ozemail.com.au
  269. Wieland Weiss         weiss@metw3.met.fu-berlin.de
  270.  
  271. The following have contributed information:
  272. Darren Senn           sinster@scintilla.capitola.ca.us
  273. Tomi H Engdahl        then@vipunen.hut.fi
  274. Jori Hamalainen       jhamala@kannel.lut.fi
  275. Eric ??               praetzel@marconi.uwaterloo.ca
  276. Frank Klemm           pfk@rz.uni-jena.de
  277. Michael Schindler     michael@eichow.tuwien.ac.at
  278. Kendall Bennett       kjb@cgl.citri.edu.au
  279. Danny Halamish        dny@cs.huji.ac.il
  280. Daniel Sill           sill@zoe.as.utexas.edu
  281. GARY                  GEM@rellim.com
  282. Paolo Severini        lendl@dist.dist.unige.it
  283. Royce Shih Wea Liao   liaor@umich.edu
  284.  
  285. Testers:
  286. Ross Ackland          rackland@csis.dit.csiro.au
  287. Chris Bailey          cbailey@crl.com
  288. Ross Becker           beckerr@pyrite.som.cwru.edu
  289. Darren Brown          de2brown@undergrad.math.uwaterloo.ca
  290. Carlos Henrique Cantu cahcantu@pintado.ciagri.usp.br
  291. Murray Chapman        muzzle@cs.uq.oz.au
  292. Frank Dikker          dikker@cs.utwente.nl
  293. Michael Eichow        michael@eichow.tuwien.ac.at
  294. Torben H. Hansen      100024,3066@compuserve.com
  295. Heikki Julkunen       dp93hju@txfs1.hfb.se
  296. Nanda G. Kutty        eapu290@orion.oac.uci.edu
  297. Leonardo Loureiro     loureiro@fiu.edu
  298. Steven Martin         Steven.Martin@eng.monash.edu.au
  299. Jouni Miettunen       jon@stekt.oulu.fi
  300. Jack Nomssi           Nomssi@physik.tu-chemnitz.de
  301. Juho-Pekka Rosti      atjuro@uta.fi
  302. Lode Vande Sande      stud11@cc4.kuleuven.ac.ec
  303. Joel Finch            jfinch@ozemail.com.au
  304.  
  305.  
  306.  
  307. Disclaimer:
  308.  
  309. All information herein is presented as is and without warranty.
  310. Use at your own risk.
  311.  
  312.  
  313.  
  314.  
  315. IBM PC, PC/XT, PC/AT, PCjr, PS/2, Micro Channel, Personal System/2,Enhanced
  316. Graphics Adapter, Color Graphics Adapter, Video Graphics Adapter, IBM Color
  317. Display, IBM Monochrome Display, 8514/A and XGA are trademarks of
  318. International Business Machines Corporation.
  319. MS-DOS, Microsoft and Windows are trademarks of Microsoft, Incorporated.
  320. Hercules is a trademark of Hercules Computer Technology, Inc.
  321. Multisync is a trademark of Nippon Electric Company (NEC).
  322. ATI, VGAWonder, Mach8, Mach32, 8514 ULTRA, GRAPHICS ULTRA, GRAPHICS VANTAGE,
  323. GRAPHICS ULTRA+ and GRAPHICS ULTRA PRO are trademarks of ATI Technologies Inc.
  324. Brooktree and RAMDAC are trademarks of Brooktree Corporation.
  325. SMARTMAP is a trademark of Chips and Technologies, Incorporated.
  326. TARGA is a registered trademark of Truevision, Inc.
  327. Cirrus Logic and SimulSCAN are trademarks of Cirrus Logic, Inc.
  328. HiColor is a trademark of Sierra Semiconducter, Inc.
  329. i386, i486 and Intel are trademarks of Intel Corp.
  330. Inmos and SGS-Thompson are trademarks of SGS-Thompson, Ltd.
  331. IIT is a trademark of Integrated Information Technology, Inc.
  332. Motorola is a trademark of Motorola Corp.
  333. TIGA is a trademark of Texas Instruments.
  334. VBE, VESA and VSE are trademarks of the Video Electronics Standards
  335. Association.
  336. Western Digital, AutoSwitch and TrueShade are trademarks of Western Digital
  337. Corporation.
  338. WEITEK and WEITEK Power are trademarks of WEITEK Corporation
  339. All other product names are copyright and registered trademarks/tradenames of
  340. their respective owners.
  341.