home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / S3.TXT < prev    next >
Text File  |  1996-01-04  |  75KB  |  1,426 lines

  1. The entire S3 family are basically 8514/As with a VGA front-end.
  2. Hardwired Bit-Blt, fill and line drawfunctions.
  3.  
  4.  
  5.   S3  86c911     184pin 1Mbyte, 1280x1024x16c, 1024x768x256c, 640x480x32kc
  6.   S3  86c911A    184pin Same as 924??. Corrects a bug in 1280 modes.
  7.   S3  86c924     184pin Support for 24-bit modes.
  8.   S3  86c801     160pin as '928, but limited to 2MB DRAM & no 32bit
  9.                    acceleration- '801 is the ISA version
  10.   S3  86c805     184pin same as '801 but for Local Bus
  11.   S3  86c805i      as 805, but can interleave two banks of DRAM
  12.   S3  86c805p      PCI version of the '805
  13.   S3  86c928     208pin 24bit color, 4MB D/VRAM Accelerated 4/8/16/32bit
  14.   S3  86c928p      PCI version of the '928
  15.   S3  Vision964  208pin. VRAM 64bit chip. Max 8MB (1600x1200 32bit)
  16.   S3  Vision864  208pin. As 964, but with max 4MB DRAM.
  17.   S3  86c732       "Trio32" Integrated '864, DAC and clock chip. 32bit memory
  18.                     path
  19.   S3  86c764     208pin. "Trio64" Integrated '864, DAC and clock chip
  20.   S3  86c866
  21.   S3  86c868     as '864, but with video support
  22.   S3  86c968     as '964, but with video support
  23.  
  24.  
  25.   The S3 chip only works in AT and better units as it uses full
  26.   16 bit I/O addresses.
  27.  
  28.   The S3 has an 8514/A style bitblt engine which uses a number of I/O
  29.   addresses with the lowest 10 bits = 2E8h (4AE8h, 82E8h, BEE8h...).
  30.  
  31.   Please note that this may conflict with Com4 ports at 2E8h-2EFh !!!
  32.  
  33.  
  34. 102h (R/W):  Setup Option Select Register (SETUP_MD)
  35. bit    0  SLP MODE. When clear the chip ignores I/O and memory accesses. The
  36.           video system will continue running as before the bit was cleared.
  37. Note: This register can only be accessed when in setup mode, which is
  38.  controlled either by 3C3h bit 0 or 46E8h bit 4. When in setup mode all other
  39.  VGA and extended registers are disabled.
  40.  
  41. 3B8h (R/W):  MDA-Mode Control Register (MDA_MODE)
  42. bit    3  DSP ENB. Enable Display. 1: Blanked, 1: Video enabled
  43.        5  TXT BLK. Text Blinking enabled if set
  44.  
  45. 3B8h (R/W):  HGC-Mode Control Register (HGC_MODE)
  46. bit    1  GRPH MODE. Enable Graphics Mode. 0: Text, 1: 720x348 Graphics
  47.        3  DSP ENB. Enable Display. 0: Blank, 1: Video enabled
  48.        5  TXT BLK. Text Blinking enabled if set
  49.        7  HGC PAGE. Select Hercules Graphics Video Page 1. 0: Display from
  50.           B000h (page 0), 1: Display from B800h (page 1)
  51.  
  52. 3B9h (W):  HGC-Set Light Pen Flag Register (HGCV_SLPEN)
  53. Any write to this register will set the Light Pen Latch
  54.  
  55. 3BAh (R):  MDA Status Register (MDA_STS)
  56. bit    0  HSY. Horizontal Sync Active. Border or Blanking active if set
  57.        3  TEST. B/W Video enabled if set
  58.  
  59. 3BAh (R):  HGC Status Register (HGC_STS)
  60. bit    0  HSY. Horizontal Sync Active. Border or Blanking active if set
  61.        1  LPF. Light Pen Flag on if set
  62.        3  V-DT. Black/White Video enabled if set
  63.        7  /VSY. Vertical Sync Inactive. Vertical Sync active if set
  64.  
  65. 3BBh (W):  Reset Light Pen Flag Register
  66. Any write to this register will clear the Light Pen Latch
  67.  
  68. 3BFh (W):  HGC Configuration Register
  69. bit    0  ENB GRPH. Enable Graphics. 0: Force Text mode, 1: Allow Graphics
  70.           mode
  71.        1  ENB PAGE. Enable Page. 0: 3B8h bit 7 can't be set (always use page
  72.           0), 1: 3B8h bit can be set enabling both pages
  73.  
  74. 3C4h index 08h (R/W):  "PLL Unlock"                                 (732/764)
  75. bit  0-?  Write 6 to unlock the PLL registers (3C4h index 10h-13h,15h..),
  76.           write 0 to lock.
  77.  
  78. 3C4h index 09h (R/W):                                               (732/764)
  79. 3C4h index 0Ah (R/W):                                               (732/764)
  80. 3C4h index 0Bh (R/W):                                               (732/764)
  81. 3C4h index 0Dh (R/W):                                               (732/764)
  82.  
  83. 3C4h index 10h W(R/W):  "Memory PLL Data"                           (732/764)
  84. bit  0-4  N1. Frequency divider. Stored as 1-31, actual value 3-33
  85.      5-7  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  86.     8-14  M.  Quotient. Stored as 1-127, actual value 3-129
  87. Note: Frequency is (M/N1)/(1 << N2) *base frequency.M and N1 are the actual
  88.       values, not the stored ones. Typically the base frequency is 14.318 MHz.
  89.  
  90. 3C4h index 12h W(R/W):  "Video PLL Data"                            (732/764)
  91. bit  0-4  N1. Frequency divider. Stored as 1-31, actual value 3-33
  92.      5-7  N2. Divides the frequency. 0: /1, 1: /2, 2: /4, 3: /8
  93.     8-14  M.  Quotient. Stored as 1-127, actual value 3-129
  94. Note: Frequency is (M/N1)/(1 << N2) *base frequency.M and N1 are the actual
  95.       values, not the stored ones. Typically the base frequency is 14.318 MHz.
  96.  
  97. 3C4h index 15h (R/W):                                               (732/764)
  98. bit    4  Set in 1x 16bit -> 2x 8bit pixel mode
  99.        5  After updating a clock register set write this bit 3 time.
  100.           First 0, then 1 and finally 0.
  101.  
  102. 3C4h index 18h (R/W):                                               (732/764)
  103. bit    7  Set in 1x 16bit -> 2x 8bit pixel mode
  104.  
  105. 3d4h index 2Dh (R):
  106. bit  0-7  Extended Chip ID. Always 88h ?
  107.  
  108. 3d4h index 2Eh (R):  "New chip ID"                               (7xx,866,x68)
  109. bit  0-7  Extended Chip ID (if index 30h is E0h/E1h)
  110.              10h  86c732 (Trio32)
  111.              11h  86c764 (Trio64)
  112.              80h  86c866
  113.              90h  86c868
  114.              B0h  86c968
  115.  
  116. 3d4h index 2Fh (R):  Revision                                    (7xx,866,x68)
  117. bit  0-7  Revision code
  118.      4-7  (86c764) 8 for the 86c765 (Trio64 V+) ??
  119.  
  120. 3d4h index 30h (R):  CR30 Chip ID/REV register
  121. bit  0-7  Chip ID:
  122.              81h  86c911
  123.              82h  86c911A/924
  124.              90h  86c928 original
  125.              91h  86c928 C-step
  126.              94h  86c928 D-step
  127.              95h  86c928 E-step
  128.              A0h  86c801/805 A or B-step
  129.              A2h  86c801/805 C-step
  130.              A5h  86c801/805 D-step
  131.              A6h  86c801/805 P-step
  132.              A8h  86c801/805 I-step
  133.              B0h  86c928PCI
  134.              C0h  Vision 86c864
  135.              C1h  Vision 86c864P
  136.              D0h  Vision 86c964
  137.              D1h  Vision 86c964P
  138.          E0h,E1h  Trio32/64, 86c866,86c868,86c968, See index 2Eh
  139.  
  140. 3d4h index 31h (R/W):  CR31 Memory Configuration Register
  141. bit    0  Enable Base Address Offset (CPUA BASE). Enables bank operation if
  142.           set, disables if clear.
  143.        1  Two Page Screen Image. If set enables 2048 pixel wide screen setup
  144.        2  VGA 16bit Memory Bus Width. Set for 16bit, clear for 8bit
  145.        3  Use Enhanced Mode Memory Mapping (ENH MAP). Set to enable access to
  146.            video memory above 256k.
  147.      4-5  Bit 16-17 of the Display Start Address. For the 801/5,928 see index
  148.            51h, for the 864/964 see index 69h.
  149.        6  High Speed Text Display Font Fetch Mode. If set enables Page Mode
  150.           for Alpha Mode Font Access.
  151.        7  (not 864/964) Extended BIOS ROM Space Mapped out. If clear the area
  152.            C6800h-C7FFFh is mapped out, if set it is accessible.
  153.  
  154. 3d4h index 32h (R/W):  CR32 Backwards Compatibility 1
  155. bit  0-1  Character Clock Period (CK-CLK).
  156.             0: As IBM (8 or 9 dots), 1: 7 dots, 2: 9 dots
  157.        2  Force High Character Clock. Forces full character clock for
  158.           horizontal timing (for CGA and HGC emulation), rather than 1/2 dot
  159.           clock rate
  160.        3  Backward Modes. Clear for VGA, set for MDA, CGA, EGA, HGC
  161.        6  Fix VGA Screen Page with IBM VGA Memory Mapping using Display Start
  162.           Address bit 16-17 (3d4h index 31h bit 4-5)
  163.        7  (928,964) Serial Out Tri-State. If set the SC, SOE0 and SXNR pins
  164.            are tri-stated
  165.  
  166. 3d4h index 33h (R/W):  CR33 Backwards Compatibility 2
  167. bit    1  Disable VDE Protection. Disables the function of 3d4h index 11h bit
  168.           7 on 3d4h index 7 bit 1,6.
  169.        3  VCLK = -DCLK. If set VCLK is inverted DCLK, if clear it is inverted
  170.           DCLK or DCLK/2
  171.        4  Lock Video DAC Writes. If set disables writes to the RamDAC.
  172.        5  Blank/Border Select. If set the blank signal will be the same as
  173.           the active display enable timing, if clear blank comes earlier than
  174.           the display enable by including the border area.
  175.        6  Lock Palette/Overscan Registers if set.
  176.        7  Overrides the CGA "enable video" in 3D8h bit 3 if set.
  177.  
  178. 3d4h index 34h (R/W):  CR34 Backward Compatibility 3
  179. bit  0-3  BIOS use.
  180.        0  Set if address is multiplied with 4 (16color modes ?)
  181.        4  (9xx) Enable Data Transfer Position Control (ENB DTPC). If set the
  182.           Data Transfer position (When a new row should be loaded into the
  183.           shift register of the VRAM) is controlled by 3d4h index 3Bh, if
  184.           clear by 3d4h index 0.
  185.        5  Lock 8/9 Dots (LOCK 8/9D). Lock the character clock period (3C4h
  186.           index 1 bit 5) if set. When emulating EGA the horizontal timing
  187.           registers are programmed for 8 dot character clock.
  188.        7  Lock Clock Select (LOCK CKSL). If set the bits 2-3 of the
  189.           Miscellaneous Output register (3C2h) are locked.
  190.  
  191. 3d4h index 35h (R/W):  CR35 CRT Register Lock
  192. bit  0-3  CPU Base Address. 64k bank number. For the 801/5 and 928 see 3d4h
  193.           index 51h bits 2-3. For the 864/964 see index 6Ah.
  194.        4  Lock Vertical Timing Registers (LOCK VTMG). Locks 3d4h index 6, 7
  195.           (bits 0,2,3,5,7), 9 bit 5, 10h, 11h bits 0-3, 15h, 16h if set
  196.        5  Lock Horizontal Timing Registers (LOCK HTMG). Locks 3d4h index
  197.           0,1,2,3,4,5,17h bit 2 if set
  198.        6  (911/924) Lock VSync Polarity.
  199.        7  (911/924) Lock HSync Polarity.
  200.  
  201. 3d4h index 36h (R/W):  CR36 Reset State Read 1
  202. bit  0-1  (R) System Bus Select. 0: EISA (805 only), 1: Originally "386/486
  203.            local bus" later "VESA local bus", 2: MCA (911/24), PCI bus (805P
  204.            /928P +) or 8bit (801/5,928 undoc), 3: ISA (not 805)
  205.        2  (911-928) VGA ROM Width. Set if 8bit, clear if 16bit
  206.      2-3  (864/964) Memory Page Mode Select. 2: Extended Data Out (EDO) Mode,
  207.            3: Fast Page Mode
  208.        3  (911/24) VRAM. Set if using VRAM (should always be set)
  209.           (801/5,928) VGA BIOS ROM Enable. If set BIOS is C0000h-C7FFFh, if
  210.            clear C0000h-C5FFFh plus C6800h-C7FFFh
  211.        4  (911/24) Set if display memory is dedicated (Should always be set)
  212.           (801/5,928 ISA Bus) Address Bit Range for MEMCS16. LA[17-23] if set,
  213.             also SA16 if clear
  214.           (805,928 Local Bus) SAUP2/ROMCS Select. If clear SAUP2 pin is ROMCS,
  215.             if set it is unchanged.
  216.           (864,964) Enable Video BIOS Access (VL-Bus) if set.
  217.        5  (911/24) Video memory. 0: 1Mb, 1: 512Kb
  218.      5-7  (not 911/924) Display Memory Size. 0: 4MB, 2: 3MB, 3: 8MB, 4: 2MB,
  219.             5: 6MB, 6: 1MB, 7: 512Kb
  220.        7  (911/24) Display Memory WPB is available if set (should always be
  221.             set)
  222. Note: These bits are latched from pins PD[0-7] on reset
  223.  
  224. 3d4h index 37h (R/W):  CR37 Reset State Read 2
  225. bit    0  (ISA Bus) Setup SEL for ISA bus. If set SEL is 46E8h bit 4, bit 5 if
  226.            clear
  227.           (Local Bus) VGA Enable. Enables VGA chip if set
  228.        1  (911/24) VRAM Display Memory Speed. Set for Fast Page Mode (80ns
  229.            VRAM), clear for Page Mode (100ns VRAM).
  230.           (801/5,928) Reserved(1)
  231.           (964) Test Mode enabled if clear. All outputs are tri-stated
  232.        2  (911/24) 386/486 System Setup is ISA style if set, MCA style if
  233.            clear
  234.           (801/5,928) Extended Monitor Identification. Extends bit 5-7
  235.           (964 CVL-Bus) Video BIOS ROM Size. Set for 32K, clear for 64K
  236.        3  (Local Bus) LOCA Signal Select. Tri-state signal if set, Level
  237.            signal if clear
  238.           (ISA Bus) No Wait State. NOWS disabled if clear
  239.           (964) Dual CAS Select. Set for Dual WE, clear for Dual CAS
  240.        4  (ISA bus) Normal MEMCS16 generation if set, external if clear
  241.           (Local Bus) Disable LOCA and SRDY for video DAC accesses if clear
  242.      5-7  Additional Monitor Identification.
  243.             0:  640x480 at 60Hz Non-interlaced (Std VGA)
  244.             1:  640x480 at 70Hz Non-interlaced
  245.             2:  800x600 at 60Hz Non-interlaced
  246.             3:  800x600 at 72Hz Non-interlaced
  247.             4:  800x600 at 56Hz Non-interlaced
  248.             5: 1024x768 at 43Hz Interlaced
  249.             6: 1024x768 at 60Hz Non-interlaced
  250.             7: 1024x768 at 70Hz Non-interlaced
  251.                1280x960 at 46Hz Interlaced
  252. Note: These bits are latched from pins PD[8-15] on reset
  253.  
  254. 3d4h index 38h (R/W):  CR38 Register Lock 1
  255. bit  2-3  Write 2 to unlock. Bit 6-7 must also be set
  256.      6-7  Write 1 to unlock. Bit 3-4 must also be set
  257. Note: Traditionally 48h is used to unlock and 00h to lock
  258.  
  259. 3d4h index 39h (R/W):  CR39 Register Lock 2
  260. bit  0-2  (911/24) Write 5 to unlock the Test Register ?
  261.      5-7  Write 5 to unlock the System Control Registers (3d4h index >=40h)
  262. Note: Traditionally A5h is used to unlock and 5Ah to lock
  263.  
  264. 3d4h index 3Ah (R/W):  CR3A Miscellaneous 1
  265. bit  0-1  Alternate Refresh Count Control. If bit 2 is set this is the number
  266.           of refresh cycles per scanline, rather than 3d4h index 11h bit 6.
  267.        2  Enable Alternate Refresh Count Control (bits 0-1) if set
  268.        3  Top Memory Access (TOP MEM). Forces PCU and CRTC accesses into the
  269.           upper 32k or 64K if set
  270.        4  256 Color Enhanced Mode. Configure Shift registers in the Attribute
  271.           Controller for 8, 16 or 24 bit data if set, 4bit if clear
  272.        5  Enables High Speed Text CPU font writing if set.
  273.        7  (911-928) Enable MEMCS16 Bus Signal. If set MEMCS16 is 16bits, else
  274.             8 bits.
  275.           (964) PCIRB DISA. PCI Read Bursts Disabled if set. 3d4h index 66h
  276.             bit 7 should be set before this bit is set
  277.  
  278. 3d4h index 3Bh (R/W):  CR3B Data Transfer Execute Position Register      (9xx)
  279. bit  0-7  The Horizontal character position of the data transfer execution in
  280.           memory clocks. Usually in the middle of 3d4h index 0 and 3d4h index
  281.           4
  282.  
  283. 3d4h index 3Ch (R/W):  CR3C Interlaced Mode Start/End Register
  284. bit  0-7  Interlace mode frame offset (Typically half the horizontal total).
  285.  
  286. 3d4h index 40h (R/W):  CR40 System Configuration
  287. bit    0  Enable Enhanced Register Access. Enables 8514/a registers
  288.           (x2E8h,x6E8h,xAE8h,xEE8h) if set
  289.        1  (911/24) CPC I/O Select. If set CPC selected VDCRD/WR are I/O
  290.            decoded R/W signals, if clear RAMDAC is selected
  291.           (801/5) Signal Select. If set the MID0 signal is STRD
  292.           (928) Signal Select. If set the MID0 signal becomes STRD if 3d4h
  293.             index 55h bit 2 is set, MID0 becomes BGNT  and MID1 becomes BREQ
  294.             if 3d4h index 55h bit 2 is clear.
  295.        2  (911-928) Write Wait Control (Local Bus only). 1 wait state if set,
  296.            none if clear
  297.        3  (911-928) Enable Fast Write Buffer (FIFO) if set (ISA bus only for
  298.             911/24, all busses for 801/5,928).
  299.        4  (864,964) RDY CTL. Ready Control (VL-bus only). If set there is
  300.            minimum 1 wait state between the assertion of /SADS and /ARDY (for
  301.            command writes), if clear the minimum is 0.
  302.        5  (864,964) WDL DLAY. Write Latching Delay (VL-bus only). If set write
  303.            data is latched on the first rising edge of SCLK after assertion of
  304.            /SRDY, if clear after /RDYIN
  305.      4-5  (911-928) Decode Wait Control (Local Bus only). Number of wait
  306.             states. 0: 0ws, 1: 1ws, 2: 3ws, 3: 2ws
  307.      6-7  (911-928) Read Wait Control.
  308.            Local Bus: Number of wait states  0: 0ws, 1: 1ws, 2: 3ws, 3: 2ws
  309.            ISA Bus (801/5,928): 0 enables the NOWS signal, 1-3 disables
  310.           (864,964) BUS TNO. Bus Turnaround Non-Overlap (VL-bus only).
  311.            Controls the interval between deassertion of /ABEN and the
  312.            assertion of /DBEN (or vice versa).
  313.              0: 1unit, 1: 2units, 2: 3units, 3: 4units
  314.  
  315. 3d4h index 41h (R/W): CR41 BIOS Flag Register
  316. bit  0-4  (Diamond 864/964) Clock index for current mode.
  317.        4  (911/924) Set if we have 1MByte, clear if we have 512KBytes.
  318.        6  Dual Display VGA test size. Set for 32K, clear for 64K
  319.           Note: this might be reversed for 80x/928 ????
  320.        7  Set to enable dual display
  321. Note: Undocumented on the 911
  322.  
  323. 3d4h index 42h (R/W):  CR42 Mode Control
  324. bit  0-3  DCLK Select. These bits are effective when the VGA Clock Select
  325.           (3C2h/3CCh bit 2-3) is 3.
  326.        5  Interlaced Mode if set.
  327.  
  328. 3d4h index 43h (R/W):  CR43 Extended Mode
  329. bit    0  Video Clock Edge Mode Select. If clear video data is output on the
  330.           rising edge of DCLK only, if set on both rising and falling edge.
  331.        1  DAC Register Select bit 2. This bit is output to the palette chip
  332.           RS2 pin, which on advanced DACs works as a 3rd address bit to the
  333.           DAC registers at 3C6h-3C9h.
  334.           (801/5,928) Only active if 3d4h index 55h bits 0-1 is 0
  335.        2  Logical Screen Width bit 8. Bit 8 of the Display Offset Register/
  336.           (3d4h index 13h). (801/5,928) Only active if 3d4h index 51h bits 4-5
  337.           are 0
  338.        3  (911-928) Enable 64K Color Mode. Enables 16bit modes if set
  339.        4  (911-928) Translate Enable. If set the '8514' registers use
  340.           alternate addresses (x148h, x548h, x948h and xD48h), if clear
  341.           standard addresses (x2E8h, x6E8h, xAE8h and xEE8h).
  342.        5  (911/24) Clock Stop Control. If set stops DCK0 (Attribute Control 0)
  343.        6  (911/24) Clock Stop Control. If set stops DCK1 (Attribute Control 1)
  344.        7  (911/24) Clock Stop Control. If set stops GCLK (GE and DM Clock)
  345.           (80x +) Horizontal Counter Double Mode. If set character clocks
  346.             are 16 pixels wide rather than 8.
  347.  
  348. 3d4h index 45h (R/W):  CR45 Hardware Graphics Cursor Mode
  349. bit    0  HWGC ENB. Hardware Graphics Cursor Enable. Set to enable the
  350.           HardWare Cursor in VGA and enhanced modes.
  351.        1  (911/24) Delay Timing for Pattern Data Fetch
  352.        2  (801/5,928) Hardware Cursor Horizontal Stretch 2. If set the cursor
  353.            pixels are stretched horizontally to two bytes and items 0 and 1 of
  354.            the fore/background stacks in 3d4h index 4Ah/4Bh are used.
  355.        3  (801/5,928) Hardware Cursor Horizontal Stretch 3. If set the cursor
  356.            pixels are stretched horizontally to three bytes and items 0,1 and
  357.            2 of the fore/background stacks in 3d4h index 4Ah/4Bh are used.
  358.      2-3  (805i,864/964) HWC-CSEL. Hardware Cursor Color Select.
  359.             0: 4/8bit, 1: 15/16bt, 2: 24bit, 3: 32bit
  360.           Note: So far I've had better luck with: 0: 8/15/16bit, 1: 32bit??
  361.        4  (80x +) Hardware Cursor Right Storage. If set the cursor data is
  362.            stored in the last 256 bytes of 4 1Kyte lines (4bits/pixel) or the
  363.            last 512 bytes of 2 2Kbyte lines (8bits/pixel). Intended for
  364.            1280x1024 modes where there are no free lines at the bottom.
  365.        5  (928) Cursor Control Enable for Brooktree Bt485 DAC. If set and 3d4h
  366.            index 55h bit 5 is set the HC1 output becomes the ODF and the HC0
  367.            output becomes the CDE
  368.           (964) BT485 ODF Selection for Bt485A RAMDAC. If set pin 185 (RS3
  369.            /ODF) is the ODF output to a Bt485A compatible RamDAC (low for even
  370.            fields and high for odd fields), if clear pin185 is the RS3 output.
  371.  
  372.  
  373. 3d4h index 46h M(R/W):  CR46/7 Hardware Graphics Cursor Origin-X
  374. bit 0-10  The HardWare Cursor X position. For 64k modes this value should be
  375.           twice the actual X co-ordinate.
  376.  
  377. 3d4h index 48h M(R/W):  CR48/9 Hardware Graphics Cursor Origin-Y
  378. bit  0-9  (911/24) The HardWare Cursor Y position.
  379.     0-10  (80x +) The HardWare Cursor Y position.
  380. Note: The position is activated when the high byte of the Y coordinate (index
  381.       48h) is written, so this byte should be written last (not 911/924 ?)
  382.  
  383. 3d4h index 4Ah (R/W):  Hardware Graphics Cursor Foreground Stack       (80x +)
  384. bit  0-7  The Foreground Cursor color. Three bytes (4 for the 864/964) are
  385.           stacked here. When the Cursor Mode register (3d4h index 45h) is read
  386.           the stackpointer is reset. When a byte is written the byte is
  387.           written into the current top of stack and the stackpointer is
  388.           increased. The first byte written (item 0) is allways used, the
  389.           other two(3) only when Hardware Cursor Horizontal Stretch (3d4h
  390.           index 45h bit 2-3) is enabled.
  391.  
  392. 3d4h index 4Bh (R/W):  Hardware Graphics Cursor Background Stack       (80x +)
  393. bit  0-7  The Background Cursor color. Three bytes (4 for the 864/964) are
  394.           stacked here. When the Cursor Mode register (3d4h index 45h) is read
  395.           the stackpointer is reset. When a byte is written the byte is
  396.           written into the current top of stack and the stackpointer is
  397.           increased. The first byte written (item 0) is allways used, the
  398.           other two(3) only when Hardware Cursor Horizontal Stretch (3d4h
  399.           index 45h bit 2-3) is enabled.
  400.  
  401. 3d4h index 4Ch M(R/W):  CR4C/D Hardware Graphics Cursor Storage Start Address
  402. bit  0-9  (911,924) HCS_STADR. Hardware Graphics Cursor Storage Start Address
  403.     0-11  (80x,928) HWGC_STA. Hardware Graphics Cursor Storage Start Address
  404.     0-12  (864,964) HWGC_STA. Hardware Graphics Cursor Storage Start Address
  405.           Address of the HardWare Cursor Map in units of 1024 bytes (256 bytes
  406.           for planar modes). The cursor map is a 64x64 bitmap with 2 bits (A
  407.           and B) per pixel. The map is stored as one word (16 bits) of bit A,
  408.           followed by one word with the corresponding 16 B bits.
  409.           The bits are interpreted as:
  410.              A    B    MS-Windows:         X-11:
  411.              0    0    Background          Screen data
  412.              0    1    Foreground          Screen data
  413.              1    0    Screen data         Background
  414.              1    1    Inverted screen     Foreground
  415.           The Windows/X11 switch is only available for the 80x +.
  416.           (911/24) For 64k color modes the cursor is stored as one byte (8
  417.             bits) of A bits, followed by the 8 B-bits, and each bit in the
  418.             cursor should be doubled to provide a consistent cursor image.
  419.           (801/5,928) For Hi/True color modes use the Horizontal Stretch bits
  420.             (3d4h index 45h bits 2 and 3).
  421.  
  422. 3d4h index 4Eh (R/W):  CR4E HGC Pattern Disp Start X-Pixel Position
  423. bit  0-5  Pattern Display Start X-Pixel Position.
  424.  
  425. 3d4h index 4Fh (R/W):  CR4F HGC Pattern Disp Start Y-Pixel Position
  426. bit  0-5  Pattern Display Start Y-Pixel Position.
  427.  
  428. 3d4h index 50h (R/W):  Extended System Control 1 Register              (80x +)
  429. bit    2  (928,964) Enable BREQ Function. If set the BREQ and BGNT functions
  430.            are enabled.
  431.        3  (not 864/964) Disable LOCA/SRDY. If set disables the LOCA/SRDY
  432.            signals on the Local Bus for writing to the DAC.
  433.      4-5  Pixel Length Select. Selects the pixel length for Enhanced Mode.
  434.            0: 4 or 8 bits/pixel (1 byte), 1: 16 bits/pixel (2 bytes)
  435.            3: 32bits/pixel (4bytes) - 928 and later
  436.      6-7  (80x A&B, 928 rev A-D) Graphics Engine Command Screen Pixel Width.
  437.            0: 1024 or 2048, 1: 640, 2: 800, 3: 1280
  438.    0,6-7  (80x C+,928 E+, 864/964) Graphics Engine Command Screen Pixel Width.
  439.            0: 1024 (or 2048 if 3d4h index 31h bit 1 set) , 1: 1152, 2: 640,
  440.             4: 800 (or 1600 if 4AE8h bit 2 set), 5: 1600, 6: 1280
  441.  
  442. 3d4h index 51h (R/W):  Extended System Control 2 Register              (80x +)
  443. bit    0  (80x) Display Start Address bit 18
  444.      0-1  (928 +) Display Start Address bit 18-19.
  445.           Bits 16-17 are in index 31h bits 4-5, Bits 0-15 are in 3d4h index
  446.           0Ch,0Dh. For the 864/964 see 3d4h index 69h
  447.        2  (80x) CPU BASE. CPU Base Address Bit 18.
  448.      2-3  (928 +) Old CPU Base Address Bits 19-18.
  449.            64K Bank register bits 4-5. Bits 0-3 are in 3d4h index 35h.
  450.            For the 864/964 see 3d4h index 6Ah
  451.      4-5  Logical Screen Width Bit [8-9]. Bits 8-9 of the CRTC Offset register
  452.           (3d4h index 13h). If this field is 0, 3d4h index 43h bit 2 is active
  453.        6  (928,964) DIS SPXF. Disable Split Transfers if set. Spilt Transfers
  454.            allows transferring one half of the VRAM shift register data while
  455.            the other half is being output. For the 964 Split Transfers
  456.            must be enabled in enhanced modes (4AE8h bit 0 set). Guess: They
  457.            probably can't time the VRAM load cycle closely enough while the
  458.            graphics engine is running.
  459.        7  (not 864/964) Enable EPROM Write. If set enables flash memory write
  460.            control to the BIOS ROM address
  461. Note: both index 38h and 39h must be enabled to access this register.
  462.  
  463. 3d4h index 52h (R/W):  Extended BIOS Flag 1 Register                   (80x +)
  464. bit  0-7  Scratch Pad
  465.      0-3  (Diamond) Table entry ?
  466.        4  (Diamond) VCLK doubler
  467.        5  (Diamond) Interlace/NI
  468.      6-7  (Diamond) Vsync/Hsync
  469.  
  470. 3d4h index 53h (R/W):  Extended Memory Control 1 Register              (80x +)
  471. bit  0-1  (80x) Enable Write Per Bit MB1,MB0.
  472.      0-3  (928) Enable Write Per Bit MB3,MB2,MB1,MB0
  473.            Enables Write Per Bit Flags for each 1MB memory bank.
  474.        0  (864/964) ENB WPB. Enable Write Per Bit. Enables Write Per Bit for
  475.            all memory banks if set
  476.      3-4  (868/968) Set to 3 to enable "New Memory Mapped I/O"
  477.        4  (801/5) Enable MMIO Access. If set to enables the 32K MMIO (Memory
  478.             Mapped I/O registers) at A0000h-A7FFFh.
  479.           (928 +) Enable MMIO Access. If set the 32K MMIO area at A0000h
  480.             -A7FFFh is used for image transfers via E2E8h and E2EAh, and the
  481.             second 32K MMIO area at A8000h-AFFFFh is used for the command
  482.             registers (82E8h-BEE8h)
  483.        5  (928,964) PAR VRAM. Parallel VRAM Addressing. Parallel if set,
  484.            serial if clear. (964) Only needs to be set when a 64bit pixel bus
  485.            is used (3d4h index 66h bits 4-5 = 2).
  486.           (801/5i) DRAM interleaving if set
  487.        6  SWP NBL. Swap Nibbles. If set swaps the nibbles (4bits) in each byte
  488.           read or written to/from video memory.
  489.        7  (not 864/964) Enable Nibble Write Control if set
  490.  
  491. 3d4h index 54h (R/W):  Extended Memory Control 2 Register              (80x +)
  492. bit  0-2  (not 964) Read Ahead Cache (RAC) Extra Prefetch Control. The number
  493.            of doublewords to prefetch (words/bytes in VGA word/byte mode).
  494.           Only 1,3 and 7 are meaningful.
  495.      3-7  (80x,964) M Parameter.
  496.  
  497. 3d4h index 55h (R/W):  Extended Video DAC Control Register             (80x +)
  498. bit 0-1  DAC Register Select Bits. Passed to the RS2 and RS3 pins on the
  499.          RAMDAC, allowing access to all 8 or 16 registers on advanced RAMDACs.
  500.          If this field is 0, 3d4h index 43h bit 1 is active.
  501.       2  Enable General Input Port Read. If set DAC reads are disabled and the
  502.          STRD strobe for reading the General Input Port is enabled for reading
  503.          while DACRD is active, if clear DAC reads are enabled.
  504.       3  (928) Enable External SID Operation if set. If set video data is
  505.            passed directly from the VRAMs to the DAC rather than through the
  506.            VGA chip
  507.       4  Hardware Cursor MS/X11 Mode. If set the Hardware Cursor is in X11
  508.          mode, if clear in MS-Windows mode
  509.       5  (80x,928) Hardware Cursor External Operation Mode. If set the two
  510.           bits of cursor data ,is output on the HC[0-1] pins for the video DAC
  511.           The SENS pin becomes HC1 and the MID2 pin becomes HC0.
  512.       6  ??
  513.       7  (80x,928) Disable PA Output. If set PA[0-7] and VCLK are tristated.
  514.          (864/964) TOFF VCLK. Tri-State Off VCLK Output. VCLK output tri
  515.           -stated if set
  516.  
  517. 3d4h index 56h (R/W):  External Sync Control 1 Register                (80x +)
  518. bit   0  RMT ON. Remote Mode Operation. If set the VSync pin is the input for
  519.          Gen-Lock
  520.       1  (not 864/964) NTSC Mode. If set enables the special NTSC Horizontal
  521.          counter mode, where two dot clocks are skipped in each scanline,
  522.          relative to the value programmed in the Horizontal Total register
  523.          (3d4h index 0). Typical Horizontal Total value is 114 clocks. Index
  524.           00h = 109.
  525.       2  (not 864/964) PAL Mode.  If set enables the special PAL Horizontal
  526.          counter mode, where one dot clock is skipped in each scanline,
  527.          relative to the value programmed in the Horizontal Total register
  528.          (3d4h index 0). Typical Horizontal Total value is 142 clocks. Index
  529.           00h = 137.
  530.       3  External Sync Mode Select. If Remote Mode is selected (bit 0 is set)
  531.          the falling edge of the VSync input signal resets the Vertical
  532.          counter if this bit is set, or both the Horizontal and Vertical
  533.          counters if this bit is clear.
  534.       4  Preset Frame Select. If bit 0 and 3 are both set, the starting frame
  535.          after the Vertical reset is Odd if this bit is set, even if not.
  536.       5  Disable SYNC Output. If set HSYNC, VSYNC and BLANK are tristated.
  537.  
  538. 3d4h index 57h (R/W):  External Sync Control 2 Register                (80x +)
  539. bit  0-3  Vsync Reset Adjust. The vertical delay of the Vertical counter reset
  540.           from the falling edge of VSync in scan lines. Must be non-zero in
  541.           Remote mode (3d4h index 56h bit 0 set).
  542.      4-7  Hsync Reset Adjust. The horizontal delay of the Horizontal counter
  543.           reset from the falling edge of VSync in character clocks.
  544.  
  545. 3d4h index 58h (R/W):  Linear Address Window Control Register          (80x +)
  546. bit  0-1  Linear Address Window Size. Must be less than or equal to video
  547.           memory size. 0: 64K, 1: 1MB, 2: 2MB, 3: 4MB (928)/8Mb (864/964)
  548.        2  (not 864/964) Enable Read Ahead Cache if set
  549.        3  (80x,928) ISA Latch Address. If set latches address during every ISA
  550.            cycle, unlatches during every ISA cycle if clear.
  551.           (864/964) LAT DEL. Address Latch Delay Control (VL-Bus only). If set
  552.            address latching occours in the T1 cycle, if clear in the T2 cycle
  553.            (I.e. one clock cycle delayed).
  554.        4  ENB LA. Enable Linear Addressing if set.
  555.        5  (not 864/964) Limit Entry Depth for Write-Post. If set limits Write
  556.            -Post Entry Depth to avoid ISA bus timeout due to wait cycle limit.
  557.        6  (928,964) Serial Access Mode (SAM) 256 Words Control. If set SAM
  558.             control is 256 words, if clear 512 words.
  559.        7  (928) RAS 6-MCLK. If set the random read/write cycle time is 6MCLKs,
  560.            if clear 7MCLKs
  561.  
  562. 3d4h index 59h M(R/W):  Linear Address Window Position Register        (80x +)
  563. bit  0-9  (80x,928) Linear Address Window Position.
  564.            This is bit 16-25 of the Linear Address Window Starting Position.
  565.            Bits 26-31 are generated externally and input on the SAUP1 pin.
  566.     0-15  (864/964) Linear Address Window Position.
  567.            This is bit 16-31 of the Linear Address Window Starting Position.
  568.           ISA configurations ignore bits 24-31 of the address (and thus bits
  569.            8-9/15 of this register). If the Linear Address Window Size (3d4h
  570.           index 58h bits 0-1) is >64K the lower 4 (1MB),5 (2MB),6 (4MB) or
  571.            7 (8MB) bits of this register are ignored. For PCI systems bits
  572.           23-31 of the address is common with bits 23-31 of the PCI Base
  573.           Address 0 register at PCI offset 10h. Writes to either register will
  574.           be reflected in the other, but bits 23-31 should be updated through
  575.           the PCI register.
  576.  
  577. 3d4h index 5Bh (R/W):  Extended BIOS Flag 2 Register                   (80x +)
  578. bit  0-7  Scratch Pad.
  579.      0-3  (Diamond) Monitor type. 0: NEC 3Fg, 1: NEC 6Fg, 2: VESA 75Hz,
  580.                      3: NEC 4Fg, 4: Gen90?, 5: CS1024i, NEC 3FGx, 8: Fixed?,
  581.                      9: Sony 1304, 10: Sony 1304s, 11: CS1572, 12: NEC 5FGe,
  582.                      13: Mon100?, 14: Mon120?, 15: Reserved fopr Vmode
  583.  
  584. 3d4h index 5Ch (R/W):  General Output Port Register                    (80x +)
  585. bit  0-3  (R) Clock Select Out. If 3C2h/3CCh bit 2-3 is 3 this is 3d4h index
  586.           42h bits 0-3, else bits 0-1 are 3C2h/3CCh bits 2-3 and bits 2-3 are
  587.           0. Thus this is the resulting clock select signals output.
  588.      4-7  General Output Port. Can be used for external logic.
  589.        4  (ELSA) EEProm Data Bit
  590.        5  (ELSA) EEProm Chip Read Select. Set for read access
  591.           (TVP3025 systems) Connected to RS4 on the TVP3025. Set for Bt485
  592.            mode, clear for TVP3020 mode.
  593.        6  (ELSA) EEProm Clock Bit
  594.        7  (ELSA) EEProm Chip Select. Set to access the EEProm
  595.           (STB Pegasus) Changes Video Memory mapping. If set video memory is
  596.            mapped in the 7C000000h-7FFFFFFFh range (A26-31 = 011111), if clear
  597.            at 0-3FFFFFFh range (A26-31 = 0).
  598.  
  599. 3d4h index 5Dh (R/W):  Extended Horizontal Overflow Register           (80x +)
  600. bit    0  Horizontal Total bit 8. Bit 8 of the Horizontal Total register (3d4h
  601.           index 0)
  602.        1  Horizontal Display End bit 8. Bit 8 of the Horizontal Display End
  603.           register (3d4h index 1)
  604.        2  Start Horizontal Blank bit 8. Bit 8 of the Horizontal Start Blanking
  605.           register (3d4h index 2).
  606.        3  (864,964) EHB+64. End Horizontal Blank +64. If set the /BLANK pulse
  607.            is extended by 64 DCLKs. Note: Is this bit 6 of 3d4h index 3 or
  608.            does it really extend by 64 ?
  609.        4  Start Horizontal Sync Position bit 8. Bit 8 of the Horizontal Start
  610.           Retrace register (3d4h index 4).
  611.        5  (864,964) EHS+32. End Horizontal Sync +32. If set the HSYNC pulse
  612.            is extended by 32 DCLKs. Note: Is this bit 5 of 3d4h index 5 or
  613.            does it really extend by 32 ?
  614.        6  (928,964) Data Transfer Position bit 8. Bit 8 of the Data Transfer
  615.             Position register (3d4h index 3Bh)
  616.        7  (928,964) Bus-Grant Terminate Position bit 8. Bit 8 of the Bus Grant
  617.             Termination register (3d4h index 5Fh).
  618.  
  619. 3d4h index 5Eh (R/W):  Extended Vertical Overflow Register             (80x +)
  620. bit    0  Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h
  621.           index 6). Bits 8 and 9 are in 3d4h index 7 bit 0 and 5.
  622.        1  Vertical Display End bit 10. Bit 10 of the Vertical Display End
  623.           register (3d4h index 12h). Bits 8 and 9 are in 3d4h index 7 bit 1
  624.           and 6
  625.        2  Start Vertical Blank bit 10. Bit 10 of the Vertical Start Blanking
  626.           register (3d4h index 15h). Bit 8 is in 3d4h index 7 bit 3 and bit 9
  627.           in 3d4h index 9 bit 5
  628.        4  Vertical Retrace Start bit 10. Bit 10 of the Vertical Start Retrace
  629.           register (3d4h index 10h). Bits 8 and 9 are in 3d4h index 7 bit 2
  630.           and 7.
  631.        6  Line Compare Position bit 10. Bit 10 of the Line Compare register
  632.           (3d4h index 18h). Bit 8 is in 3d4h index 7 bit 4 and bit 9 in 3d4h
  633.           index 9 bit 6.
  634.  
  635. 3d4h index 5Fh (R/W):  Bus Grant Termination Position Register       (928,964)
  636. bit  0-7  Bus Grant Termination Position. The termination position in
  637.           character clocks for the BGNT signal. Valid only if 3d4h index 50h
  638.           bit 2 set.
  639.  
  640. 3d4h index 60h (R/W):  Extended Memory Control 3                     (864,964)
  641. bit  0-7  N parameter. Number of 4byte(1Mb) or 8byte(2/4Mb) memory cycles
  642.           reserved for the display FIFO before other requestors are served
  643.  
  644. 3d4h index 61h (R/W):  Extended Memory Control 4                     (864,964)
  645. bit  0-2  L Parameter bits 8-10. Bits 0-7 are in index 62h
  646.        7  ENB DFLC. Enable Display Fetch Length Control (L Parameter) enabled
  647.           if set
  648.  
  649. 3d4h index 62h (R/W):  Extended Memory Control 5                     (864,964)
  650. bit  0-7  L Parameter bits 0-7. Bits 8-10 are in index 61h. Number of bytes
  651.           per scanline divided by 4(for 1Mb - 32bit) or 8(for 2/4Mb - 64bit).
  652.           When the display FIFO has received this many memory cycles the FIFO
  653.           will need no further cycles until the next line starts.
  654.  
  655. 3d4h index 63h (R/W):  Extended Sync Delay Adjust High               (864,964)
  656. bit  0-3  VSYNC Reset Adjust bits 4-7. Bits 0-3 are in 3d4h index 57h bits 0-3
  657.      4-7  HSYNC Reset Adjust bits 4-7. Bits 0-3 are in 3d4h index 57h bits 4-7
  658.  
  659. 3d4h index 64h (R/W):  Genlocking Adjustment Register                (864,964)
  660. bit  0-2  H-Counter Dot Addition Adjust. Adjusts the timing of the H-Counter
  661.           reset delay n Dot Clocks.
  662.        3  H-Counter Dot Addition Adjust enabled if set
  663.      4-6  Character Clock Phase Adjust. Delay (in dot clocks) from the rising
  664.           edge of VSYNC to the character clock.
  665.        7  Character Clock Phase Adjust enabled if set
  666.  
  667. 3d4h index 65h (R/W):  Extended Miscellaneous Control                (864,964)
  668. bit    0  SE DLAY. Delay falling edge of SE. If set the falling edges of SE0-3
  669.           are delayed. This reduces the risc of data contention when several
  670.           memory banks are outputting to the same pixel bus.
  671.        1  DISA 1SC. Disable 1st SC0-1 Output. If set the early SC0-1 output
  672.           during blanking is disabled when split transfers are enabled
  673.        2  ENB 3C3. Enable 3C3h for Video Subsystem Setup. If set 3C3h is used
  674.           for video subsystem setup, if clear 46E8h is used.
  675.      6-7  ADR ADJ. Address adjustment for split transfers. 0: No adjustment
  676.           (32 or 64bit pixel bus), 2: 512word shift register and 128bit pixel
  677.           bus, 3: 256word shift register and 128bit pixel bus.
  678.       When using the TI TVP3020 DAC should be set to: 0: Palette modes
  679.            (4/8bit modes), 1: 15/16bit modes, 2: 32bit modes
  680.  
  681. 3d4h index 66h (R/W):  Extended Miscellaneous Control 1              (864/964)
  682. bit  0-2  DIV-SC. Divide SC,SE and VCLK. 0: SC,SE and VCLK = DCLK, 1: SC,SE
  683.           and VCLK = DCLK/2,  2: SC,SE and VCLK = DCLK/4, 3: SC,SE and VCLK
  684.            = DCLK/8, 4: SC,SE and VCLK = DCLK/16, 5: SC,SE and VCLK = DCLK/32
  685.        3  SC=VCLK. Set SC0 to VCLK Frequency. if set SC = VCLK and SC1 =
  686.           inverted VCLK regardless of bits 4-5.
  687.      4-5  SID-MODE. SID Operation Mode. 0: 64bit serial pixel bus, 1: 32bit
  688.           parallel pixel bus, 2: 128bit serial (or 64bit parallel) pixel bus,
  689.           3: 32bit serial pixel bus.
  690.        6  TOFF PADT. Tri-State Off Pixel Address Bus. If set PA0-7 (the VGA
  691.           pixel bus) is tri-stated.
  692.        7  PCI DE. PCI Bus Disconnect Enabled if set
  693.  
  694. 3d4h index 67h (R/W):  Extended Miscellaneous Control 2         (805i,864/964)
  695. bit    0  VCLK PHS. VCLK Phase With Respect to DCLK. If clear VLKC is inverted
  696.           DCLK, if set VCLK = DCLK.
  697.      1-7  Documented as reserved, however:
  698.      4-7  Pixel format.
  699.              0  Mode  0: 8bit (1 pixel/VCLK)
  700.              1  Mode  8: 8bit (2 pixels/VCLK)
  701.              3  Mode  9: 15bit (1 pixel/VCLK)
  702.              5  Mode 10: 16bit (1 pixel/VCLK)
  703.              7  Mode 11: 24/32bit (2 VCLKs/pixel)
  704.             13  (732/764) 32bit (1 pixel/VCLK)
  705.  
  706. 3d4h index 68h (R/W):  Configuration 3 Register                      (864,964)
  707. bit  0-1  /CAS,/WE,/OE Stretch Time. 0: 4units delay, 1: 3units delay,
  708.             2: 2units delay, 3: 1unit delay
  709.      2-3  MA-D-SEL. Memory Address Depth Select. 1: 128K (512 rows X 256
  710.            coloumns), 3: 256K (512 rows X 512 coloumns).
  711.      4-5  /RAS-LOW. /RAS Low Timing Select. 0: 6.5 MCLKs, 1: 5.5 MCLKs,
  712.             2: 4.5 MCLKs, 3: 3.5 MCLKs
  713.      6-7  /RAS-PCG. /RAS Precharge Timing Select. 1: 4.5 MCLKs, 2: 3.5 MCLKs,
  714.             3: 2.5 MCLks
  715. Note: This register is latched from PD16-23 on reset. Write A5h to index 39h
  716.       to update this register.
  717.  
  718. 3d4h index 69h (R/W):  Extended System Control 3                     (864,964)
  719. bit  0-4  Display Start Address bits 16-20
  720. Note: The Display Start registers at index 31h/51h still works.
  721.  
  722. 3d4h index 6Ah (R/W):  Extended System Control 4                     (864,964)
  723. bit  0-6  Bank register in units of 64Kbytes.
  724. Note: The bank registers at index 35h/51h still works.
  725.  
  726. 3d4h index 6Bh (R/W):  Extended BIOS Flag 3                          (864,964)
  727. bit  0-7  Reserved
  728.  
  729. 3d4h index 6Ch (R/W):  Extended BIOS Flag 4                          (864,964)
  730. bit  0-7  Reserved
  731.  
  732. 3d4h index 6Dh (R/W):  Extended Miscellaneous Control           (805i,864/964)
  733. bit  0-2  DELAY-BL-BY-DCLK. Delay /BLANK by DCLK. Number of DCLKs to delay the
  734.           BLANK signal. Pulse width is not affected.
  735.      4-6  DELAY-SC-BY-VCLK. Number of VCLKs to delay SC0-1. Pulse width is not
  736.           affected.
  737.  
  738. 3D8h (R/W):  CGA Mode Control Register (CGA_MODE)
  739. bit    0  HRES TEXT. Select High Resolution Text. 0: 40x25, 1: 80x25
  740.        1  GRPH MODE. Select Graphics Mode. 0: Text, 1: Graphics
  741.        2  B/W MODE. Select Black/White Mode. 0: Color enabled, 1: Color
  742.           disabled, In 320x200 4 color mode the pixels are:
  743.             0: background, 1: Cyan, 2: Red, 3: White
  744.        3  DISP ENB. Enable Display.  0: Blank, 1: Video Enabled
  745.        4  HRES GRPH. Select High Resolution Graphics. 1: Enable 640x200
  746.           graphics mode, 0: all other modes.
  747.        5: TEXT BLNK. Enable Text Blinking. 0: disabled, 1: enabled
  748.  
  749. 3D9h (R/W):  CGA Color Select Register (CGA_COLOR)
  750. bit    0  BORDER/BKGR COLOR. Select Blue Border. 0: Blue not selected,
  751.            1: Blue border in text mode, blue background & border in 320x200
  752.               mode, blue foreground in 640x200 mode.
  753.        1  BORDER/BKGR COLOR. Select Green Border. 0: Green not selected,
  754.            1: Green border in text mode, green background & border in 320x200
  755.               mode, green foreground in 640x200 mode.
  756.        2  BORDER/BKGR COLOR. Select Red Border. 0: Red not selected,
  757.            1: Red border in text mode, red background & border in 320x200
  758.               mode, Red foreground in 640x200 mode.
  759.        3  BORDER/BKGR COLOR. Select intensified Border. 0: No intensification,
  760.            1: Intensified border in text mode, intensified background & border
  761.            in 320x200 mode, intensified foreground in 640x200 mode.
  762.        4  SEL I-EN. Select Alternate Color Set. 0: Alternate color set not
  763.           enabled, 1: Background color in text mode, Enable alternate color
  764.           set in graphics mode.
  765.        5  SEL CSET. Select Color Set in 320x200 mode.
  766.             0: Palette: 0: Background, 1: Green, 2: Red, 3: Yellow
  767.             1: Palette: 0: Background, 1: Cyan, 2: Violet, 3: White
  768.  
  769. 3DAh (R):  CGA Status Register (CGA_STAT)
  770. bit    0  /DTM. Border/Blanking Active. Border or Blanking active if set
  771.        1  LPF. Light Pen Flag. 0: Light Pen Latch cleared, 1: light Pen Latch
  772.           triggered.
  773.        2  Light Pen switch open if set, cleared if not
  774.        3  VSY. Vertical Sync Active. if set
  775.  
  776. 3DBh (W):  Reset Light Pen Flag Register (RLPEN)
  777. Any write to this register will reset the Light Pen Latch
  778.  
  779. 3DCh (W):  Set Light Pen Flag Register (SLPEN)
  780. Any write to this register will set the Light Pen Latch
  781.  
  782.  
  783. Below are the 8514/A registers. 3d4h index 40h bit 0 must be set to use them.
  784.  
  785. 42E8h W(R):  Subsystem Status Register (SUBSYS_STAT)
  786. bit   0-3  Interrupt requests. These bits show the state of internal interrupt
  787.            requests. An interrupt will only occur if the corresponding bit(s)
  788.            in SUBSYS_CNTL is set. Interrupts can only be reset by writing a 1
  789.            to the corresponding Interrupt Clear bit in SUBSYS_CNTL.
  790.              Bit 0: Vertical Sync Interrupt
  791.                  1: Graphics Engine Busy Interrupt
  792.                  2: FIFO Overflow Interrupt
  793.                  3: FIFO Empty Interrupt
  794.       4-6  MONITORID.
  795.               2: IBM 8514/A color 16"
  796.               5: IBM 8503 Monochrome 12"
  797.               6: IBM 8512 color 14" or 8513 color 12"
  798.               7: No (or other) monitor
  799.         7  PXL LNG. Clear for 4 bits per pixel, set for 8 or more bpp.
  800.            Only used when 3d4h index 50h bits 4-5 = 0.
  801.  
  802. 42E8h W(W):  Subsystem Control Register (SUBSYS_CNTL)
  803. bit   0-3  Interrupt Reset. Write 1 to a bit to reset the interrupt.
  804.            Bit 0  VSY CLR   Write 1 to reset Vertical Sync interrupt.
  805.                1  GEB CLR   Write 1 to reset Graphics Engine Busy interrupt.
  806.                2  FIFO CLO  Write 1 to reset FIFO Overflow interrupt.
  807.                3  FIFO CLE  Write 1 to reset FIFO Empty interrupt.
  808.       4-7  Reserved(0)
  809.         8  VSY ENB. Vertical Sync Interrupt Enabled if set.
  810.         9  GE BSY.  Graphics Engine Busy Interrupt Enabled if set.
  811.        10  FIFO-ENB OVF. FIFO Overflow Interrupt Enabled if set.
  812.        11  FIFO-ENB EMP. FIFO Empty Interrupt Enabled if set.
  813.     14-15  GE-RST. Graphics Engine Software Reset.
  814.              0: no change, 1: Graphics Engine enabled, 2: reset
  815.  
  816. 46E8h (W):  Video Subsystem Enable Register (SETUP_MD)
  817. bit     3  Address Decoding (AD DEC). If clear Video I/O and Memory address
  818.            decoding is disabled.
  819.         4  Enable Setup (EN SUP). Set to enter Setup Mode, clear to enable
  820.            normal operation. When in Setup Mode only the Setup Option Select
  821.            Register at 102h is accessible.
  822.  
  823. 4AE8h W(W):  Advanced Function Control Register  (ADVFUNC_CNTL)
  824. bit     0  ENB EHFC. Enable Enhanced Functions. Set to enable enhanced
  825.            functions using the wide pixel bus to the DAC(SID), clear to enable
  826.            VGA display functions using the VGA pixel bus (PA0-7).
  827.         1  Reserved(1).
  828.         2  (911-928) SCRN SIZE - Screen Size. For enhanced modes this bit
  829.             selects the resolution: Clear for 640x480, set for 1024x768 or
  830.             800x600
  831.            (864,964) ENH PL. Enhanced modes pixel length. Set for 4bits/pixel
  832.             enhanced modes, clear for 8/15/16/24/32 bit/pixel enhanced modes
  833.             (3d4h index 50h bits 4-5 controls the width).
  834.         4  (928 +) LA - Enable Linear Addressing if set. This bit is ORed
  835.              with 3d4h index 58h bit 4 so that either bit will enable Linear
  836.              Addressing if set
  837.         5  (928 +) MIO - Enable Memory Mapped I/O if set. This bit is ORed
  838.              with 3d4h index 53h bit 4 so that either bit will enable Memory
  839.              Mapped I/O if set
  840.         6  (928 only) WP - Enable Write Posting if set. This bit is ORed
  841.              with 3d4h index 40h bit 3 so that either bit will enable Write
  842.              Posting if set
  843.  
  844. 82E8h W(R/W):  Current Y Position Register (CUR_Y)
  845. bit  0-11  Y Position. Y co-ordinate of current position in pixels.
  846.  
  847. 86E8h W(R/W):  Current X Position Register (CUR_X)
  848. bit  0-11  X Position. X co-ordinate of current position in pixels.
  849.  
  850. 8AE8h W(R/W):  Destination Y Position & Axial Step Constant Register
  851.                (DESTY_AXSTP)
  852. bit  0-11  DESTINATION Y-POSITION. During BITBLT operations this is the Y
  853.            co-ordinate of the destination in pixels.
  854.      0-12  (911/924) LINE PARAMETER AXIAL STEP CONSTANT. During Line Drawing,
  855.             this is the Bresenham constant 2*dminor in two's complement
  856.             format. (dminor is the length of the line projected onto the minor
  857.             or dependent axis).
  858.      0-13  (80 x+) LINE PARAMETER AXIAL STEP CONSTANT. Se above
  859.  
  860. 8EE8h W(R/W):  Destination X Position & Diagonal Step Constant Register
  861.                (DESTX_DISTP)
  862. bit  0-11  DESTINATION X-POSITION. During BITBLT operations this is the X
  863.            co-ordinate of the destination in pixels.
  864.      0-12  (911/924) LINE PARAMETER DIAGONAL STEP CONSTANT. During Line
  865.             Drawing this is the Bresenham constant 2*dminor-2*dmajor in two's
  866.             complement format. (dminor is the length of the line projected
  867.             onto the minor or dependent axis, dmajor is the length of the line
  868.             projected onto the major or independent axis)
  869.      0-13  (80x +) LINE PARAMETER DIAGONAL STEP CONSTANT. Se above
  870.  
  871. 92E8h W(R/W):  Line Error Term Read/Write Register (ERR_TERM).
  872. bit  0-12  (911/924) LINE PARAMETER/ERROR TERM. For Line Drawing this is the
  873.             Bresenham Initial Error Term 2*dminor-dmajor (one less if the
  874.             starting X is less than the ending X) in two's complement format.
  875.             (dminor is the length of the line projected onto the minor or
  876.             dependent axis, dmajor is the length of the line projected onto
  877.             the major or independent axis).
  878.      0-13  (80x +) LINE PARAMETER/ERROR TERM. See above.
  879.  
  880. 96E8h W(R/W):  Major Axis Pixel Count/Rectangle Width Register (MAJ_AXIS_PCNT)
  881. bit  0-10  (911/924)  RECTANGLE WIDTH/LINE PARAMETER MAX. For BITBLT and
  882.             rectangle commands this is the width of the area. For Line Drawing
  883.             this is the Bresenham constant dmajor in two's complement format.
  884.             (dmajor is the length of the line projected onto the major or
  885.             independent axis). Must be positive.
  886.      0-11  (80x +) RECTANGLE WIDTH/LINE PARAMETER MAX. See above
  887.  
  888. 9AE8h W(R):  Graphics Processor Status Register (GP_STAT)
  889. bit   0-7  Queue State.
  890.              00h = 8 words available - queue is empty
  891.              01h = 7 words available
  892.              03h = 6 words available
  893.              07h = 5 words available
  894.              0Fh = 4 words available
  895.              1Fh = 3 words available
  896.              3Fh = 2 words available
  897.              7Fh = 1 word  available
  898.              FFh = 0 words available - queue is full
  899.         8  (911-928) DTA AVA. Read Data Available. If set data is ready to be
  900.             read from the PIX_TRANS register (E2E8h).
  901.         9  HDW BSY. Hardware Graphics Processor Busy
  902.            If set the Graphics Processor is busy.
  903.        10  (928 +) AE. All FIFO Slots Empty. If set all FIFO slots are empty.
  904.     11-15  (864/964) (R) Queue State bits 8-12. 1Fh if 8 words or less
  905.             available, Fh for 9 words, 7 for 10 words, 3 for 11 words, 1 for
  906.             12 words and 0 for 13 words available.
  907.  
  908. 9AE8h W(W):  Drawing Command Register (CMD)
  909. bit     0  (911-928) ~RD/WT. Read/Write Data. If set VRAM write operations are
  910.             enabled. If clear operations execute normally but writes are
  911.             disabled.
  912.         1  PX MD. Pixel Mode. Defines the orientation of the display bitmap.
  913.              0 = Through plane mode (Single pixel transferred at a time)
  914.              1 = Across plane mode (Multiple pixels transferred at a time).
  915.         2  LAST PXOF. Last Pixel Off. If set the last pixel of a line command
  916.            (CMD_LINE, SSV or LINEAF) is not drawn. This is used for mixes such
  917.            as XOR where drawing the same pixel twice would give the wrong
  918.            color.
  919.         3  DIR TYP. Direction Type.
  920.              0: Bresenham line drawing (X-Y Axial)
  921.                   CMD_LINE draws a line using the Bresenham algorithm as
  922.                   specified in the DESTY_AXSTP (8AE8h), DESTX_DIASTP (8EE8h),
  923.                   ERR_TERM (92E8h) and MAJ_AXIS_PCNT (96E8h) registers
  924.                   INC_X, INC_Y and YMAJAXIS determines the direction.
  925.              1: Vector line draws (Radial).
  926.                   CMD_NOP allows drawing of Short Stroke Vectors (SSVs) by
  927.                   writing to the Short Stroke register (9EE8h).
  928.                   CMD_LINE draws a vector of length MAJ_AXIS_PCNT (96E8h)
  929.                   in the direction specified by LINEDIR (bits 5-7).
  930.                   DRWG-DIR determines the direction of the line.
  931.         4  DRAW YES. If clear the current position is moved, but no pixels
  932.            are modified. This bit should be set when attempting read or
  933.            write of bitmap data.
  934.       5-7  DRWG-DIR. Drawing Direction. When a line draw command (CMD_LINE)
  935.            with DIR TYP=1 (Radial) is issued, these bits define the direction
  936.            of the line counter clockwise relative to the positive X-axis.
  937.              0 = 000 degrees
  938.              1 = 045 degrees
  939.              2 = 090 degrees
  940.              3 = 135 degrees
  941.              4 = 180 degrees
  942.              5 = 225 degrees
  943.              6 = 270 degrees
  944.              7 = 315 degrees
  945.         5  INC_X. This bit together with INC_Y determines which quadrant
  946.            the slope of a line lies within. They also determine the
  947.            orientation of rectangle draw commands.
  948.            If set lines are drawn in the positive X direction (left to right).
  949.         6  YMAJAXIS. For Bresenham line drawing commands this bit determines
  950.            which axis is the independent or major axis. INC_X and INC_Y
  951.            determines which quadrant the slope falls within. This bit further
  952.            defines the slope to within an octant.
  953.            If set Y is the major (independent) axis.
  954.         7  INC_Y. This bit together with INC_X determines which quadrant
  955.            the slope of a line lies within. They also determine the
  956.            orientation of rectangle draw commands.
  957.            If set lines are drawn in the positive Y direction (down).
  958.         8  WAIT YES. If set the drawing engine waits for read/write of the
  959.            PIX_TRANS register (E2E8h) for each pixel during a draw operation.
  960.         9  (911-928) BUS SIZE. If set the PIX_TRANS register (E2E8h) is
  961.             processed internally as two bytes in the order specified by BYTE
  962.             SWAP. If clear all accesses to E2E8h are 8bit.
  963.      9-10  (864,964) BUS SIZE. Select System Bus Size. Controls the width of
  964.             the Pixel Data Transfer registers (E2E8h,E2EAh) and the memory
  965.             mapped I/O. 0: 8bit, 1: 16bit, 2: 32bit
  966.        12  BYTE SWAP. Affects both reads and writes of SHORT_STROKE (9EE8h)
  967.            and PIX_TRANS (E2E8h) when 16bit=1.
  968.            If set take low byte first, if clear take high byte first.
  969.     13-15  Draw Command:
  970.             0 = NOP. Used for Short Stroke Vectors.
  971.             1 = Draw Line. If bit 3 is set the line is drawn to the angle in
  972.                 bits 5-7 and the length in the Major Axis Pixel Count register
  973.                 (96E8h), if clear the line is drawn from the Bresenham
  974.                 constants in the Axial Step Constant register(8AE8h), Diagonal
  975.                 Step Constant register (8EE8h), Line Error Term register
  976.                (92E8h) and bits 5-7 of this register.
  977.             2 = Rectangle Fill. The Destination X (8EE8h) and Y (8AE8h)
  978.                 registers holds the coordinates of the rectangle to fill and
  979.                 the Major Axis Pixel Count register (96E8h) holds the
  980.                 horizontal width (in pixels) fill and the Minor Axis Pixel
  981.                 Count register (BEE8h index 0) holds the height of the
  982.                 rectangle.
  983.             6 = BitBLT. Copies the source rectangle specified by the Current X
  984.                 (86E8h) and Y (8AE8h) registers to the destination rectangle,
  985.                 specified as for the Rectangle Fills.
  986.             7 = (80x +) Pattern Fill. The source rectangle is an 8x8 pattern
  987.                 rectangle, which is copied repeatably to the destination
  988.                 rectangle.
  989.  
  990. 9EE8h W(W):  Short Stroke Vector Transfer Register (SHORT_STROKE)
  991. bit   0-3  PIXEL-LENGTH. Length of vector projected onto the major axis.
  992.            This is also the number of pixels drawn.
  993.         4  DRW-MV. Set to draw the line, clear to move over it.
  994.       5-7  DRWG DIR. The angle measured counter-clockwise from horizontal
  995.            right) at which the line is drawn,
  996.              0 = 000 degrees
  997.              1 = 045 degrees
  998.              2 = 090 degrees
  999.              3 = 135 degrees
  1000.              4 = 180 degrees
  1001.              5 = 225 degrees
  1002.              6 = 270 degrees
  1003.              7 = 315 degrees
  1004.      8-15  The lower 8 bits are duplicated in the upper 8 bits so two
  1005.            short stroke vectors can be drawn with one command.
  1006. Note: The upper byte must be written for the SSV command to be executed.
  1007.       Thus if a byte is written to 9EE8h another byte must be written to
  1008.       9EE9h before execution starts. A single 16bit write will do.
  1009.       If only one SSV is desired the other byte can be set to 0.
  1010.  
  1011. A2E8h W(R/W):  Background Color Register (BKGD_COLOR)
  1012. bit   0-7  (911/924) Background Color. This is the color used for writing
  1013.             pixels where the Foreground Color Mix is selected and FSS=0, or
  1014.             the Background Color Mix is selected and BSS=0.
  1015.      0-15  (801/5) Background color. See above.
  1016.      0-31  (928 +) Background color. See above. In 32 bits per pixel modes
  1017.             there are two 16bit registers at this address. BEE8h index 0Eh bit
  1018.              4 selects which 16 bits are accessible and each access toggles to
  1019.             the other 16 bits.
  1020.  
  1021. A6E8h W(R/W):  Foreground Color Register (FRGD_COLOR)
  1022. bit   0-7  (911/924) Foreground Color. This is the color used for writing
  1023.             pixels where the Foreground Color Mix is selected and FSS=1, or
  1024.             the Background Color Mix is selected and BSS=1.
  1025.      0-15  (801/5) Foreground color. See above.
  1026.      0-31  (928 +) Foreground color. See above. In 32 bits per pixel modes
  1027.             there are two 16bit registers at this address. BEE8h index 0Eh bit
  1028.              4 selects which 16 bits are accessible and each access toggles to
  1029.             the other 16 bits.
  1030.  
  1031. AAE8h W(R/W):  Write Mask Register (WRT_MASK)
  1032. bit   0-7  (911/924) Writemask. A plane can only be modified if the
  1033.             corresponding bit is set.
  1034.      0-15  (801/5) Writemask. See above.
  1035.      0-31  (928 +) Writemask. See above. In 32 bits per pixel modes there are
  1036.             two 16bit registers at this address. BEE8h index 0Eh bit 4 selects
  1037.             which 16 bits are accessible and each access toggles to the other
  1038.             16 bits.
  1039.  
  1040. AEE8h W(R/W):  Read Mask Register (RD_MASK)
  1041. bit   0-7  (911/924) Read Mask affects the following commands: CMD_RECT,
  1042.             CMD_BITBLT and reading data in Across Plane Mode.
  1043.             Each bit set prevents the plane from being read.
  1044.      0-15  (801/5) Readmask. See above.
  1045.      0-31  (928 +) Readmask. See above. In 32 bits per pixel modes there are
  1046.             two 16bit registers at this address. BEE8h index 0Eh bit 4 selects
  1047.             which 16 bits are accessible and each access toggles to the other
  1048.             16 bits.
  1049.  
  1050. B2E8h W(R/W):  Color Compare Register (COLOR_CMP)                (not 911/924)
  1051. bit  0-15  (801/5) This is the color which is compared to the destination data
  1052.             during BitBlts. The arithmetic comparison to be used (<,>,=,true,
  1053.             false, etc..) is specified by the COLCMPO bits of the PIX_CNTL
  1054.             register. If the result of the comparison is true, the destination
  1055.             data is left unchanged.
  1056.      0-31  (928 +) See above. In 32 bits per pixel modes there are two 16bit
  1057.             registers at this address. BEE8h index 0Eh bit 4 selects which 16
  1058.             bits are accessible and each access toggles to the other 16 bits.
  1059.  
  1060. B6E8h W(R/W):  Background Mix Register (BKGD_MIX)
  1061. bit   0-3  Background MIX (BACKMIX).
  1062.             00  not DST
  1063.             01  0 (false)
  1064.             02  1 (true)
  1065.             03  2 DST
  1066.             04  not SRC
  1067.             05  SRC xor DST
  1068.             06  not (SRC xor DST)
  1069.             07  SRC
  1070.             08  not (SRC and DST)
  1071.             09  (not SRC) or DST
  1072.             0A  SRC or (not DST)
  1073.             0B  SRC or DST
  1074.             0C  SRC and DST
  1075.             0D  SRC and (not DST)
  1076.             0E  (not SRC) and DST
  1077.             0F  not (SRC or DST)
  1078.            DST is always the destination bitmap, bit SRC has four
  1079.            possible sources selected by the BSS bits.
  1080.       5-6  Background Source Select (BSS)
  1081.              0  BSS is Background Color
  1082.              1  BSS is Foreground Color
  1083.              2  BSS is Pixel Data from the PIX_TRANS register (E2E8h)
  1084.              3  BSS is Bitmap Data (Source data from display buffer).
  1085.  
  1086. BAE8h W(R/W):  Foreground Mix Register (FRGD_MIX)
  1087. bit   0-3  Foreground MIX (FOREMIX).
  1088.            Same as BACKMIX in B6E8h.
  1089.       5-6  Foreground Source Select (FSS)
  1090.              0  FSS is Background Color
  1091.              1  FSS is Foreground Color
  1092.              2  FSS is Pixel Data from the PIX_TRANS register (E2E8h)
  1093.              3  FSS is Bitmap Data (Source data from display buffer).
  1094.  
  1095. BEE8h W(R):  Read Register Data Register (RD_REG_DT)               (801/5,928)
  1096. bit  0-15  BEE8h index Fh bits 0-2 selects the index which is read from this
  1097.            address. Each read of this address increases the pointer so all
  1098.            indices can be read by sequential reads of this register.
  1099.  
  1100. BEE8h W(W):  Multifunction Control Register (MULTIFUNC_CTRL)
  1101. bit  0-11  Data.
  1102.     12-15  INDEX. indicates which Multifunction register
  1103.            will be written with the data in bits 0-11.
  1104. Note: Several registers are placed at BEE8h. When BEE8 is written
  1105.       the bits 12-15 selects the specific register to receive the write.
  1106. Note: These registers are write-only on the 911 and 924, but read/write on
  1107.       later chips.
  1108.  
  1109. BEE8h index 00h W(R/W): Minor Axis Pixel Count Register (MIN_AXIS_PCNT).
  1110. bit  0-10  (911/924) Rectangle Height. Height of BITBLT or rectangle command.
  1111.             Actual height is one larger.
  1112.      0-11  (80x +) Rectangle Height. See above
  1113. Note: See note above on reading BEE8h.
  1114.  
  1115. BEE8h index 01h W(R/W):  Top Scissors Register (SCISSORS_T).
  1116. bit  0-10  (911/924) Clipping Top Limit. Defines the upper bound of the
  1117.             Clipping Rectangle (Lowest Y coordinate).
  1118.      0-11  (80x +) Clipping Top Limit. See above
  1119. Note: See note above on reading BEE8h.
  1120.  
  1121. BEE8h index 02h W(R/W):  Left Scissors Registers (SCISSORS_L).
  1122. bit  0-10  (911,924) Clipping Left Limit. Defines the left bound of the
  1123.             Clipping Rectangle (Lowest X coordinate).
  1124.      0-11  (80x +) Clipping Left Limit. See above.
  1125. Note: See note above on reading BEE8h.
  1126.  
  1127. BEE8h index 03h W(R/W):  Bottom Scissors Register (SCISSORS_B).
  1128. bit  0-10  (911,924) Clipping Bottom Limit. Defines the bottom bound of the
  1129.             Clipping Rectangle (Highest Y coordinate).
  1130.      0-11  (80x +) Clipping Bottom Limit. See above.
  1131. Note: See note above on reading BEE8h.
  1132.  
  1133. BEE8h index 04h W(R/W):  Right Scissors Register (SCISSORS_R).
  1134. bit  0-10  (911,924) Clipping Right Limit. Defines the right bound of the
  1135.             Clipping Rectangle (Highest X coordinate).
  1136.      0-11  (80x +) Clipping Bottom Limit. See above.
  1137. Note: See note above on reading BEE8h.
  1138.  
  1139. BEE8h index 0Ah W(R/W):  Pixel Control Register (PIX_CNTL).
  1140. BIT     2  (911-928) Pack Data. If set image read data is a monochrome bitmap,
  1141.             if clear it is a bitmap of the current pixel depth
  1142.       6-7  DT-EX-DRC. Select Mix Select.
  1143.              0  Foreground Mix is always used.
  1144.              2  CPU Data determines the Mix register used.
  1145.              3  Video memory determines the Mix register used.
  1146. Note: See note above on reading BEE8h.
  1147.  
  1148. BEE8h index 0Dh W(R/W):  Multifunction Control Miscellaneous 2 Register
  1149.                            (MULT_MISC2)                              (864,964)
  1150. bit   0-2  DST-BASE. Destination Base. Selects the megabyte the first
  1151.            destination address is in (huh?)  0: 1st MB, 1: 2nd MB
  1152.                3: 4th Mb, 4: 5th MB, 5: 6th MB, 6: 7th MB, 7: 8th MB
  1153.            If this is >0 it will override index Eh bits 0-1
  1154.       4-6  (864,964) SRC-BASE. Source Base. Selects the megabyte the first
  1155.             source address is in (huh?).  0: 1st MB, 1: 2nd MB, 2: 3rd MB,
  1156.               3: 4th MB, 4: 5th MB, 5: 6th MB, 6: 7th MB, 7: 8th MB
  1157.            If this is >0 it will override index Eh bits 2-3
  1158.  
  1159. BEE8h index 0Eh W(R/W):  Multifunction Control Miscellaneous Register
  1160.                            (MULT_FUNC)                                 (80x +)
  1161. bit     0  (801/5) DEST-BA. Destination Base Address. Selects the megabyte the
  1162.              first destination address is in (huh?)  0: 1st MB, 1: 2nd MB
  1163.       0-1  (928 +) DEST-BA. See above, plus  2: 3rd MB, 3: 4th MB
  1164.         2  (801/5) SRC-BA. Source Base Address. Selects the megabyte the
  1165.              first source address is in (huh?)
  1166.                0: 1st MB, 1: 2nd MB, 2: (928) 3rd MB, 3: (928) 4th MB
  1167.       2-3  (928 +) SRC-BA. See above
  1168.         4  (928 +) RSF. Register Select Flag. In 32bits per pixel modes this
  1169.             flag determines which half of the 32bit registers (A2E8h, A6E8h,
  1170.             AAE8h, AEE8h, B2E8h) will be accessible.
  1171.               0: Lower half (bits 0-15), 1: Upper half (bits 16-31).
  1172.         5  EXT CLIP. External Clipping. If set only pixels outside the
  1173.            Clipping Rectangle are drawn, if clear only pixels inside are
  1174.            drawn.
  1175.         6  SLW RMW. Slow Read/Modify/Write Cycle. Set to use slow RMW cycles
  1176.             (4 MCLKs), clear to use fast RMW cycles (3 MCLKs).
  1177.         7  SRC NE. Source Not Equal. If set bitmap data will only be updated
  1178.             if the Color Compare register (B2E8h) is equal to the source data,
  1179.             if clear the update only happens if the register and the source
  1180.             data differ. If bit 8 is clear the bitmap data will always be
  1181.             updated.
  1182.         8  Enable Color Compare. If set enables Color Comparison.
  1183.         9  (864/964) CMR 32B. Select 32-Bit Command Registers. If set the
  1184.            command registers (A2E8h, A6E8h, AAE8h, AEE8h and B2E8h) are 32bit
  1185.            byte and word access won't work, if clear they are 16bit.
  1186.  
  1187. BEE8h index 0Fh W(W):  Read Register Select Register (READ_SEL)    (801/5,928)
  1188. bit   0-2  (911-928) READ-REG-SEL. Read Register Select. Selects the register
  1189.             that is actually read when a read of BEE8h happens. Each read of
  1190.             BEE8h increments this register by one.
  1191.              0: Read will return contents of BEE8h index 0.
  1192.              1: Read will return contents of BEE8h index 1.
  1193.              2: Read will return contents of BEE8h index 2.
  1194.              3: Read will return contents of BEE8h index 3.
  1195.              4: Read will return contents of BEE8h index 4.
  1196.              5: Read will return contents of BEE8h index 0Ah.
  1197.              6: Read will return contents of BEE8h index 0Eh.
  1198.              7: Read will return contents of 9AE8h (Bits 13-15 will be 0).
  1199.       0-3  (864,964) READ-REG-SEL. See above plus:
  1200.              8: Read will return contents of 42E8h (Bits 12-15 will be 0)
  1201.              9: Read will return contents of 46E8h
  1202.             10: Read will return contents of BEE8h index 0Dh
  1203.  
  1204. E2E8h W(R/W):  Pixel Data Transfer Register (PIX_TRANS)
  1205. bit  0-15  Data can be read from or written to the display buffer.
  1206.            In through plane mode (PLANAR=0), bits 0-7 and 8-15 map onto
  1207.            bit planes 0-7 of an individual pixel.
  1208.            In across plane mode (PLANAR=1) bits 0-4 and 8-12 map onto pixels
  1209.            0-4 within a nugget (1 bit per pixel).
  1210. Note: Write only on the 864,964 ??
  1211.  
  1212. E2EAh W(R/W):  Pixel Data Transfer Register (PIX_TRANS)                (80x +)
  1213. bit  0-15  This is an extension of E2E8h for 32bit transfers.
  1214. Note: Write only on the 864,964 ??
  1215.  
  1216.  
  1217. ELSA EEProm data structures:
  1218.  
  1219.  WORD:  Bit:
  1220.   00h   0-15   CRC of entire EEProm image
  1221.   01h   0-15   Always 3353h ('S3')
  1222.   02h   0-15   Board code:
  1223.                  910h  ELSA Winner 1000
  1224.                  912h  ELSA Winner 1000 VESA Local Bus
  1225.                  914h  ELSA Winner 1000 PCI
  1226.                  91Ah  ELSA Winner 1000 ISA
  1227.                  920h  ELSA Winner 2000
  1228.                  922h  ELSA Winner 2000 VESA Local Bus
  1229.                  924h  ELSA Winner 2000 PCI
  1230.                  930h  ELSA Winner 1000 Pro
  1231.                  940h  ELSA Winner 2000 Pro
  1232.   03h   0-15   Serial Number, lower 16bits
  1233.   04h   0-15   Serial Number, upper 16bits
  1234.   05h   0-15   Size (in words) of the EEProm structure
  1235.   06h          Hardware Configuration
  1236.   07h   0-15   Max Pixel Clock in units of 4KHz
  1237.   08h   0-15   Max Memory Clock in units of 4KHz
  1238.   09h          Vmode0
  1239.   0Ah          Key Word
  1240.   0Bh   0-15   Monitor Horizontal Size in mm
  1241.   0Ch   0-15   Monitor Vertical Size in mm
  1242.   0Dh          Software Version
  1243.  0Eh-19h       Reserved
  1244.  
  1245.     Mode information, one record per mode:
  1246.   00h  10-15   Bits per Pixel (bpp)
  1247.          0-9   Horizontal Resolution in units of 4 pixels
  1248.   01h  12-15   Flags
  1249.         0-11   Vertical Resolution i scanlines
  1250.   02h   0-15   Pixel Frequency in units of 4KHz
  1251.   03h   0-11   Horizontal Total
  1252.        12-15   Horizontal Front Porch bit 6-9
  1253.   04h  10-15   Horizontal Front Porch bit 0-5
  1254.          0-9   Horizontal Sync Width
  1255.   05h   0-11   Vertical Total in scanlines
  1256.        12-15   Vertical Front Porch bit 6-11
  1257.   06h  10-15   Vertical Front Porch bit 0-5
  1258.          0-9   Vertical Sync Width
  1259.   07h          Reserved
  1260.   08h          Reserved
  1261.  
  1262.  
  1263.  
  1264.    PCI Configuration Registers
  1265.  
  1266. PCI 00h W(R):  Vendor ID
  1267. bit 0-15  5333h ('S3').
  1268.  
  1269. PCI 02h W(R):  Device ID
  1270. bit 0-15  88C0h for 864, 88D0h for 964. For 764 and later chips probably 3d4h
  1271.           index 2Dh in the high byte and 3d4h index 2Eh in the low byte.
  1272.  
  1273. PCI 04h W(R/W):  Command
  1274. bit    0  I/O. Response to I/O Accesses enabled if set
  1275.        1  MEM. Response to Memory Accesses enabled if set.
  1276.        5  DAC RSP. No Response to RAMDAC Register Access. If set there is no
  1277.           access to the RAMDAC registers.
  1278.  
  1279. PCI 06h W(R):  Status
  1280. bit 9-10  DEVSEL. Device Select Timing. 1: Medium /DEVSEL timing.
  1281.  
  1282. PCI 08h (R):  Revision ID
  1283. bit  0-7  Revision level. Probably 3d4h index 2Fh for 764 and later chips.
  1284.  
  1285. PCI 0Ah (R/W):  Programming Interface
  1286. bit    0  VGA. Set as we supports the VGA interface
  1287.  
  1288. PCI 10h D(R/W):  Base Address 0
  1289. bit    0  (R) MSI. Memory Space Indicator. 0 as it is Memory Mapped.
  1290.      1-2  (R) TYPE. Type of Address Relocation. 0 as we can locate anywhere in
  1291.                32bit address space
  1292.        3  (R) PREF. Prefetchable. 0 as the memory is non-cachable.
  1293.    23-31  BASE ADDRESS0.  Upper 9 bits of the memory address. See 3d4h index
  1294.            59h for details. Updates should be done to this register.
  1295.  
  1296. PCI 30h D(R/W):  BIOS ROM Base Address
  1297. bit    0  ADE. Address Decode Enable. Set to access the BIOS ROM at the
  1298.           address defined here.
  1299.    16-31  BIOS ROM BASE ADDRESS. Upper 16bits of the BIOS ROM base address
  1300.  
  1301.  
  1302.   ID S3 chip:
  1303.  
  1304.   wrinx(base,$38,0);    {disable extensions}
  1305.   if not testinx2(base,$35,$F) then
  1306.   begin
  1307.     wrinx(base,$38,$48);
  1308.     if testinx2(base,$35,$F) then
  1309.     begin
  1310.       __S3__
  1311.       case rdinx(base,$30) of
  1312.        $81:86c911
  1313.        $82:86c911A or 86c924
  1314.        $90:86c928 C
  1315.        $91:86c928 D
  1316.    $94,$95:86c928 E
  1317.        $A0:86c801/5 A or B
  1318.   $A2..$A4:86c801/5 C
  1319.        $A5:86c801/5 D
  1320.        $B0:86c928 PCI
  1321.       end;
  1322.     end;
  1323.   end;
  1324.  
  1325.  
  1326.   Video Modes (Diamond Stealth):
  1327.        VESA:
  1328.   54h        T   132   43   16
  1329.   55h        T   132   25   16
  1330.        101h  G   640  480  256  P8
  1331.   6Ah  102h  G   800  600   16  PL4
  1332.        103h  G   800  600  256  P8
  1333.        104h  G  1024  768   16  PL4
  1334.        205h  G  1024  768  256  P8
  1335.        206h  G  1280  960   16  PK4
  1336.        208h  G  1280 1024   16  PK4
  1337.        211h  G   640  480  64K  P16     Stealth 24 only
  1338.        212h  G   640  480  16M  P24     Stealth 24 only
  1339.        301h  G   640  480  32k  P15     HiColor '911/'924 cards
  1340.        106h  G  1280 1024   16  PL4
  1341.        107h  G  1280 1024  256  P8
  1342.              Remaining modes not on '911 and '924 cards
  1343.              Note the 16m color modes are type P24 on 801/5's and P32 on 928's
  1344.        110h  G   640  480  32k  P15
  1345.        111h  G   640  480  64k  P16
  1346.        112h  G   640  480  16m  P32    This is a P24 mode
  1347.        113h  G   800  600  32k  P15
  1348.        114h  G   800  600  64k  P16
  1349.        115h  G   800  600  16m  P32
  1350.        116h  G  1024  768  32k  P15
  1351.        117h  G  1024  768  64k  P16
  1352.        118h  G  1024  768  16m  P32
  1353.        119h  G  1280 1024  32k  P15
  1354.        11Ah  G  1280 1024  64k  P16
  1355.   45h        G  1600 1200  256  P8      STB Pegasus
  1356.        126h  G  1152  864       P16     Number 9
  1357.        127h  G  1152  864       P32     Number 9
  1358.  
  1359. ----------101DAA-------------------------------
  1360. INT 10 - VIDEO - Diamond Stealth - Check for Stealth
  1361.         AX = 1DAAh
  1362.         BX = FDECh
  1363. Return: AL = 01h  For Stealth VRAM
  1364.              02h  For Stealth 24
  1365.         AH = DACtype:
  1366.                00h  Standard VGA DAC
  1367.                11h  Highcolor DAC where bit 3 of the command register is
  1368.                     not writable.
  1369.                23h  SS2410 DAC
  1370.                33h  Highcolor DAC without RS2 decoding
  1371.                43h  Highcolor DAC with RS2 decoding
  1372.         SI:DI -> BIOS version & Copyright string
  1373. ----------101DAA-------------------------------
  1374. INT 10 - VIDEO - Diamond Stealth 64
  1375.         AX = 1DAAh
  1376.         BX = FDECh
  1377. Return: BX = CEDFh For Stealth64
  1378.      SI:DI -> BIOS message
  1379.         AL = Amount of memory
  1380.                01h  for 1Mb
  1381.                02h  for 2Mb
  1382.                04h  for 4Mb
  1383.         AH = DAC Type
  1384.              Bit 0-3  DAC Type. 0: Normal, 1: Sierra, 2: Diamond SS24,
  1385.                        3: Bt485 (135MHz), 4: STG1700, 5: STG1702,
  1386.                        6: AT&T 20c49x, 7: STG1703, 8: S3 SDAC,
  1387.                        9: Bt485 (175MHz)
  1388.                    4  Bus type. 0: VESA VLB, 1: PCI
  1389. ----------104FFF-----------------------------------
  1390. INT 10 - VIDEO - S3                 - SET/RESET DUAL DISPLAY MODE
  1391.         AX = 4FFFh
  1392.         BX = Dual display mode
  1393.               00h  Reset
  1394.               01h  Set dual display, 32KB VGA test
  1395.               02h  Set dual display, 64KB VGA test
  1396. Return: AX = 4F00h if successful
  1397.         BX = number of scanlines off screen for test mode
  1398. ----------107F-------------------------------------
  1399. INT 10 - VIDEO - Diamond Stealth/Stealth 24 - SET TEXT MODE
  1400.         AH = 7Fh
  1401.         BH = 00h  Set Color text mode
  1402.              01h  Set Color text mode
  1403.              02h  Set Monochrome text mode
  1404. Note: Actually only bit 0-1 of BH are tested.
  1405. ----------107F00-4000------------------------------
  1406. INT 10 - VIDEO - S3 80x/928 - GET S3 INFORMATION BLOCK
  1407.         AX = 7F00h
  1408.         BX = 4000h
  1409. Return: AX = 007Fh if supported
  1410.         DX:BX -> DAC set mode rutine
  1411. Note: Might be implemented in Diamond Stealth 24 with BIOS version > 3.33
  1412. ----------107F00-4001------------------------------
  1413. INT 10 - VIDEO - S3 80x/928 - GET LINEAR ADDRESS
  1414.         AX = 7F00h
  1415.         BX = 4001h
  1416. Return: AX = 007Fh if supported
  1417.         CX = current linear address base (high word)
  1418. Note: Might be implemented in Diamond Stealth 24 with BIOS version > 3.33
  1419. ----------107F00-4002------------------------------
  1420. INT 10 - VIDEO - S3 80x/928 - SET LINEAR ADDRESS
  1421.         AX = 7F00h
  1422.         BX = 4002h
  1423.         CX = new linear address base (high word)
  1424. Return: AX = 007Fh if supported
  1425. Note: Might be implemented in Diamond Stealth 24 with BIOS version > 3.33
  1426.