right|thumb|MOS 6569R3 (PAL version) on a C64 main board
The VIC-II (Video Interface Chip II), specifically known as the MOS Technology 6567/6566/8562/8564 (NTSC versions), 6569/8565/8566 (PAL), is the microchip tasked with generating Y/C video signals (combined to composite video in the RF modulator) and DRAM refresh signals in the Commodore 64 and Commodore 128 home computers.
Succeeding the original MOS Technology VIC used in the VIC-20, the VIC-II was one of the key custom chips in the Commodore 64 (the other being the MOS Technology 6581 sound chip).
Development history
The VIC-II chip was designed primarily by Albert Charpentier and Charles Winterble at MOS Technology, Inc. as a successor to the MOS Technology 6560 "VIC". The team at MOS Technology had previously failed to produce two graphics chips named MOS Technology 6562 for the Commodore TOI computer, and MOS Technology 6564 for the Color PET, due to memory speed constraints.
In order to construct the VIC-II, Charpentier and Winterble made a market survey of current home computers and video games, listing up the current features, and what features they wanted to have in the VIC-II. The idea of adding sprites came from the TI-99/4A computer and its TMS9918 graphics coprocessor. The idea to support collision detection came from the Mattel Intellivision. The Atari 800 was also mined for desired features, particularly bitmap mode, which was a desired goal of the MOS team as all of Commodore's principal home computer rivals had bitmap graphics while the VIC-20 only had redefinable characters. About 3/4 of the chip surface is used for the sprite functionality.
The chip was partly laid out using electronic design automation tools from Applicon (now a part of UGS Corp.), and partly laid out manually on vellum paper. The design was partly debugged by fabricating chips containing small subsets of the design, which could then be tested separately. This was easy since MOS Technology had both its research and development lab and semiconductor plant at the same location. The initial batch of test chips came out almost fully functional, with only one bad sprite. The chip was developed in 5 micrometer technology.
VIC-II features
- 16 KB address space for screen, character and sprite memory
- 320 × 200 pixels video resolution (160 × 200 in multi-color mode)
- 40 × 25 characters text resolution
- Three character display modes and two bitmap modes
- 16 colors
- Concurrent handling of 8 sprites per scanline, each of 24 × 21 pixels (12 × 21 multicolor)
- Raster interrupt (see details, below)
- Smooth scrolling
- Independent dynamic RAM refresh
- Bus mastering for a 6502-style system bus; CPU and VIC-II accessing the bus during alternating half-clock cycles (the VIC-II will halt the CPU when it needs extra cycles)
Technical details
thumb|right|250px|MOS 6567 VIC-II [[pinout.]]
Note that below register addresses are stated as seen by CPU in a C64. To yield the register numbers as usually given in data sheets (i. e. starting with 0), the leading "D0" should be omitted.
Programming
frame|right|Supratechnic, a [[type-in program published by COMPUTE!'s Gazette in November 1988, showcases the careful use of raster interrupts to display information outside of the standard screen borders (here: the upper and lower border).]]
The VIC-II is programmed by manipulating its 47 control registers (up from 16 in the VIC), memory mapped to the range – in the C64 address space. Of all these registers, 34 deal exclusively with sprite control (sprites being called MOBs, from "Movable Object Blocks", in the VIC-II documentation). Like its predecessor, the VIC-II handles light pen input, and with help from the C64's standard character ROM, provided the original PETSCII character set from 1977 on a similarly dimensioned display as the 40-column PET series.
By reloading the VIC-II's control registers via machine code hooked into the raster interrupt routine (the scanline interrupt), one can program the chip to generate significantly more than 8 concurrent sprites (a process known as sprite multiplexing), and generally give every program-defined slice of the screen different scrolling, resolution and color properties. The hardware limitation of 8 sprites per scanline can be increased further by letting the sprites flicker rapidly on and off. Mastery of the raster interrupt is essential in order to unleash the VIC-II's capabilities. Many demos and some later games would establish a fixed "lock-step" between the CPU and the VIC-II so that the VIC registers could be manipulated at exactly the right moment, but the reliance on raster interrupts to ensure proper synchronization could be reduced and their overhead minimized.
Character graphics
The C64 shipped with the PETSCII character set in a 4k ROM, but, like the VIC-20 before it, the actual data for the characters was read from memory at a specified location. This location is one of the VIC-II registers, which allowed programmers to construct their own characters sets by placing the appropriate data in memory; each character is an 8x8 grid, a byte representing 8 bits horizontally, so 8 bytes are required for a single character and thus the complete 256-character set uses a total of 2,048 bytes. Theoretically as many as eight character sets can be used if the entire 16k of video memory were filled. Color RAM is accessed as bits 8 to 11 of the video matrix; in the 64 and 128, it is located in I/O space at - and cannot be moved from that location. It contains the values for color 1 (color 3 in multicolor mode) of each character.
The character ROM is mapped into two of the VIC-II's four "windows", at - and -, although the CPU cannot see it there (the character ROM may be switched into - where it is visible to the CPU, but not the VIC-II). Thus graphics data or video buffers cannot be placed at - or - because the VIC-II will see the character ROM there instead. Because these areas of RAM could not be used by the VIC-II graphics chip, they were frequently used for music/sound effects (the SID chip). The C64 has the ability to have RAM and ROM at the same address in memory but the CPU would "see" one and the VIC-II chip would "see" the other.
In default high-resolution character mode, the foreground of each character may be set individually in the color RAM. In multicolor character mode, color 3 is limited to the first eight possible color values; the fourth bit is then used as a flag indicating if this character is to be displayed in high-resolution or multicolor, thus making it possible to mix both types on one screen.
The C64's team did not spend much time on mathematically computing the 16 color palette. Robert Yannes, who was involved with the development of the VIC-II, said: <blockquote>I'm afraid that not nearly as much effort went into the color selection as you think. Since we had total control over hue, saturation and luminance, we picked colors that we liked. In order to save space on the chip, though, many of the colors were simply the opposite side of the color wheel from ones that we picked. This allowed us to reuse the existing resistor values, rather than having a completely unique set for each color.</blockquote>
Early versions of the VIC-II used in PAL C64s have a different color palette than later revisions.
The full palette of sixteen colors is generated based on variations of YPbPr signals as shown below:
{| class="wikitable sortable"
! style="width: 135pt;"| Number — name || Y || Pb (rel.) || Pr (rel.)
|- style="color: white; background: ;"
|| 0 — black || 0 || 0 || 0
|- style="color: black; background: ;"
|| 1 — white || 1 || 0 || 0
|- style="color:white; background: ;"
|| 2 — red || 0.3125 || -0.3826834 || 0.9238795
|- style="color: white; background: ;"
|| 3 — cyan || 0.625 || 0.3826834 || -0.9238795
|- style="color: white; background: ;"
|| 4 — purple || 0.375 || 0.7071068 || 0.7071068
|- style="color: white; background: ;"
|| 5 — green || 0.5 || -0.7071068 || -0.7071068
|- style="color: white; background: ;"
|| 6 — blue || 0.25 || 1 || 0
|- style="color: black; background: ;"
|| 7 — yellow || 0.75 || -1 || 0
|- style="color: white; background: ;"
|| 8 — orange || 0.375 || -0.7071068 || 0.7071068
|- style="color: white; background: ;"
|| 9 — brown || 0.25 || -0.9238795 || 0.3826834
|- style="color: white; background: ;"
|| 10 — light red || 0.5 || -0.3826834 || 0.9238795
|- style="color: white; background: ;"
|| 11 — dark grey || 0.3125 || 0 || 0
|- style="color: white; background: ;"
|| 12 — medium grey || 0.46875 || 0 || 0
|- style="color: black; background: ;"
|| 13 — light green || 0.75 || -0.7071068 || -0.7071068
|- style="color: white; background: ;"
|| 14 — light blue || 0.46875 || 1 || 0
|- style="color: white; background: ;"
|| 15 — light grey || 0.625 || 0 || 0
|}
<!-- Format color contrast with Commodore colors:
While Y ≤ 0.625 => Use white text;
while Y > 0.625 => Use black text;
/* See Commodore 16/Commodore Plus/4 inside the color palette article or MOS Technology TED */
-->
The VIC-IIe
right|MOS 8566 VIC-IIe pinout
The 8564/8566 VIC-IIe in the Commodore 128 uses 48 pins rather than 40, as it produces more signals, among them the clock for the additional Zilog Z80 CPU of that computer. It also has two extra registers. One of the additional registers is for accessing the added numerical keypad and other extra keys of that computer; this function was added to the VIC merely because that proved to be the easiest place in the computer to add the necessary three extra output pins. The other extra register is for toggling between a 1 MHz and a 2 MHz system clock; at the higher speed the VIC-II's video output is merely displaying every second byte in the code as black hires bit-pattern on the screen, suggesting use of the C128's 80-column mode at that speed (via the 8563 VDC RGB chip). Rather unofficially, the two extra registers are also available in the C128's C64 mode, permitting some use of the extra keys, as well as double-speed-no-video execution of CPU-bound code (such as intensive numerical calculations) in self-made C64 programs. The extra registers are also one source of minor incompatibility between the C128's C64 mode and a real C64 - a few older C64 programs inadvertently wrote into the toggle bit, which would do nothing at all on a real C64, but would result in a messed-up display on a C128 in C64 mode.
The VIC-IIe has the little-known ability to create an additional set of colors by manipulating the registers in a specific way that puts the color signal out of phase with what other parts of the chip consider it to be in. This ability was demonstrated in the "Risen from Oblivion" demo. Unfortunately it does not work on all monitors - correct colors are confirmed on Commodore CRT monitors and their equivalents.
Using the specific behavior of the VIC-IIe's test bit, it is furthermore capable of producing a real interlace picture with a resolution of 320×400 (hires mode) and 160×400 (multicolor mode).
List of VIC-II versions
Commodore made many modifications to the VIC-II during its lifetime. Compute!'s Gazettes first issue, in July 1983, reported that there had already been eight since the Commodore 64's release in mid-1982.
- NTSC
- MOS Technology 6566 – designed for SRAM/non-muxed address lines (used in the MAX Machine)
- MOS Technology 6567 – Original NMOS version
- MOS Technology 8562 – HMOS-II version
- MOS Technology 8564 – VIC-II E C128 version
- PAL
- MOS Technology 6569 – (PAL-B, used in most PAL countries)
- MOS Technology 6572 – (PAL-N, used in southern South America only)
- MOS Technology 6573 – (PAL-M, used in Brazil only)
- MOS Technology 8565 – HMOS-II version for "C64E" motherboards
- MOS Technology 8566 – VIC-II E (PAL-B) C128 version
- MOS Technology 8569 – VIC-II E (PAL-N) C128 version
The earliest revision of the VIC-II was used in machines made during 1982 and early 1983; it had a ceramic shell for thermal reasons and generated 64 NTSC color clocks per line. These chips also did not output separated chroma and luminance signals. Later revisions had a lower cost plastic shell and 65 color clocks per line (for NTSC, 63 for PAL), as well as separated chroma and luminance, allowing for an early form of S-video. Several revisions were made chiefly in the interest of improving video output quality, which was poor on the early units, and eliminating a bug that would cause random pixels to appear on screen (a few early games intentionally exploited this for graphics effects that consequently did not work on later C64s). The 64 color clocks on the initial VIC-II was done with the intention of allowing NTSC artifact color in high resolution bitmap mode as the Atari 8-bit computers did, but that idea was quickly dropped.
Because it was necessary for cost reasons to switch to a plastic shell, overheating tended to be a problem with the VIC-II. This was for several reasons including the high density of the die relative to the process used, and its high internal speed (8 MHz). Commodore tried an impromptu solution for this by using the aluminum RF shield as a heat sink (on NTSC machines; PAL machines were sold in countries with less restrictive RF interference standards than the United States and so only used aluminized cardboard), however it was not entirely effective at preventing overheating and chip failure.
The 85xx VIC-II used in C64Cs was made with the more modern 3.5 μm HMOS process and requires only a single 5V power rail instead of the dual 12V and 5V rails of the 65xx VIC-II. These chips run significantly cooler and do not suffer from the overheating issues that affect the 65xx VIC-II.
Several revisions of 6569 exist: 6569R1 (usually gold plated), 6569R3, 6569R4 and 6569R5. The most common version of 8565 is 8565R2.
See also
- Video display controller
- Motorola 6847
- List of home computers by video hardware
References
-->
External links
- The MOS 6567/6569 video controller (VIC-II) and its application in the Commodore 64 - detailed hardware description of the VIC-II.
- Commodore VIC-II Color Analysis (Preview) - an attempt to provide accurate information as to the VIC-II color palette, by Philip Timmermann.
- Description of C64 graphics modes - simple explanations with example pictures of the common modes used for C64 graphics, including hacked and software-assisted modes.
- Real Interlace video modes using the VIC-IIe.
- VIC programming information on Codebase64.
- VIC-II die shots
- Accurately reproducing the Video Output of a Commodore C64 - VIC-II palette as seen on PAL and NTSC displays; calculation of pixel aspect ratios
