[comp.sys.apple] Apple Tech Note: The //gs Video Graphics Controller

ranger@ecsvax.UUCP (Rick N. Fincher) (12/17/86)

Apple IIGS: Video Generation Chip (VGC) The Video Generation Chip (VGC)
supports video output from the Mega II for both Apple II graphics and Super
Hi-res graphics, provides an interface to the Real Time Clock chip,
supports interrupt handling, and assists disk drive interfacing.   The VGC
accepts color information from the Mega II, modifies it according to the
current Control Panel selections, and puts out appropriate display
information for the NTSC composite video jack and the Video RBG port. The
VGC accesses text, background, and border information maintained in the
Text and Background Color Register and Border Color Register. 4-bit value
determines each of the three color areas, so that there are 16 possible
colors for each. These colors correspond to the 16 Apple II Lo-res colors.  
Apple II Graphics and Text   If Apple II text mode is used, the VGC removes
color information from the NTSC composite output signal, so that color
fringing does not occur on a color composite monitor. If a mixed
text/graphics mode is chosen, color fringing is unavoidable, since most
composite monitors do not have the ability to respond quickly enough to a
change in the chroma information. In this case, the bottom four lines of
text will show a color fringing anomaly.   The VGC polls the
Monochrome/Color Register to determine which type of video signal should
be output. If monochrome has been chosen, the VGC will output appropriate
dot patterns to represent the chosen colors, so that a monochrome
composite monitor will display gray-scale images. An AppleColor RGB
Monitor displaying double Hi-res graphics will also display gray-scale
images if monochrome is selected.   Super Hi-res Graphics   After the
selection of one of the new Apple IIGS Graphics modes, the VGC is
responsible for implementing the color mode. It uses memory in the
auxiliary 64K bank of Apple II RAM to implement Super Hi-res graphics. In
this display buffer, locations $2000-$9CFF are used for pixel information,
$9D00-$9DFF are pointers that determine the charactistics of each line,
and $9E00-$9FFF hold color pallette information.   For 640 or 320 graphics
modes, each pixel may be represented respectively by either 2 or 4 bits,
wherein the value is a number of a color in the appropriate color palette.
Each of the 200 pointers (one for each line) stores the display mode used,
the color palette associated with that line, and a flag of enabled or
disabled for scan line interrupts. Each of the 16 color palettes contains
information on 16 colors. Each of the colors takes two bytes: 4 bits each
for the value of red, green, and blue, which allows the three primary colors
can be combined in 4096 different ways.   Real Time Clock Interface   The
Video Generation Chip also works as an interface between the 65816
microprocessor and the Real Time Clock Chip (RTC). A Real Time Clock
register in the VGC is used as a command register for the RTC. The RTC
then maintains calendar and clock information within para

meter RAM.   VGC Interrupts   Two types of internal interrupts are handled
by the VGC: the One-Second interrupt generated by the Real Time Clock
Chip and the Scan-Line interrupt generated by scan line information in
Super Hi-res mode. The status and enable states of these interrupts are
found in the VGC Interrupt Register and the VGC Interrupt Clear Register.
The VGC also handles one external interrupt line.   VGC Disk Register   The
VGC Disk Register, used as a control register for the disk drive interface,
functions in choosing the head to use and the type of drive selected. Apple Technical Communications