home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / graphdoc / cga.txt < prev    next >
Text File  |  1994-01-18  |  15KB  |  308 lines

  1. IBM Color Graphics Adapter (CGA)
  2.  
  3. The original CGA was built with discrete logic around an MC6845 display controller.
  4.  
  5. On the original CGA and some clones accessing the video memory during the
  6. active display time caused the display controller to miss some pixels (seen as
  7. "snow"), which is the reason many programs only accesses video memory during
  8. vertical or horizontal retrace. This is fixed in some clones and in EGA/VGA
  9. adapters.
  10.  
  11. Basic features:
  12.    80x25 text modes in 16colors
  13.    320x200 4color graphics modes
  14.    640x200 2 color graphics mode
  15.    TTL video interface (Red, Green, Blue and Intensity)
  16.    16KB Video RAM and 2KB ROM for 8x8 font.
  17.  
  18.  
  19. Clones:
  20. Commodore AGA:
  21.   Combines CGA, MDA, Hercules and Plantronics support in one chip.
  22. Chips & Tech 82c425:
  23.   Supports both CRT and LCD displays. Greyscale on LCD, supports two softfonts
  24.   (up to 8x16 pixels) allowing 512 characters on screen. No Snow.
  25. Chips & Tech 82c426:
  26.   Same as 82c425, but also supports Sleep mode, AT&T 400 line Graphics Mode,
  27.   Color LCDs and upto 32KB video memory.
  28.  
  29.  
  30. 3D4h (W): Index register.
  31.           The value written to this register selects which of the data
  32.           registers will be accessed at 3D5h.
  33.  
  34. 3D4h index 00h (W): Horizontal Total Register
  35. Bit 0-7  Number of characters (-1) in a scan line incl. retrace.
  36. Note: this register is Read/Write on the CT82c425/6.
  37.  
  38. 3D4h index 01h (W): Horizontal Displayed Register
  39. Bit 0-7  Number of characters (-1) displayed during a scan line.
  40. Note: this register is Read/Write on the CT82c425/6.
  41.  
  42. 3D4h index 02h (W): Horizontal Sync Position Register
  43. Bit 0-7  Number of characters displayed before Horizontal Sync pulse starts.
  44. Note: this register is Read/Write on the CT82c425/6.
  45.  
  46. 3D4h index 03h (W): Horizontal Sync Width Register
  47. Bit 0-7  Number of character clocks during a Horizontal Sync pulse.
  48. Note: this register is ignored on the CT82c425/6.
  49.  
  50. 3D4h index 04h (W): Vertical Total Register
  51. Bit 0-6  Number of character rows in a frame. This is adjusted by the number
  52.          of scanlines in a character (index 9) and the Vertical Adjust (index
  53.          5).
  54. Note: this register is Read/Write on the CT82c425/6.
  55.  
  56. 3D4h index 05h (W): Vertical Total Adjust Register
  57. Bit 0-3  Number of scanlines added to the Vertical Total time.
  58. Note: this register is Read/Write on the CT82c425/6.
  59.  
  60. 3D4h index 06h (W): Vertical Displayed Register
  61. Bit 0-6  Number of character rows displayed per frame.
  62. Note: this register is Read/Write on the CT82c425/6.
  63.  
  64. 3D4h index 07h (W): Vertical SyncPosition Register
  65. Bit 0-6  Number of character rows displayed before the Vertical Sync pulse
  66.          starts.
  67. Note: this register is Read/Write on the CT82c425/6.
  68.  
  69. 3D4h index 08h (W): Interlace Mode Register
  70. Note: this register is ignored on the CT82c425/6 and F8680.
  71.  
  72. 3D4h index 09h (W): Maximum Scan Line Register
  73. Bit 0-3  Number of scanlines (-1) in a character row.
  74. Note: this register is Read/Write on the CT82c425/6.
  75.  
  76. 3D4h index 0Ah (W): Cursor Start Register
  77. Bit 0-4  The scanline (starting from 0) within the character where the
  78.          cursor starts.
  79.     5-6  Cursor Attributes:
  80.            0,2: Cursor is blinking at the blink rate.
  81.              1: Cursor is turned off.
  82.              3: Cursor is blinking at half the blink rate.
  83.          The default blink rate is 1/16 of the frame rate (8 frames on, 8
  84.          off).
  85. Note: this register is Read/Write on the CT82c425/6.
  86.  
  87. 3D4h index 0Bh (W): Cursor End Register
  88. Bit 0-4  The scanline (starting from 0) within the character where the
  89.          cursor ends. If the start position (index 0Ah) is larger than this
  90.          value, no cursor is shown. 
  91. Note: this register is Read/Write on the CT82c425/6.
  92.  
  93. 3D4h index 0Ch (W): Start Address High Register
  94. Bit 0-5  The upper 6 bits of the address of the start of the display.
  95.          The lower 8 bits are in index 0Dh.
  96. Note: this register is Read/Write on the CT82c425/6.
  97.  
  98. 3D4h index 0Dh (W): Start Address Low Register
  99. Bit 0-7  The lower 8 bits of the address of the start of the display.
  100.          The upper 6 bits are in index 0Ch.
  101. Note: this register is Read/Write on the CT82c425/6.
  102.  
  103. 3D4h index 0Eh (W): Cursor Location High Register
  104. Bit 0-5  The upper 6 bits of the address of the start of the cursor.
  105.          The lower 8 bits are in index 0Fh.
  106. Note: this register is Read/Write on the CT82c425/6.
  107.  
  108. 3D4h index 0Fh (W): Cursor Location Low Register
  109. Bit 0-7  The lower 8 bits of the address of the start of the cursor.
  110.          The upper 6 bits are in index 0Eh.
  111. Note: this register is Read/Write on the CT82c425/6.
  112.  
  113. 3D4h index 10h (W): Light Pen High Register
  114. Bit 0-5  The upper 6 bits of the latched address of the lightpen strobe.
  115.          The lower 8 bits are in index 11h.
  116. Note: this register is Read/Write on the CT82c425/6.
  117.  
  118. 3D4h index 11h (W): Light Pen Low Register
  119. Bit 0-7  The lower 8 bits of the latched address of the lightpen strobe.
  120.          The upper 6 bits are in index 10h.
  121. Note: this register is Read/Write on the CT82c425/6.
  122.  
  123. 3D4h index D3h (R/W): Grey-level Control Register #1           (CT82c426 only)
  124. bit 0-7  GC10-17. Parameter for the Monochrome Alternate GrayScale algorithm.
  125.          Recommended value is 43h. Bit 3 should be 0.
  126.  
  127. 3D4h index D4h (R/W): Grey-level Control Register #2           (CT82c426 only)
  128. bit 0-7  GC20-27. Parameter for the Monochrome Alternate GrayScale algorithm.
  129.          Recommended value is E6h. Bits 3 and 7 should be 0.
  130.  
  131. 3D4h index D5h (R/W): General-Purpose Register                 (CT82c426 only)
  132. bit   0  General Purpose I/O bit 1. Data to/from the GPIO1 pin.
  133.       1  General Purpose I/O 1 Three State Control.
  134.          If set the GPIO1 pin is three-stated and can be used as an input.
  135.          If clear the pin is an output.
  136.       2  General Purpose I/O 1 Mux Control.
  137.          If set the GPIO1 pin is fed with the data in bit 0, if clear with the
  138.          Display Enable bit (3DAh bit 0).
  139.       4  General Purpose I/O bit 2. Data to/from the GPIO2 pin.
  140.       5  General Purpose I/O 2 Three State Control.
  141.          If set the GPIO2 pin is three-stated and can be used as an input.
  142.          If clear the pin is an output.
  143.       6  General Purpose I/O 2 Mux Control.
  144.          If set the GPIO2 pin is fed with the data in bit 4, if clear with the
  145.          ROMCS/ signal
  146.  
  147. 3D4h index D6h (R/W): Sleep Register                           (CT82c426 only)
  148. bit   0  Sleep Mode Software Enable. If a 1 is written to this bit, the 82c426
  149.          enters sleep mode when the current display fetch completes.
  150.          In sleep mode video memory can not be accessed and the SLEEP pin is
  151.          driven high. If a 0 is written normal operation resumes.
  152.       1  (R) Sleep Mode Output. Reflects the state of the SLEEP output pin.
  153.          1 if the 82c426 is in sleep mode or if the Video Enable bit is 0.
  154.  
  155. 3D4h index D7h (R/W): Panel Size Register                      (CT82c426 only)
  156. bit 0-7  Size of the upper panel (if a two panel system) in scanlines (-1).
  157.  
  158. 3D4h index D8h (R/W): Panel Configuration Register             (CT82c426 only)
  159. bit 0-2  LCD Mode. Panel type:
  160.            0: Single Panel, Single Drive
  161.            1: Dual-Panel, Single Drive
  162.            2: Dual-Panel, Dual Drive
  163.            3: Single Panel, 12bit color
  164.            4: Single Panel, 4bit color
  165.       3  Alternate FLM. If clear the FLM (First Line Marker) is generated as
  166.          in the 82c425: Rising before the LP of the first line and falling
  167.          after it. If set FLM rises when the last LP of the frame falls, and
  168.          falls with the falling edge of the first LP of the frame.
  169.       4  Scan-Doubling Enabled. If set and bit 5 is 0, the scanlines are
  170.          doubled.
  171.       5  AT&T Mode Enabled. If set the AT&T Mode register (3DEh) is enabled.
  172.          If clear the AT&T register is inaccessible.
  173.     6-7  Memory Configuration 0-1.
  174.            0:  3 8Kx8 SRAM or 2 8Kx8 SRAM and 1 8Kx8 ROM.
  175.            1:  1 32Kx8 SRAM
  176.            2:  1 16Kx8 SRAM and 1 8Kx8 SRAM/ROM
  177.            3:  1 32Kx8 SRAM and 1 8Kx8 SRAM/ROM
  178.  
  179. 3D4h index D9h (R/W): AC Control Register                    (CT82c425/6 only)
  180. Bit 0-4  The number of LCD Latch Pulses (-1) for which the AC signal is on
  181.          and off (50% duty cycle)
  182.       7  If set the programmable AC signal is enabled. If clear, the AC signal
  183.          remains ON for one frame and OFF for the next.
  184.  
  185. 3D4h index DAh (R/W): Threshold Register                     (CT82c425/6 only)
  186. Bit 0-3  Threshold Value. 
  187.       4  Saturation. If set the shifts in fore- and background colors by
  188.          SMARTMAP is limited to the saturation points, if clear the
  189.          colormapping will be modulo 16
  190.       5  Four Grey Scale Bit. If set 4 grey scales is selected, if clear 8
  191.          grey scales is selected for text modes.
  192.       6  (82c426 only) Alternate Graylevel Algorithm.
  193.  
  194. 3D4h index DBh (R/W): Shift Parameter Register               (CT82c425/6 only)
  195. Bit 0-3  Foreground Shift. The amount of shift for ForeGround colors in the
  196.          text grey scale scheme.
  197.     4-7  Background Shift.
  198.  
  199. 3D4h index DCh (R/W): Horizontal Sync Width Register         (CT82c425/6 only)
  200. Bit 0-7  Number of Dot clocks in the HSYNC pulse.
  201.  
  202. 3D4h index DDh (R/W): Vertical Sync Width Register           (CT82c425/6 only)
  203. Bit 0-3  Vertical Sync Width in scanlines (-1).
  204.     4-7  Blink rate of characters. The character will be on for (value+1)
  205.          frames and off for the same number of frames.
  206.          The cursor blink rate is twice the character blink rate.
  207.  
  208. 3D4h index DEh (R/W): Shift Parameter Register               (CT82c425/6 only)
  209. Bit 0-4  (82c425 only) ECLK. The number of output clock pulses (-1) per pulse
  210.          of the ENABLE CLOCK for the LCD panel
  211.     0-3  (82c426 only) (R) Silicon Revision.
  212.       5  CLK SEL.  0 selects the CLK1 input as the master clock source, 1
  213.          selects the CLK2 input.
  214.     6-7  CCLK DIV 0-1. Determines the panel shift clock (PCLK) and pixel
  215.          clock.
  216.           Value:   Pixel freq:    PCLK (LCD):
  217.             0        CLKIN         CLKIN/4
  218.             1        CLKIN/2       CLKIN/8
  219.             2        CLKIN/3       CLKIN/12
  220.             3        CLKIN/4       CLKIN/16
  221.  
  222. 3D4h index DFh (R/W): Function Control Register              (CT82c425/6 only)
  223. Bit   0  Decode Enable. If clear all accesses to the video memory and the 3Dxh
  224.          registers will be disabled, except for writes to this bit.
  225.          When set the memory and registers are accessible.
  226.       1  Font Enable. If set the font memory can be accessed at B8000h-B9FFFh.
  227.          If clear the font memory is inaccessible.
  228.       2  Font Select. If set the font at B9000h is selected, if clear the font
  229.          at B8000h is the default.
  230.       3  If set the CRT output is selected, if clear the LCD.
  231.       4  (LCD only) Status Control. Controls the behavior of the Display
  232.          Enable bit (3DAh bit 0) and Vertical Sync bit (3DAh bit 3).
  233.          If clear, the Display Enable bit toggles every 16 character clocks,
  234.          and the Vertical Sync bit is active during the first scanline.
  235.          If set the Display Enable bit is active during the first 16 character
  236.          clocks of each scanline, and from row 22 till the end of the panel in
  237.          text modes (row 85 in graphics modes). The Vertical Sync bit is
  238.          active through all scanlines of row 24 in textmodes (row 93 - 96 incl
  239.          in graphics modes).
  240.       5  (LCD only) Enable Control.
  241.       6  If set bit 3 of the attribute byte selects the font, rather than
  242.          intensity.
  243.       7  If set the video outputs are inverted.
  244.  
  245. 3D8h (W): Mode Control register
  246. bit   0  80x25 Alpha mode if set, 40x25 else
  247.       1  Graphics mode if set, alpha else.
  248.       2  BW mode if set, color else
  249.       3  Video Enable. Enable video signal if set
  250.       4  640x200 Graphics mode if set, 320x200 else
  251.       5  if set bit 7 of the attribute controls background, else blink
  252. Note: this register is Read/Write on the CT82c425/6.
  253.  
  254. 3D9h (W): Color Select register
  255.          The function of this register depends on the active mode. 
  256.          Text modes:      320x200 modes:         640x200 mode:
  257. Bit   0  Blue border      Blue background        Blue ForeGround
  258.       1  Green border     Green background       Green ForeGround
  259.       2  Red border       Red background         Red ForeGround
  260.       3  Bright border    Bright background      Bright ForeGround
  261.       4  Backgr. color    Alt. intens. colors    Alt. intens colors
  262.       5  No func.         Selects palette 
  263.            Palette 0 is Green, red and brown, 
  264.            palette 1 is Cyan, magenta and white.
  265. Note: this register is Read/Write on the CT82c425/6.
  266.  
  267. 3DAh (R): Status register 
  268. bit   0  Display Enable. If set Horizontal or Vertical Retrace is active and
  269.          the video memory may be accessed by the PC.
  270.       1  Lightpen trigger has occurred if set
  271.       2  Lightpen switch is off if set  
  272.       3  Vertical Sync. Vertical retrace active if set.
  273.          Video RAM can be accessed for the next 1.25 ms.
  274. Note: The CT82c425/6 modifies bits 0 and 3 for LCD panels. See 3D4h index DFh.
  275.  
  276. 3DBh (R/W) Clear Light Pen Strobe
  277. Reading or writing this register clears the lightpen strobe. This can happen
  278. before or after the lightpen position is read from 3D4h index 10h-11h.
  279.  
  280. 3DCh (R/W): Set Light Pen Strobe
  281. Reading or writing this register sets the lightpen strobe, causing the
  282. lightpen position to be latched to 3D4h index 10h-11h.
  283. The strobe must be cleared by accessing register 3DBh.
  284.  
  285. 3DEh (R/W): AT&T Mode Register                                 (CT82c426 only)
  286. bit   0  AT&T Mode. Only effective if 3D4h index D8h bit 5 is set.
  287.          If clear text modes are displayed as 16line characters and graphics
  288.          modes are displayed 200 line  scandoubled resolution.
  289.          If set text modes are displayed with 16line characters and graphics
  290.          modes are displayed as true 400 line modes.
  291.       3  Page Select. If set display memory is in the 16KB starting from
  292.          BC000h, if clear in the 16KB starting at B8000h. If there is less
  293.          than 32KB of video memory this has no effect.
  294.       6  Enable Underline. If set bit 0 of the attribute byte selects
  295.          underline (as in the MDA), if clear it selects blue ForeGround.
  296. Note: this register is only accessible if 3D4h index D8h bit 5 is set.
  297.  
  298.  
  299.   Video Modes:
  300.  
  301.   00h T   40  25  2   (8x8)
  302.   01h T   40  25  2   (8x8)
  303.   02h T   80  25  16  (8x8)
  304.   03h T   80  25  16  (8x8)
  305.   04h G  320 200  4
  306.   05h G  320 200  4
  307.   06h G  640 200  2
  308.