home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / v / vgalib12.tar / vgalib / support / vga.doc < prev    next >
Text File  |  1993-01-21  |  26KB  |  508 lines

  1.        3C0h:  Attribute Controller: Address register
  2.        bit 0-4  Address of data register to write to port 3C0h
  3.                 or read from port 3C1h (Reads only on VGA).
  4.              5  If set screen output is enabled and the palette can not be modified,
  5.                 if clear screen output is disabled and the palette can be modified.
  6.  
  7.  
  8.          Port 3C0h is special in that it is both address and data-write
  9.          register. Data reads happen from port 3C1h. An internal
  10.          flip-flop remembers whether it is currently acting as
  11.          address or data register.
  12.          Accesses to the attribute controller must be seperated by
  13.          at least 250ns.
  14.          Reading port 3dAh will reset the flip-flop to address mode.
  15.  
  16.  
  17.        3C0h index 0-Fh  (r/W): Attribute: Palette
  18.          bit 0  (EGA) Primary Blue
  19.              1  (EGA) Primary Green
  20.              2  (EGA) Primary Red
  21.              3  (EGA) Secondary Blue
  22.              4  (EGA) Secondary Green
  23.              5  (EGA) Secondary Red
  24.            0-5  (VGA) Index into the 256 color DAC table.
  25.                       May be modified by 3C0h index 10h and 14h.
  26.  
  27.        3C0h index 10h (r/W): Attribute: Mode Control Register
  28.          bit 0  Graphics mode if set, Alphanumeric mode else.
  29.              1  Monochrome mode if set, color mode else.
  30.              2  9-bit wide caharcters if set.
  31.                 The 9th bit of characters C0h-DFh will be the same as
  32.                 the 8th bit. Otherwise it will be the background color.
  33.              3  If set Attribute bit 7 is blinking, else high intensity.
  34.              5  (VGA Only) If set the PEL panning register (3C0h index 13h)
  35.                            is temporarily set to 0 from when the line
  36.                            compare causes a wrap around until the next
  37.                            vertical retrace when the register is automatically
  38.                            reloaded with the old value, else the PEL
  39.                            panning register ignores line compares.
  40.              6  (VGA Only) If set pixels are 8 bits wide.
  41.                            Used in 256 color modes.
  42.              7  (VGA Only) If set bit 4-5 of the index into the DAC table
  43.                            are taken from port 3C0h index 14h bit 0-1,
  44.                            else the bits in the palette register are used.
  45.  
  46.        3C0h index 11h (r/W): Attribute: Overscan Color Register.
  47.        bit 0-5  Color of screen border. Color is defined as in the
  48.                 palette regsiters.
  49.        Note: The EGA requires the Overscan color to be 0 in high resolution
  50.              modes.
  51.  
  52.        3C0h index 12h (r/W): Attribute: Color Plane Enable Register
  53.          bit 0  Bit plane 0 is enabled if set.
  54.              1  Bit plane 1 is enabled if set.
  55.              2  Bit plane 2 is enabled if set.
  56.              3  Bit plane 3 is enabled if set.
  57.            4-5  Video Status MUX. Diagnostics use only.
  58.                 Two attribute bits appear on bits 4 and 5 of the Input
  59.                 Status Register 1 (3dAh).
  60.                   Value       EGA            VGA
  61.                     0      Red/Blue        Bit 2/Bit 0
  62.                     1      Blue'/Green     Bit 5/Bit 4
  63.                     2      Red'/Green'     Bit 3/Bit 1
  64.                     3                      Bit 7/Bit 6
  65.  
  66.        3C0h index 13h (r/W): Attribute: Horizontal PEL Panning Register
  67.        bit 0-3  Indicates number of pixels to shift the display left
  68.                  Value  9bit textmode   256color mode   Other modes
  69.                     0          1               0              0
  70.                     1          2              n/a             1
  71.                     2          3               1              2
  72.                     3          4              n/a             3
  73.                     4          5               2              4
  74.                     5          6              n/a             5
  75.                     6          7               3              6
  76.                     7          8              n/a             7
  77.                     8          0              n/a            n/a
  78.  
  79.        3C0h index 14h (r/W): Attribute: Color Select Register  (VGA Only)
  80.        bit 0-1  If 3C0h index 10h bit 7 is set these 2 bits are used
  81.                 as bits 4-5 of the index into the DAC table.
  82.            2-3  These 2 bits are used as bit 6-7 of the index into the
  83.                 DAC table.
  84.  
  85.        Note: this register does not affect 256 color modes.
  86.  
  87.  
  88.        3C2h (R): Input Status #0 Register
  89.          bit 4  Status of the switch selected by the Miscellaneous Output
  90.                 Register 3C2h bit 2-3. Switch high if set.
  91.              5  (EGA Only) Pin 19 of the Feature Connector (FEAT0)
  92.                            is high if set
  93.              6  (EGA Only) Pin 17 of the Feature Connector (FEAT1)
  94.                            is high if set
  95.              7  (EGA Only ??) If set IRQ 2 has happened due to Vertical
  96.                       Retrace. Should be cleared by IRQ 2 interrupt routine
  97.                       by clearing port 3d4h index 11h bit 4.
  98.  
  99.  
  100.        3C2h (W): Miscellaneous Output Register
  101.          bit 0  If set Color Emulation. Base Address=3Dxh
  102.                 else Mono Emulation. Base Address=3Bxh.
  103.              1  Enable CPU Access to video memory if set
  104.            2-3  Clock Select
  105.                   0: 14MHz(EGA)     25MHz(VGA)
  106.                   1: 16MHz(EGA)     28MHz(VGA)
  107.                   2: External(EGA)  Reserved(VGA)
  108.              4  (EGA Only) Disable internal video drivers if set
  109.              5  When in Odd/Even modes Select High 64k bank if set
  110.              6  Horizontal Sync Polarity. Negative if set
  111.              7  Vertical Sync Polarity. Negative if set
  112.                 Bit 6-7 indicates the number of lines on the display:
  113.                          0=200(EGA)  Reserved(VGA)
  114.                          1=          400(VGA)
  115.                          2=350(EGA)  350(VGA)
  116.                          3=          480(VGA).
  117.  
  118.        Note: Set to all zero on a hardware reset.
  119.        Note: On the VGA this register can be read from port 3CCh.
  120.  
  121.  
  122.        3C3h (W): Video Subsystem Enable Register
  123.          bit 0  Enables the VGA display if set
  124.  
  125.  
  126.        3C4h index  0  (r/W): Sequencer: Reset
  127.          bit 0  (EGA) Asynchronous Reset if clear
  128.              0  (VGA) Synchronous Reset just as bit 1
  129.              1  Synchronous Reset if clear
  130.  
  131.        3C4h index  1  (r/W): Sequencer: Clocking Mode
  132.          bit 0  If set character clocks are 8 dots wide, else 9.
  133.              1  (EGA Only) If set the CRTC uses 2/5 of the clock cycles, else 4/5.
  134.              2  If set loads video serializers every other character
  135.                 clock cycle, else every one.
  136.              3  If set the Dot Clock is Master Clock/2, else same as
  137.                 Master Clock (See 3C2h bit 2-3). (Doubles pixels).
  138.              4  (VGA Only) If set loads video serializers every fourth
  139.                            character clock cycle, else every one.
  140.              5  (VGA Only) if set turns off screen and gives all memory
  141.                            cycles to the CPU interface.
  142.  
  143.        3C4h index  2  (r/W): Sequencer: Map Mask Register
  144.          bit 0  Enable writes to plane 0 if set
  145.              1  Enable writes to plane 1 if set
  146.              2  Enable writes to plane 2 if set
  147.              3  Enable writes to plane 3 if set
  148.  
  149.        3C4h index  3  (r/W): Sequencer: Character Map Select Register
  150.        bit 0-1  (EGA) Selects EGA Character Map (0..3) if bit 3 of
  151.                       the character attribute is clear.
  152.            2-3  (EGA) Selects EGA Character Map (0..3) if bit 3 of
  153.                       the character attribute is set.
  154.          0,1,4  (VGA) Selects VGA Character Map (0..7) if bit 3 of
  155.                       the character attribute is clear.
  156.          2,3,5  (VGA) Selects VGA Character Map (0..7) if bit 3 of
  157.                       the character attribute is set.
  158.  
  159.                   Character Maps are placed at:
  160.                    Map no. (EGA/VGA)       Map no. (VGA)
  161.                       0       0k              4      8k
  162.                       1      16k              5     24k
  163.                       2      32k              6     40k
  164.                       3      48k              7     56k
  165.  
  166.        3C4h index  4  (r/W): Sequencer: Memory Mode Register
  167.          bit 0  Set if in an alphanumeric mode, clear in graphics modes.
  168.              1  Set if more than 64kbytes on the adapter.
  169.              2  Enables Odd/Even addressing mode if set.
  170.                 Odd/Even mode places all odd bytes in plane 1&3, and
  171.                 all even bytes in plane 0&2.
  172.              3  (VGA Only)  If set address bit 0-1 selects video memory
  173.                             planes (256 color mode), rather than the
  174.                             Map Mask and Read Map Select Registers.
  175.  
  176.        3C6h (R/W): PEL Mask          (VGA Only)
  177.        bit 0-7  Reserved for internal use.
  178.                 Should always be set to FFh.
  179.  
  180.        3C7h (R): DAC State Register  (VGA Only)
  181.        bit 0-1  0 indicates the DAC is in Read Mode and 3 indicates
  182.                 write mode.
  183.  
  184.        3C7h (W): PEL Address Read Mode           (VGA Only)
  185.        bit 0-7  The PEL data register (0..255) to be read from 3C9h.
  186.  
  187.        Note:  After reading the 3 bytes at 3C9h this register will
  188.               increment, pointing to the next data register.
  189.  
  190.        3C8h (R/W): PEL Address Write Mode        (VGA Only)
  191.        bit 0-7  The PEL data register (0..255) to be written to 3C9h.
  192.        Note:  After writing the 3 bytes at 3C9h this register will
  193.               increment, pointing to the next data register.
  194.  
  195.        3C9h (R/W): PEL Data Register             (VGA Only)
  196.        bit 0-5  Color value
  197.        Note:  Each read or write of this register will cycle through first
  198.               the registers for Red, Blue and Green, then increment the 
  199.               appropriate address register, thus the entire palette can be
  200.               loaded by writing 0 to the PEL Address Write Mode register 3C8h
  201.               and then writing all 768 bytes of the palette to this register.
  202.  
  203.        3CAh (R): Feature Control Register           (VGA Only)
  204.          Bit 3  (VGA Only) Vertical Sync Select
  205.                    If set Vertical Sync to the monitor is the logical OR
  206.                    of the vertical sync and the vertical display enable.
  207.        Note: This register is written to port 3dAh and read from 3CAh.
  208.  
  209.  
  210.        3CAh (W): Graphics 2 Position                (EGA Only)
  211.        bit 0-1  Select which bit planes should be controlled by
  212.                 Graphics Controller #2. Always set to 1.
  213.  
  214.        3CCh (R): Miscellaneous Output Register      (VGA Only)
  215.          bit 0  If set Color Emulation. Base Address=3Dxh
  216.                    else Mono Emulation. Base Address=3Bxh.
  217.              1  Enable CPU Access to video memory if set
  218.            2-3  Clock Select
  219.                   0= 25MHz, 1= 28MHz, 2= Reserved
  220.              5  When in Odd/Even modes Select High 64k bank if set
  221.              6  Horizontal Sync Polarity. Negative if set
  222.              7  Vertical Sync Polarity. Negative if set
  223.                 Bit 6-7 indicates the number of lines on the display:
  224.                          0=Reserved, 1=400, 2=350, 3=480.
  225.  
  226.        Note: This register is written to port 3C2h and read from port 3CCh.
  227.  
  228.  
  229.        3CCh (W): Graphics 1 Position                (EGA Only)
  230.        bit 0-1  Select which bit planes should be controlled by
  231.                 Graphics Controller #1. Always set to 0.
  232.  
  233.        3CEh index  0  (r/W): Graphics: Set/Reset Register
  234.          bit 0  If in Write Mode 0 and bit 0 of 3CEh index 1 is set
  235.                  a write to display memory will set all the bits in
  236.                  plane 0 of the byte to this bit, if the corresponding
  237.                  bit is set in the Map Mask Register (3CEh index 8).
  238.              1  Same for plane 1 and bit 1 of 3CEh index 1.
  239.              2  Same for plane 2 and bit 2 of 3CEh index 1.
  240.              3  Same for plane 3 and bit 3 of 3CEh index 1.
  241.  
  242.        3CEh index  1  (r/W): Graphics: Enable Set/Reset Register
  243.          bit 0  If set enables Set/reset of plane 0 in Write Mode 0.
  244.              1  Same for plane 1.
  245.              2  Same for plane 2.
  246.              3  Same for plane 3.
  247.  
  248.        3CEh index  2  (r/W): Graphics: Color Compare Register
  249.        bit 0-3  In Read Mode 1 each pixel at the address of the byte read
  250.                 is compared to this color and the corresponding bit in
  251.                 the output set to 1 if they match, 0 if not.
  252.                 The Color Dont Care Register (3CEh index 7) can exclude
  253.                 bitplanes from the comparison.
  254.  
  255.        3CEh index  3  (r/W): Graphics: Data Rotate
  256.        bit 0-3  Number of positions to rotate data right before it is
  257.                 written to display memory.
  258.            4-5  In Write Mode 2 this field controls the relation between
  259.                 the data written from the CPU, the data latched from the
  260.                 previous read and the data written to display memory:
  261.                   0: CPU Data is written unmodified
  262.                   1: CPU data is ANDed with the latched data
  263.                   2: CPU data is ORed  with the latch data.
  264.                   3: CPU data is XORed with the latched data.
  265.  
  266.  
  267.        3CEh index  4  (r/W): Graphics: Read Map Select Register
  268.        bit 0-1  Number of the plane read Mode 0 will read from.
  269.  
  270.        3CEh index  5  (r/W): Graphics: Mode Register
  271.        bit 0-1  Write Mode: Controls how data from the CPU is
  272.                 transformed before being written to display memory:
  273.                   0: Mode 0 works as a Read-Modify-Write operation.
  274.                      First a read access loads the data latches of the EGA/VGA
  275.                      with the value in video memory at the addressed location. 
  276.                      Then a write access will provide the destination address 
  277.                      and the CPU data byte. The data written is modified by the
  278.                      function code in the Data Rotate register (3CEh index 3) as
  279.                      a function of the CPU data and the latches, then data
  280.                      is rotated as specified by the same register.  
  281.                   1: Mode 1 is used for video to video transfers.
  282.                      A read access will load the data latches with the contents
  283.                      of the addressed byte of video memory. A write access will
  284.                      write the contents of the latches to the addressed byte.
  285.                      Thus a single MOVSB instruction can copy all pixels in the
  286.                      source address byte to the destination address.
  287.                   2: Mode 2 writes a color to all pixels in the addressed byte
  288.                      of video memory. Bit 0 of the CPU data is written to plane 0
  289.                      etc. Individual bits can be enabled or disabled through the
  290.                      Bit Mask register (3CEh index 8). 
  291.                   3: (VGA Only) 
  292.              2  (EGA Only) Forces all outputs to a high impedance state if set.
  293.              3  Read Mode
  294.                   0: Data is read from one of 4 bit planes depending
  295.                      on the Read Map Select Register (3CEh index 4).
  296.                   1: Data returned is a comparison between the 8 pixels
  297.                      occupying the read byte and the color in the
  298.                      Color Compare Register (3CEh index 2).
  299.                      A bit is set if the color of the corresponding
  300.                      pixel matches the register.
  301.              4  Enables Odd/Even mode if set (See 3C4h index 4 bit 2).
  302.              5  Enables CGA style 4 color pixels using even/odd bit pairs
  303.                 if set.
  304.              6  (VGA Only) Enables 256 color mode if set.
  305.  
  306.        3CEh index  6  (r/W): Graphics: Miscellaneous Register
  307.          bit 0  Indicates Graphics Mode if set, Alphanumeric mode else.
  308.              1  Enables Odd/Even mode if set.
  309.            2-3  Memory Mapping:
  310.                   0: use A000h-BFFFh
  311.                   1: use A000h-AFFFh   EGA/VGA Graphics modes
  312.                   2: use B000h-B7FFh   Monochrome modes
  313.                   3: use B800h-BFFFh   CGA modes
  314.  
  315.        3CEh index  7  (r/W): Graphics: Color Dont Care Register
  316.          bit 0  Ignore bit plane 0 in Read mode 1 if clear.
  317.              1  Ignore bit plane 1 in Read mode 1 if clear.
  318.              2  Ignore bit plane 2 in Read mode 1 if clear.
  319.              3  Ignore bit plane 3 in Read mode 1 if clear.
  320.  
  321.        3CEh index  8  (r/W): Graphics: Bit Mask Register
  322.        bit 0-7  Each bit if set enables writing to the corresponding
  323.                 bit of a byte in display memory.
  324.  
  325.  
  326.        3d4h index  0  (r/W): CRTC: Horizontal Total Register
  327.        bit 0-7  (EGA) Horizontal Total Character Clocks-2
  328.            0-7  (VGA) Horizontal Total Character Clocks-5
  329.  
  330.        3d4h index  1  (r/W): CRTC: Horizontal Display End Register
  331.        bit 0-7  Number of Character Clocks Displayed -1
  332.  
  333.        3d4h index  2  (r/W): CRTC: Start Horizontal Blanking Register
  334.        bit 0-7  The count at which Horizontal Blanking starts
  335.  
  336.        3d4h index  3  (r/W): CRTC: End Horizontal Blanking Register
  337.        bit 0-4  Horizontal Blanking ends when the last 5 (6 for VGA)
  338.                 bits of the character counter equals this field.
  339.                 (VGA) The sixth bit is found in port 3d4h index 5 bit 7.
  340.            5-6  Number of character clocks to delay start of display
  341.                 after Horizontal Total has been reached.
  342.              7  (VGA Only) Access to Vertical Retrace registers if set
  343.  
  344.        3d4h index  4  (r/W): CRTC: Start Horizontal Retrace Register
  345.        bit 0-7  Horizontal Retrace starts when the Character Counter
  346.                 reaches this value.
  347.  
  348.        3d4h index  5  (r/W): CRTC: End Horizontal Retrace Register
  349.        bit 0-4  Horizontal Retrace ends when the last 5 bits of the
  350.                 character counter equals this value.
  351.            5-6  Number of character clocks to delay start of display
  352.                 after Horizontal Retrace.
  353.              7  (EGA) Provides Smooth Scrolling in Odd/Even mode.
  354.                       When set display starts from an odd byte.
  355.              7  (VGA) bit 5 of the End Horizontal Blanking count
  356.                       (See 3d4h index 3 bit 0-4).
  357.  
  358.        3d4h index  6  (r/W): CRTC: Vertical Total Register
  359.        bit 0-7  Lower 8 bits of the Vertical Total
  360.                 Bit 8 is found in 3d4h index 7 bit 0.
  361.                 (VGA) Bit 9 is found in 3d4h index 7 bit 5.
  362.        Note: For the VGA this value is the number of scan lines in the display -2.
  363.  
  364.        3d4h index  7  (r/W): CRTC: Overflow Register
  365.          bit 0  Bit 8 of Vertical Total (3d4h index 6)
  366.              1  Bit 8 of Vertical Display End (3d4h index 12h)
  367.              2  Bit 8 of Vertical Retrace Start (3d4h index 10h)
  368.              3  Bit 8 of Start Vertical Blanking (3d4h index 15h)
  369.              4  Bit 8 of Line Compare Register (3d4h index 18h)
  370.              5  (VGA) Bit 9 of Vertical Total (3d4h index 6)
  371.              6  (VGA) Bit 9 of Vertical Display End (3d4h index 12h)
  372.              7  (VGA) Bit 9 of Vertical Retrace Start (3d4h index 10h)
  373.  
  374.        3d4h index  8  (r/W): CRTC: Preset Row Scan Register
  375.        bit 0-4  Number of lines we have scrolled down in the first
  376.                 character row. Provides Smooth Vertical Scrolling.
  377.            5-6  (VGA Only) Number of bytes to skip at the start of
  378.                 scanline. Provides Smooth Horizontal Scrolling
  379.                 together with the Horizontal Panning Register
  380.                 (3C0h index 13h).
  381.  
  382.        3d4h index  9  (r/W): CRTC: Maximum Scan Line Register
  383.        bit 0-4  Number of scan lines in a character row -1
  384.              5  (VGA) Bit 9 of Start Vertical Blanking
  385.              6  (VGA) Bit 9 of Line Compare Register
  386.              7  (VGA) Doubles each scan line if set.
  387.                 I.e displays 200 lines on a 400 display.
  388.  
  389.        3d4h index  Ah (r/W): CRTC: Cursor Start Register
  390.        bit 0-4  First scanline of cursor within character.
  391.              5  (VGA) Turns Cursor off if set
  392.  
  393.        3d4h index  Bh (r/W): CRTC: Cursor End Register
  394.        bit 0-4  Last scanline of cursor within character
  395.            5-6  Delay of cursor data in character clocks.
  396.  
  397.        3d4h index  Ch (r/W): CRTC: Start Address High Register
  398.        bit 0-7  Upper 8 bits of the start address of the display buffer
  399.  
  400.        3d4h index  Dh (r/W): CRTC: Start Address Low Register
  401.        bit 0-7  Lower 8 bits of the start address of the display buffer
  402.  
  403.        3d4h index  Eh (r/W): CRTC: Cursor Location High Register
  404.        bit 0-7  Upper 8 bits of the address of the cursor
  405.  
  406.        3d4h index  Fh (r/W): CRTC: Cursor Location Low Register
  407.        bit 0-7  Lower 8 bits of the address of the cursor
  408.  
  409.        3d4h index 10h (R): CRTC: Light Pen High Register     (EGA Only)
  410.        bit 0-7  (EGA Only)  Upper 8 bits of the address of the
  411.                             lightpen position.
  412.  
  413.        3d4h index 10h (r/W): CRTC: Vertical Retrace Start Register
  414.        bit 0-7  Lower 8 bits of Vertical Retrace Start. Vertical Retrace
  415.                 starts when the line counter reaches this value.
  416.                 Bit 8 is found in 3d4h index 7 bit 2.
  417.                 (VGA Only) Bit 9 is found in 3d4h index 7 bit 7.
  418.  
  419.        3d4h index 11h (R): CRTC: Light Pen Low Register      (EGA Only)
  420.        bit 0-7  (EGA Only)  Lower 8 bits of the address of the
  421.                             lightpen position.
  422.  
  423.        3d4h index 11h (r/W): CRTC: Vertical Retrace End Register
  424.        bit 0-3  Vertical Retrace ends when the last 4 bits of the
  425.                 line counter equals this value.
  426.              4  if clear Clears pending Vertical Interrupts.
  427.              5  Vertical Interrupts (IRQ 2) disabled if set.
  428.                 Can usually be left disabled, but some systems
  429.                 (including PS/2) require it to be enabled.
  430.              6  (VGA Only) If set selects 5 refresh cycles per
  431.                            scanline rather than 3.
  432.              7  (VGA Only) Disables writing to registers 0-7 if set
  433.  
  434.        3d4h index 12h (r/W): CRTC: Vertical Display End Register
  435.        bit 0-7  Lower 8 bits of Vertical Display End. The display
  436.                 ends when the line counter reaches this value.
  437.                 Bit 8 is found in 3d4h index 7 bit 1.
  438.                 (VGA Only) Bit 9 is found in 3d4h index 6.
  439.  
  440.        3d4h index 13h (r/W): CRTC: Offset register
  441.        bit 0-7  Number of bytes in a scanline / K. Where K is 2 for
  442.                 byte mode, 4 for word mode and 8 for Double Word mode.
  443.  
  444.        3d4h index 14h (r/W): CRTC: Underline Location Register
  445.        bit 0-4  Position of underline within Character cell.
  446.              5  (VGA Only) If set memory address is only changed
  447.                            every fourth character clock.
  448.              6  (VGA Only) Double Word mode addressing if set
  449.  
  450.        3d4h index 15h (r/W): CRTC: Start Vertical Blank Register
  451.        bit 0-7  Lower 8 bits of Vertical Blank Start. Vertical blanking
  452.                 starts when the line counter reaches this value.
  453.                 Bit 8 is found in 3d4h index 7 bit 3.
  454.  
  455.        3d4h index 16h (r/W): CRTC: End Vertical Blank Register
  456.        bit 0-4  (EGA) Vertical blanking stops when the lower 5 bits
  457.                       of the line counter equals this field.
  458.            0-6  (VGA) Vertical blanking stops when the lower 7 bits
  459.                       of the line counter equals this field.
  460.  
  461.        3d4h index 17h (r/W): CRTC: Mode Control Register
  462.          bit 0  If clear use CGA compatible memory addressing system
  463.                 by swapping address bit 0 and 13.
  464.                 Creates 2 banks for even and odd scan lines.
  465.              1  If clear use Hercules compatible memory addressing
  466.                 system by swapping address bit 1 and 14.
  467.              2  If set increase scan line counter only every second line.
  468.              3  If set increase memory address counter only every other
  469.                 character clock.
  470.              4  (EGA Only) If set disable the EGA output drivers. This bit
  471.                 is used for other purposes in some Super VGA chips.
  472.              5  When in Word Mode bit 15 is rotated to bit 0 if this bit
  473.                 is set else bit 13 is rotated into bit 0.
  474.              6  If clear system is in word mode. Addresses are rotated
  475.                 1 position up bringing either bit 13 or 15 into bit 0.
  476.              7  Clearing this bit will reset the display system
  477.                 until the bit is set again.
  478.  
  479.        3d4h index 18h (r/W): CRTC: Line Compare Register
  480.        bit 0-7  Lower 8 bits of the Line Compare. When the Line counter
  481.                   reaches this value, the display address wraps to 0.
  482.                   Privides Split Screen facilities.
  483.                   Bit 8 is found in 3d4h index 7 bit 4.
  484.                   (VGA Only) Bit 9 is found in 3d4h index 9 bit 6.
  485.  
  486.  
  487.  
  488.        3dAh (R): Input Status #1 Register
  489.          bit 0  Either Vertical or Horizontal Retrace active if set
  490.              1  (EGA Only) Light Pen has triggered if set
  491.              2  (EGA Only) Light Pen switch is open if set
  492.              3  Vertical Retrace in progress if set
  493.            4-5  (EGA Only) Shows two of the 6 color outputs,
  494.                 depending on 3C0h index 12h bit 4-5:
  495.                    Attr: Bit 4-5:   Out bit 4  Out bit 5
  496.                             0          Blue       Red
  497.                             1        I Blue       Green
  498.                             2        I Red      I Green
  499.  
  500.        3dAh (W): Feature Control Register
  501.          bit 0  (EGA Only) Output to pin 21 of the Feature Connector.
  502.              1  (EGA Only) Output to pin 20 of the Feature Connector.
  503.              3  (VGA Only) Vertical Sync Select
  504.                    If set Vertical Sync to the monitor is the logical OR
  505.                    of the vertical sync and the vertical display enable.
  506.  
  507.        Note: On the VGA this register can be read from port 3CAh.
  508.