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