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

  1. 3C0h:  Attribute Controller: Address register
  2. bit 0-4  Address of data register to write to port 3C0h.
  3.       5  If set screen output is enabled and the palette can not be modified,
  4.          if clear screen output is disabled and the palette can be modified.
  5.  
  6.  
  7. Port 3C0h is special in that it is both address and data-write register.
  8. An internal flip-flop remembers whether it is currently acting as address or
  9. data register. Accesses to the attribute controller must be separated by at
  10. least 250ns. Reading port 3dAh will reset the flip-flop to address mode.
  11.  
  12.  
  13. 3C0h index 0-Fh  (W):  Attribute: Palette
  14. bit   0  Primary Blue
  15.       1  Primary Green
  16.       2  Primary Red
  17.       3  Secondary Blue
  18.       4  Secondary Green
  19.       5  Secondary Red
  20.  
  21. 3C0h index 10h (W):  Attribute: Mode Control Register
  22. bit   0  Graphics mode if set, Alphanumeric mode else.
  23.       1  Monochrome mode if set, color mode else.
  24.       2  9-bit wide characters if set.
  25.          The 9th bit of characters C0h-DFh will be the same as
  26.          the 8th bit. Otherwise it will be the background color.
  27.       3  If set Attribute bit 7 is blinking, else high intensity.
  28.  
  29. 3C0h index 11h (W):  Attribute: Overscan Color Register.
  30. bit 0-5  Color of screen border. Color is defined as in the palette registers.
  31. Note: The EGA requires the Overscan color to be 0 in high resolution modes.
  32.  
  33. 3C0h index 12h (W):  Attribute: Color Plane Enable Register
  34. bit   0  Bit plane 0 is enabled if set.
  35.       1  Bit plane 1 is enabled if set.
  36.       2  Bit plane 2 is enabled if set.
  37.       3  Bit plane 3 is enabled if set.
  38.     4-5  Video Status MUX. Diagnostics use only.
  39.          Two attribute bits appear on bits 4 and 5 of the Input Status
  40.          Register 1 (3dAh).  0: Red/Blue, 1: Blue(I)/Green, 2: Red(I)/Green(I)
  41.  
  42. 3C0h index 13h (W):  Attribute: Horizontal PEL Panning Register
  43. bit 0-3  Indicates number of pixels to shift the display left
  44.          Value  9bit textmode   256color mode   Other modes
  45.            0          1               0              0
  46.            1          2              n/a             1
  47.            2          3               1              2
  48.            3          4              n/a             3
  49.            4          5               2              4
  50.            5          6              n/a             5
  51.            6          7               3              6
  52.            7          8              n/a             7
  53.            8          0              n/a            n/a
  54.  
  55. 3C2h (R):  Input Status #0 Register
  56. bit   4  Status of the switch selected by the Miscellaneous Output
  57.          Register 3C2h bit 2-3. Switch high if set.
  58.       5  Pin 19 of the Feature Connector (FEAT0) is high if set
  59.       6  Pin 17 of the Feature Connector (FEAT1) is high if set
  60.       7  If set IRQ 2 has happened due to Vertical Retrace. Should be cleared
  61.          by IRQ 2 interrupt routine by clearing port 3d4h index 11h bit 4.
  62.  
  63. 3C2h (W):  Miscellaneous Output Register
  64. bit   0  If set Color Emulation. Base Address=3Dxh else Mono Emulation. Base
  65.          Address=3Bxh.
  66.       1  Enable CPU Access to video memory if set
  67.     2-3  Clock Select. 0: 14MHz, 1: 16MHz, 2: External
  68.       4  Disable internal video drivers if set
  69.       5  When in Odd/Even modes Select High 64k bank if set
  70.       6  Horizontal Sync Polarity. Negative if set
  71.       7  Vertical Sync Polarity. Negative if set
  72.          Bit 6-7 indicates the number of lines on the display:
  73.            0: 200 lines, 2: 350 lines
  74. Note: Set to all zero on a hardware reset.
  75.  
  76. 3C4h index  0  (W):  Sequencer: Reset
  77. bit   0  Asynchronous Reset if clear
  78.       1  Synchronous Reset if clear
  79.  
  80. 3C4h index  1  (W):  Sequencer: Clocking Mode
  81. bit   0  If set character clocks are 8 dots wide, else 9.
  82.       1  If set the CRTC uses 2/5 of the clock cycles, else 4/5.
  83.       2  If set loads video serializers every other character
  84.          clock cycle, else every one.
  85.       3  If set the Dot Clock is Master Clock/2, else same as Master Clock
  86.           (See 3C2h bit 2-3). (Doubles pixels).
  87.  
  88. 3C4h index  2  (W):  Sequencer: Map Mask Register
  89. bit   0  Enable writes to plane 0 if set
  90.       1  Enable writes to plane 1 if set
  91.       2  Enable writes to plane 2 if set
  92.       3  Enable writes to plane 3 if set
  93.  
  94. 3C4h index  3  (W):  Sequencer: Character Map Select Register
  95. bit 0-1  Selects EGA Character Map (0..3) if bit 3 of the character
  96.          attribute is clear.
  97.     2-3  Selects EGA Character Map (0..3) if bit 3 of the character
  98.          attribute is set.
  99. Note: Character Maps are placed as follows:
  100.       Map 0 at 0k, map 1 at 16k, map 2 at 32k and map 3 at 48k
  101.  
  102. 3C4h index  4  (W):  Sequencer: Memory Mode Register
  103. bit   0  Set if in an alphanumeric mode, clear in graphics modes.
  104.       1  Set if more than 64kbytes on the adapter.
  105.       2  Enables Odd/Even addressing mode if set. Odd/Even mode places all odd
  106.          bytes in plane 1&3, and all even bytes in plane 0&2.
  107.  
  108. 3CAh (W):  Graphics 2 Position
  109. bit 0-1  Select which bit planes should be controlled by Graphics Controller
  110.          #2. Always set to 1.
  111.  
  112. 3CCh (W):  Graphics 1 Position
  113. bit 0-1  Select which bit planes should be controlled by Graphics Controller
  114.          #1. Always set to 0.
  115.  
  116. 3CEh index  0  (W):  Graphics: Set/Reset Register
  117. bit   0  If in Write Mode 0 and bit 0 of 3CEh index 1 is set a write to
  118.          display memory will set all the bits in plane 0 of the byte to this
  119.          bit, if the corresponding bit is set in the Map Mask Register (3CEh
  120.          index 8).
  121.       1  Same for plane 1 and bit 1 of 3CEh index 1.
  122.       2  Same for plane 2 and bit 2 of 3CEh index 1.
  123.       3  Same for plane 3 and bit 3 of 3CEh index 1.
  124.  
  125. 3CEh index  1  (W):  Graphics: Enable Set/Reset Register
  126. bit   0  If set enables Set/reset of plane 0 in Write Mode 0.
  127.       1  Same for plane 1.
  128.       2  Same for plane 2.
  129.       3  Same for plane 3.
  130.  
  131. 3CEh index  2  (W):  Graphics: Color Compare Register
  132. bit 0-3  In Read Mode 1 each pixel at the address of the byte read is compared
  133.          to this color and the corresponding bit in the output set to 1 if
  134.          they match, 0 if not. The Color Don't Care Register (3CEh index 7)
  135.          can exclude bitplanes from the comparison.
  136.  
  137. 3CEh index  3  (W):  Graphics: Data Rotate
  138. bit 0-2  Number of positions to rotate data right before it is written to
  139.          display memory. Only active in Write Mode 0.
  140.     3-4  In Write Mode 2 this field controls the relation between the data
  141.          written from the CPU, the data latched from the previous read and the
  142.          data written to display memory:
  143.            0: CPU Data is written unmodified
  144.            1: CPU data is ANDed with the latched data
  145.            2: CPU data is ORed  with the latch data.
  146.            3: CPU data is XORed with the latched data.
  147.  
  148. 3CEh index  4  (W):  Graphics: Read Map Select Register
  149. bit 0-1  Number of the plane Read Mode 0 will read from.
  150.  
  151. 3CEh index  5  (W):  Graphics: Mode Register
  152. bit 0-1  Write Mode: Controls how data from the CPU is transformed before
  153.          being written to display memory:
  154.            0: Mode 0 works as a Read-Modify-Write operation.
  155.               First a read access loads the data latches of the EGA with the
  156.               value in video memory at the addressed location. Then a write
  157.               access will provide the destination address and the CPU data
  158.               byte. The data written is modified by the function code in the
  159.               Data Rotate register (3CEh index 3) as a function of the CPU
  160.               data and the latches, then data is rotated as specified by the
  161.               same register.
  162.            1: Mode 1 is used for video to video transfers.
  163.               A read access will load the data latches with the contents of
  164.               the addressed byte of video memory. A write access will write
  165.               the contents of the latches to the addressed byte. Thus a single
  166.               MOVSB instruction can copy all pixels in the source address byte
  167.               to the destination address.
  168.            2: Mode 2 writes a color to all pixels in the addressed byte of
  169.               video memory. Bit 0 of the CPU data is written to plane 0 et
  170.               cetera. Individual bits can be enabled or disabled through the
  171.               Bit Mask register (3CEh index 8).
  172.       2  Forces all outputs to a high impedance state if set.
  173.       3  Read Mode
  174.            0: Data is read from one of 4 bit planes depending on the Read Map
  175.               Select Register (3CEh index 4).
  176.            1: Data returned is a comparison between the 8 pixels occupying the
  177.               read byte and the color in the Color Compare Register (3CEh
  178.               index 2). A bit is set if the color of the corresponding pixel
  179.               matches the register.
  180.       4  Enables Odd/Even mode if set (See 3C4h index 4 bit 2).
  181.       5  Enables CGA style 4 color pixels using even/odd bit pairs if set.
  182.  
  183. 3CEh index  6  (W):  Graphics: Miscellaneous Register
  184. bit   0  Indicates Graphics Mode if set, Alphanumeric mode else.
  185.       1  Enables Odd/Even mode if set.
  186.     2-3  Memory Mapping:
  187.            0: use A000h-BFFFh
  188.            1: use A000h-AFFFh   EGA Graphics modes
  189.            2: use B000h-B7FFh   Monochrome modes
  190.            3: use B800h-BFFFh   CGA modes
  191.  
  192. 3CEh index  7  (W):  Graphics: Color Don't Care Register
  193. bit   0  Ignore bit plane 0 in Read mode 1 if clear.
  194.       1  Ignore bit plane 1 in Read mode 1 if clear.
  195.       2  Ignore bit plane 2 in Read mode 1 if clear.
  196.       3  Ignore bit plane 3 in Read mode 1 if clear.
  197.  
  198. 3CEh index  8  (W):  Graphics: Bit Mask Register
  199. bit 0-7  Each bit if set enables writing to the corresponding bit of a byte in
  200.          display memory.
  201.  
  202. 3d4h index  0  (W):  CRTC: Horizontal Total Register
  203. bit 0-7  Horizontal Total Character Clocks-2
  204.  
  205. 3d4h index  1  (W):  CRTC: Horizontal Display End Register
  206. bit 0-7  Number of Character Clocks Displayed -1
  207.  
  208. 3d4h index  2  (W):  CRTC: Start Horizontal Blanking Register
  209. bit 0-7  The count at which Horizontal Blanking starts
  210.  
  211. 3d4h index  3  (W):  CRTC: End Horizontal Blanking Register
  212. bit 0-4  Horizontal Blanking ends when the last 5 bits of the character
  213.          counter equals this field.
  214.     5-6  Number of character clocks to delay start of display after Horizontal
  215.          Total has been reached.
  216.  
  217. 3d4h index  4  (W):  CRTC: Start Horizontal Retrace Register
  218. bit 0-7  Horizontal Retrace starts when the Character Counter reaches this
  219.          value.
  220.  
  221. 3d4h index  5  (W):  CRTC: End Horizontal Retrace Register
  222. bit 0-4  Horizontal Retrace ends when the last 5 bits of the character counter
  223.          equals this value.
  224.     5-6  Number of character clocks to delay start of display after Horizontal
  225.          Retrace.
  226.       7  Provides Smooth Scrolling in Odd/Even mode. When set display starts
  227.          from an odd byte.
  228.  
  229. 3d4h index  6  (W):  CRTC: Vertical Total Register
  230. bit 0-7  Lower 8 bits of the Vertical Total. Bit 8 is found in 3d4h index 7
  231.          bit 0.
  232.  
  233. 3d4h index  7  (W):  CRTC: Overflow Register
  234. bit   0  Bit 8 of Vertical Total (3d4h index 6)
  235.       1  Bit 8 of Vertical Display End (3d4h index 12h)
  236.       2  Bit 8 of Vertical Retrace Start (3d4h index 10h)
  237.       3  Bit 8 of Start Vertical Blanking (3d4h index 15h)
  238.       4  Bit 8 of Line Compare Register (3d4h index 18h)
  239.  
  240. 3d4h index  8  (W):  CRTC: Preset Row Scan Register
  241. bit 0-4  Number of lines we have scrolled down in the first character row.
  242.          Provides Smooth Vertical Scrolling.
  243.  
  244. 3d4h index  9  (W):  CRTC: Maximum Scan Line Register
  245. bit 0-4  Number of scan lines in a character row -1. In graphics modes this is
  246.          the number of times (-1) the line is displayed before passing on to
  247.          the next line (0: normal, 1: double, 2: triple...).
  248.          This is independent of bit 7, except in CGA modes which seems to
  249.          require this field to be 1 and bit 7 to be set to work.
  250.  
  251. 3d4h index 0Ah (W):  CRTC: Cursor Start Register
  252. bit 0-4  First scanline of cursor within character.
  253.  
  254. 3d4h index 0Bh (W):  CRTC: Cursor End Register
  255. bit 0-4  Last scanline of cursor within character
  256.     5-6  Delay of cursor data in character clocks.
  257.  
  258. 3d4h index 0Ch (W):  CRTC: Start Address High Register
  259. bit 0-7  Upper 8 bits of the start address of the display buffer
  260.  
  261. 3d4h index 0Dh (W):  CRTC: Start Address Low Register
  262. bit 0-7  Lower 8 bits of the start address of the display buffer
  263.  
  264. 3d4h index 0Eh (W):  CRTC: Cursor Location High Register
  265. bit 0-7  Upper 8 bits of the address of the cursor
  266.  
  267. 3d4h index 0Fh (W):  CRTC: Cursor Location Low Register
  268. bit 0-7  Lower 8 bits of the address of the cursor
  269.  
  270. 3d4h index 10h (R):  CRTC: Light Pen High Register
  271. bit 0-7  Upper 8 bits of the address of the lightpen position.
  272.  
  273. 3d4h index 10h (W):  CRTC: Vertical Retrace Start Register
  274. bit 0-7  Lower 8 bits of Vertical Retrace Start. Vertical Retrace starts when
  275.          the line counter reaches this value. Bit 8 is found in 3d4h index 7
  276.          bit 2.
  277.  
  278. 3d4h index 11h (R):  CRTC: Light Pen Low Register
  279. bit 0-7  Lower 8 bits of the address of the lightpen position.
  280.  
  281. 3d4h index 11h (W):  CRTC: Vertical Retrace End Register
  282. bit 0-3  Vertical Retrace ends when the last 4 bits of the line counter equals
  283.          this value.
  284.       4  if clear Clears pending Vertical Interrupts.
  285.       5  Vertical Interrupts (IRQ 2) disabled if set. Can usually be left
  286.          disabled, but some systems (including PS/2) require it to be enabled.
  287.  
  288. 3d4h index 12h (W):  CRTC: Vertical Display End Register
  289. bit 0-7  Lower 8 bits of Vertical Display End. The display ends when the line
  290.          counter reaches this value. Bit 8 is found in 3d4h index 7 bit 1.
  291.  
  292. 3d4h index 13h (W):  CRTC: Offset register
  293. bit 0-7  Number of bytes in a scanline / K. Where K is 2 for byte mode, 4 for
  294.          word mode and 8 for Double Word mode.
  295.  
  296. 3d4h index 14h (W):  CRTC: Underline Location Register
  297. bit 0-4  Position of underline within Character cell.
  298.  
  299. 3d4h index 15h (W):  CRTC: Start Vertical Blank Register
  300. bit 0-7  Lower 8 bits of Vertical Blank Start. Vertical blanking starts when
  301.          the line counter reaches this value. Bit 8 is found in 3d4h index 7
  302.          bit 3.
  303.  
  304. 3d4h index 16h (W):  CRTC: End Vertical Blank Register
  305. bit 0-4  Vertical blanking stops when the lower 5 bits of the line counter
  306.          equals this field.
  307.  
  308. 3d4h index 17h (W):  CRTC: Mode Control Register
  309. bit   0  If clear use CGA compatible memory addressing system
  310.          by substituting character row scan counter bit 0 for address bit 13,
  311.          thus creating 2 banks for even and odd scan lines.
  312.       1  If clear use Hercules compatible memory addressing system by
  313.          substituting character row scan counter bit 1 for address bit 14,
  314.          thus creating 4 banks.
  315.       2  If set increase scan line counter only every second line.
  316.       3  If set increase memory address counter only every other character
  317.          clock.
  318.       4  If set disable the EGA output drivers.
  319.       5  When in Word Mode bit 15 is rotated to bit 0 if this bit is set else
  320.          bit 13 is rotated into bit 0.
  321.       6  If clear system is in word mode. Addresses are rotated 1 position up
  322.          bringing either bit 13 or 15 into bit 0.
  323.       7  Clearing this bit will reset the display system until the bit is set
  324.          again.
  325.  
  326. 3d4h index 18h (W):  CRTC: Line Compare Register
  327. bit 0-7  Lower 8 bits of the Line Compare. When the Line counter reaches this
  328.          value, the display address wraps to 0. Provides Split Screen
  329.          facilities. Bit 8 is found in 3d4h index 7 bit 4.
  330.  
  331. 3dAh (R):  Input Status #1 Register
  332. bit   0  Either Vertical or Horizontal Retrace active if set
  333.       1  Light Pen has triggered if set
  334.       2  Light Pen switch is open if set
  335.       3  Vertical Retrace in progress if set
  336.     4-5  Shows two of the 6 color outputs, depending on 3C0h index 12h.
  337.           Attr: Bit 4-5:   Out bit 4  Out bit 5
  338.                    0          Blue       Red
  339.                    1        I Blue       Green
  340.                    2        I Red      I Green
  341.  
  342. 3dAh (W):  Feature Control Register
  343. bit   0  Output to pin 21 of the Feature Connector.
  344.       1  Output to pin 20 of the Feature Connector.
  345.  
  346.