MOS Technology VIC-II
The MOS Technology VIC-II (Video Interface Controller II) is a video display controller chip developed by MOS Technology, Inc., best known for powering the graphics in the Commodore 64 home computer released in 1982.[1] It supports a range of display modes, including 40×25 character text graphics with 8×8 pixel cells, high-resolution bitmap graphics at 320×200 pixels, and multicolor bitmap mode at 160×200 pixels, all using a fixed palette of 16 colors.[2] The chip also features eight movable hardware sprites, each 24×21 pixels and expandable in size, with capabilities for multicolor rendering, priority layering, and collision detection between sprites and the background or other sprites.[2] Additionally, it provides programmable raster interrupts for precise timing, light pen input support, and automatic DRAM refresh, addressing up to 16 KB of video memory including 1 KB of dedicated color RAM.[2] Designed primarily by engineer Albert Charpentier at MOS Technology's LSI Group, the VIC-II's development commenced in January 1981, achieving first-pass silicon by November of that year and prototypes by late December, enabling its unveiling at the January 1982 Winter Consumer Electronics Show alongside the Commodore 64.[1] Fabricated in 5-micrometer NMOS technology and operating at approximately 8 MHz, the chip evolved from the earlier MOS Technology 6560 VIC used in the VIC-20, with significant enhancements to sprite handling—allocating two-thirds of its die area to support the eight sprites—and overall graphical flexibility.[1][2] Variants include the 6567 for NTSC systems and the 6569 for PAL, along with later HMOS-II revisions like the 8562 and 8565 for improved efficiency in subsequent Commodore models such as the Commodore 128.[2] These features made the VIC-II a cornerstone of the Commodore 64's appeal, enabling sophisticated games, demos, and applications that leveraged its interrupt-driven timing for effects like smooth scrolling and flexible line interpretation.[2]Development and History
Origins and Design Goals
The MOS Technology VIC (6560/6561) chip, introduced in the Commodore VIC-20 home computer in 1980, represented an early effort to bring affordable color graphics to the consumer market but suffered from significant limitations in resolution and color handling. Its standard display offered a resolution of 176×184 pixels in high-resolution mode, with multicolor mode reducing horizontal resolution to effectively 88 pixels by halving the dot width per character cell, which constrained visual detail for games and applications. Color support was restricted to a 16-color palette, but with only three global colors available in multicolor mode (background, auxiliary, and two from color RAM), and upper palette colors limited to background and border uses, the chip often resulted in washed-out visuals on consumer televisions due to insufficient signal drive. These shortcomings positioned the VIC as inadequate for competing with higher-end systems like the Apple II's 280×192 resolution with six colors or Atari 8-bit computers' 320×192 monochrome resolution (with a 128-color palette available in multicolored modes at lower resolutions), prompting Commodore to seek a more capable successor amid the booming early 1980s home computer market.[3][1] Conception of the VIC-II chip began in late 1980 as part of Commodore's strategy to develop an inexpensive color computer system to challenge market leaders Atari and Apple II, with initial design work ramping up under MOS Technology in January 1981. The project originated from a broader initiative to create custom graphics and sound chips for what was initially envisioned as a video game console, but evolved into the Commodore 64 platform to deliver a full-featured home computer at a retail price around $595, emphasizing vertical integration of MOS chips to minimize costs. Key motivations included addressing the VIC's deficiencies by enabling richer visuals for gaming and productivity, while maintaining compatibility with the 6502-series CPU ecosystem that Commodore had pioneered.[1] Specific design goals for the VIC-II centered on achieving 16 fixed colors from a vibrant palette, a 320×200 pixel resolution in high-resolution mode (with multicolor halving to 160×200), and hardware support for eight movable sprites to facilitate smooth animations without taxing the CPU. Integration with the 6502 processor was prioritized through a simple memory-mapped register interface, allowing seamless access to video RAM within a 16 KB address space, all while targeting a production cost under $10 per chip to keep the overall system bill of materials around $130. These objectives aimed to balance performance and affordability, enabling features like bitmap graphics and character modes that surpassed contemporaries without requiring expensive external components.[1] Early prototypes encountered substantial challenges, including an initial video chip design that failed to meet timing and performance specifications due to synchronization issues, necessitating revisions such as the addition of a phase-locked loop for stable color generation. Prior efforts, like the MOS 6562 graphics chip developed for Commodore's canceled TOI (The Other Intellect) computer project in 1979, had also faltered owing to stringent memory timing requirements that demanded costly high-speed SRAM, rendering it unviable for mass production and influencing the VIC-II's more pragmatic architecture. These setbacks delayed first silicon to November 1981 but ultimately refined the chip into a reliable, low-cost solution.[1]Key Contributors and Timeline
The development of the MOS Technology VIC-II was led by key engineers at MOS Technology, Inc., a subsidiary of Commodore International. Albert Charpentier served as the primary logic designer, drawing on his prior experience leading the LSI Group at MOS and designing the original MOS Technology 6560 VIC chip used in the VIC-20 computer.[1][4] Charles Winterble, often credited as Charlie Winterble, handled chip layout and managed the engineering team, building on his role in earlier MOS projects including prototypes for the VIC-20.[5][6] Their collaboration was part of a secretive effort to create advanced custom chips for Commodore's next-generation home computer. Design work on the VIC-II began in late 1980, with full development ramping up by early 1981 under Charpentier and Winterble's direction.[7] The team conducted a market survey of contemporary home computers and video games to inform features, finalizing the architecture amid constraints of MOS's in-house fabrication capabilities. Tape-out occurred in early 1981 using a 5-micron NMOS process, which presented initial fabrication challenges due to yield issues and timing sensitivities inherited from prior chip iterations.[1][8] Key milestones included overcoming these process hurdles through iterative testing phases in late 1981, with first silicon arriving in November 1981 for validation of video timing and color generation stability. The VIC-II design was completed by November 1981, enabling integration into the Commodore 64 prototype.[1][5] The chip debuted in the Commodore 64, released in August 1982, marking a significant upgrade over the original VIC in terms of graphical capabilities while maintaining compatibility goals from the project's origins. Subsequent revisions supported PAL and NTSC variants for international markets.[1][4]Core Features
Display and Resolution Capabilities
The MOS Technology VIC-II video controller supports a standard display resolution of 320 × 200 pixels in high-resolution bitmap mode and 160 × 200 pixels in multicolor bitmap mode, derived from its 40 × 25 character matrix where each character occupies an 8 × 8 pixel cell.[9] In text mode, the visible area typically spans 40 columns by 24 or 25 rows, adjustable via control registers to enable features like smooth scrolling, which reduces the effective display to 38 columns by 24 rows.[9] These resolutions are constrained by the chip's fixed raster timing, with the total horizontal pixel width extending to approximately 418 pixels in NTSC variants (including borders and overscan areas) and 403 pixels in PAL variants.[10] The VIC-II operates at a vertical refresh rate of 60 Hz for NTSC systems and 50 Hz for PAL systems, synchronized to the host system's clock frequency of 1.023 MHz (NTSC) or 0.985 MHz (PAL) for the CPU, with the video dot clock running at roughly 8.18 MHz (NTSC) or 7.89 MHz (PAL).[9][11] This timing ensures compatibility with standard television standards, where NTSC supports up to 262 total raster lines (with 234 visible) and PAL up to 312 lines (with 284 visible).[10] Output from the VIC-II is provided as separate luminance (including sync) and chrominance signals, which are combined externally to produce composite video suitable for direct connection to a television or monitor.[9] In typical Commodore 64 implementations, these signals feed into an RF modulator for channel 3 or 4 TV broadcasting, enabling RF output over coaxial cable, though the modulator introduces some signal degradation compared to direct composite.[9] The chip's border, controlled by register $D020, surrounds the active display area and can extend into overscan regions, with the full horizontal extent including left/right borders of 24–31 pixels each in standard configurations.[10] Hardware constraints include a fixed 40-column text mode limit, 8 × 8 pixel character blocks, and a 16-color palette comprising primary colors (black, white, red, cyan, purple, green, blue, yellow) with four luminance levels for each of the four basic hues, plus additional mixes for a total of 16 distinct shades.[9] These limits define the VIC-II's output fidelity, prioritizing compatibility with 1980s consumer televisions while supporting sprite integration for dynamic overlays within the same resolution bounds.[9]Graphics Modes and Primitives
The MOS Technology VIC-II supports five primary graphics modes, selected via the ECM (Extended Color Mode), BMM (Bitmap Mode), and MCM (Multi-Color Mode) bits in the control register at address $D011. These modes enable a range of display options, from character-based text rendering to pixel-level bitmap graphics, all within a standard resolution of 320×200 pixels for high-resolution output or 160×200 pixels in multicolor configurations.[10][12] In standard text mode (ECM/BMM/MCM = 0/0/0), the screen displays 40×25 characters, each drawn from an 8×8 pixel font stored in character memory, using a single foreground color per character against a global background. Multicolor text mode (0/0/1) divides each character into 4×8 pixel blocks, allowing up to four colors per character for more vibrant displays. Extended color text mode (1/0/0) expands the character set to 64 unique glyphs and assigns four background colors directly to each character via attribute bits, enhancing flexibility without altering resolution. Standard bitmap mode (0/1/0) treats the screen as an 8×8 pixel grid across 40×25 blocks, enabling direct pixel manipulation with colors derived from the video matrix. Multicolor bitmap mode (0/1/1) halves the horizontal resolution to 160×200 pixels but permits four colors per 4×8 pixel block, facilitating filled graphics with reduced detail. Combinations like extended color with bitmap (1/1/0 or 1/1/1) result in invalid black-screen states.[10] The VIC-II's hardware primitives center on eight independent sprites, each 24×21 pixels in standard size (or 12×21 in multicolor), positionable anywhere on the screen with individual X/Y coordinates. Sprites support expansion to double width and/or height for larger 48×42 pixel objects, multicolor operation with four hues, and priority layering over background graphics. Additional primitives include light pen support, which latches the raster position upon detecting a light pulse via dedicated input pins, enabling interactive pointing at 320×200 resolution. Basic line drawing and other vector primitives rely on software algorithms, as the chip lacks dedicated hardware for such operations beyond sprite and mode-based rendering.[10][12] Screen memory organization allows flexible banking within the VIC-II's 16 KB address space, divided into four selectable 16 KB banks controlled by the CIA #2 chip's port A bits. The default configuration maps screen (video matrix) memory to addresses $0400–$07FF (1 KB for 40×25 characters), with character memory (2 KB) at $1000–$17FF or bitmap data (8 KB) at $2400–$3BFF, respectively; these can be repositioned via register $D018 (screen base in 1 KB increments, character base in 2 KB increments). Sprite pointers and data occupy 64-byte blocks, adjustable in 64-byte steps. This banking facilitates efficient memory sharing with the CPU while supporting up to 64,000 pixels per frame in full 320×200 high-resolution mode.[10] Performance is constrained by the VIC-II's cycle-stealing mechanism, where "badlines"—occurring every eighth raster line within the visible area (lines $30–$F7 when display enable is set)—halt the CPU for 40–43 cycles to fetch character pointers, ensuring synchronization for graphics updates. This results in a maximum of approximately 64,000 visible pixels per frame, though effective throughput depends on mode and sprite activity. Color application across modes draws from a 16-color palette, with backgrounds and attributes influencing rendering in text and bitmap variants.[10][12]Technical Architecture
Memory Organization and Mapping
The MOS Technology VIC-II graphics chip accesses a 16 KB address window within the system's memory, determined by 14 address lines (A0–A13), allowing it to interface with up to 64 KB of total RAM through bank selection mechanisms. In the Commodore 64 implementation, this window is configurable into one of four 16 KB banks ($0000–$3FFF, $4000–$7FFF, $8000–BFFF, or C000–FFFF) via bits in the CIA #2 port A register at DD00, enabling flexible mapping of graphics data without altering the CPU's full 64 KB view.[13][10] Screen memory, also known as the video matrix, occupies 1 KB (1,000 bytes) and stores character codes or pointers for display generation, typically located at $0400 in the default configuration but adjustable in 1 KB increments via the VIC-II's memory control register at D018. Associated color [RAM](/page/Ram), a dedicated 1 [KB](/page/KB) region at fixed address D800–DBFF, provides 4-bit color values for each screen position, accessed in [parallel](/page/Parallel) with screen [memory](/page/Memory) fetches to support per-[character](/page/Character) coloring in text and extended color modes. The [character](/page/Character) generator ROM, holding 8x8 [pixel](/page/Pixel) definitions for up to 256 characters (2 [KB](/page/KB) total), resides at $1000–$1FFF by default, configurable in 2 [KB](/page/KB) steps via D018, and is fetched row-by-row during raster scans.[10][13] In bitmap mode, the VIC-II utilizes an 8 KB region for pixel data, defaulting to $2000–$3FFF and adjustable in 8 KB steps via D018, with the 8 KB holding data for 200 pixel rows (40 bytes per row for 320 pixels), organized into 25 groups of 8 rows each corresponding to the character matrix positions. Memory access occurs primarily during the first phase of the system clock (φ2 low), granting the VIC-II priority over the CPU, which operates in the second phase; however, conflicts arise on "badlines"—every eighth raster line within the display area (lines $30–F7 when display enable is active)—where the VIC-II requires 40–63 consecutive cycles to fetch character pointers, stalling the CPU via the BA (bus available) line to ensure timely screen refresh. Sprite pointers, briefly, are stored within the upper portion of screen memory ($3F8–$3FF) to define sprite data locations.[10][13]Register Interface and Programming
The VIC-II provides a memory-mapped register interface for controlling its operations, with 47 registers accessible at addresses D000 through D02E in the Commodore 64's I/O space. These registers are mirrored every 64 bytes across the range D000 to D3FF, allowing flexible access but requiring programmers to account for the duplication to avoid unintended overwrites.[13][10] Key registers include D011, which controls the low 8 bits of the raster line comparison (shared with control bits), display enable (DEN, bit 4), bitmap mode (BMM, bit 5), extended color mode (ECM, bit 6), row select (RSEL, bit 3), and vertical scrolling (YSCROLL, bits 2-0); D016, which handles horizontal scrolling (bits 2-0), column select for extended resolution (CSEL, bit 3), and multicolor mode (MCM, bit 4); and $D018, which sets the base addresses for video memory (VM bits 7-4, multiples of $400) and character memory (CB bits 3-1, multiples of $800).[13][10] These registers enable core functions such as display control and memory mapping, with reads from them also providing status information like light pen coordinates or interrupt flags. Initialization typically begins by configuring D018 to point to the desired screen memory location, such as POKE 53272,17 to set the video [matrix](/page/Matrix) at $0400 and [character](/page/Character) memory at $2000 (in decimal equivalents for [BASIC](/page/Basic)). Display is then enabled by setting the DEN bit in D011 (e.g., POKE 53265, 23 for standard text mode with scrolling disabled). A basic raster synchronization loop can be implemented in assembly using LDA D012 to read the current raster line and STA D012 to set the interrupt line, ensuring timing alignment with the VIC-II's 63 cycles per line.[10] Programming the VIC-II involves direct register writes via 6502 assembly instructions like LDA #$1B; STA D011 for mode setup, or [BASIC](/page/BASIC) POKE statements such as POKE 53248, 0 to zero a [sprite](/page/Sprite) pointer. For precise timing, [interrupt request](/page/Interrupt_request) (IRQ) handling is essential: enable raster interrupts by setting bit 0 in D01A, configure the line in D012, and service the IRQ routine by checking and clearing bit 0 in D019 (write 1 to acknowledge). This allows synchronization with the electron beam for effects like mode switching without visual glitches.[10] Common pitfalls include overlooking register mirroring, which can lead to redundant writes if code assumes unique addresses, and failing to synchronize CPU operations with the VIC-II's clock, as the chip steals cycles during bad lines (when the raster reaches the configured row in D011), potentially stalling the 6502 and causing timing errors in interrupt-driven code. Programmers must also ensure that writes to D018 occur during blanking periods to prevent screen corruption from memory pointer changes.[10]| Register | Address | Key Functions |
|---|---|---|
| $D011 | 53265 | Raster line (low 8 bits, shared), DEN (display enable, bit 4), vertical scroll (bits 2-0) |
| $D016 | 53270 | Horizontal scroll (bits 2-0), CSEL (extended columns, bit 3), MCM (multicolor, bit 4) |
| $D018 | 53272 | Video memory base (VM), character memory base (CB) |
Color Palette and Generation
The MOS Technology VIC-II features a fixed 16-color palette, defined by 4-bit color codes ranging from 0 to 15, with each code corresponding to a specific hardware-generated color. These include black (0), white (1), red (2), cyan (3), purple (4), green (5), blue (6), yellow (7), orange (8), brown (9), light red (A), dark grey (B), medium grey (C), light green (D), light blue (E), and light grey (F). The palette is generated on-chip using luminance (Y) and chrominance (U/V) components derived from a color subcarrier clock—3.579545 MHz for NTSC variants (e.g., 6567) and 4.433619 MHz for PAL variants (e.g., 6569)—to produce composite video signals compatible with analog television standards. RGB approximations of these colors vary between NTSC and PAL due to differences in color encoding (YIQ for NTSC vs. YUV for PAL), resulting in hue shifts and intensity variations; for example, PAL red approximates to RGB(104, 55, 43), while NTSC red is typically brighter and more saturated, approximating RGB(142, 72, 0).[13][14][15] Color selection for display elements is managed through a dedicated 1 KB color RAM located at memory addresses D800–DBFF, consisting of 1024 bytes where the lower 4 bits (nibble) of each byte specify the primary color for the corresponding screen position, enabling per-character or per-block coloring in graphics modes. In multicolor modes (enabled via bit 4 of register D016, MCM, for both character and bitmap modes when bitmap mode is active), the color RAM byte provides two 4-bit values: the lower nibble selects one additional color (MC0, for 2-bit code 01), and the upper nibble selects another (MC1, for 2-bit code 10), combined with background color 0 (D021) for code 00 and an extra color ($D025) for code 11, allowing up to four colors per 4×8 pixel block at reduced 160×200 resolution. This setup supports multicolor character (MC00–MC03) and bitmap modes by interpreting 2-bit pairs from the bitmap data to index into these colors, with the color RAM ensuring independent foreground and background assignments per cell.[16][13][10] Color generation involves priority-based compositing for overlays, where the border and background colors (D020 for border, D021–D024 for up to four backgrounds) set baseline luminance levels, and sprite (multicolor intermediate bitmap, or MIB) colors (D027–D02E) are blended according to programmable priorities. Sprites can be placed behind the background (via bit 6 of D01B) or in front, with fixed inter-sprite priority (sprite 0 highest, sprite 7 lowest); when overlapping, the higher-priority sprite's color replaces lower ones without additive blending, though transparency bits in sprite data allow underlying layers to show through. Luminance is controlled globally via the border register, which extends beyond the active display area and influences overall video levels, while the VIC-II's internal DAC mixes luma (from 0–32 discrete levels in later revisions) with chroma phases at fixed 16 angles on the color wheel for hue. In character and bitmap modes, these colors are applied by fetching from color RAM during raster scans, with multicolor enabling smoother gradients through the four-color blocks.[13][10][14] The VIC-II's color system has notable limitations, including the absence of a true grayscale ramp, as the three grey shades (B, C, F) are fixed luminance steps without adjustable hue or saturation, relying instead on the palette's discrete luma values (e.g., 0 for black, 32 for white in 8-level implementations). Additionally, composite video output suffers from color bleeding, where adjacent chroma signals interfere due to the low-resolution YUV encoding and lack of separate luma/chroma filtering, causing hues to smear across high-contrast edges—particularly evident in NTSC due to its narrower bandwidth compared to PAL. These constraints stem from the chip's cost-optimized design, prioritizing compatibility with 1980s television standards over modern RGB precision.[14][15][13]| Color Code | Name | PAL RGB Approx. | NTSC RGB Approx. (Example) |
|---|---|---|---|
| 0 | Black | (0, 0, 0) | (0, 0, 0) |
| 1 | White | (255, 255, 255) | (255, 255, 255) |
| 2 | Red | (104, 55, 43) | (142, 72, 0) |
| 3 | Cyan | (112, 164, 178) | (0, 212, 176) |
| ... | ... | ... | ... |
| 15 | Light Grey | (189, 189, 189) | (208, 208, 208) |
Graphics Functionality
Character and Bitmap Modes
The MOS Technology VIC-II supports two primary background graphics modes: character mode for text-based displays and bitmap mode for pixel-addressable graphics. In character mode, the display is organized as a 40-column by 25-row grid, where each cell renders an 8x8 pixel character selected from a 256-entry character set stored in a 2,048-byte ROM or RAM generator.[13] The video matrix, a 1,000-byte area in screen memory, holds 8-bit pointers to these characters, with each pointer determining the 8 bytes of pixel data fetched from the character generator base address.[2] This mode enables efficient text rendering, with the character set including predefined variants for attributes such as reverse video (achieved by selecting codes 128–255, which invert pixel patterns relative to codes 0–127) and underline (implemented via dedicated characters like the full-width underline glyph).[10] Color in standard character mode uses a single foreground color per character, selected from 16 palette entries via the low 4 bits of the corresponding color RAM location (D800–DBFF), while the background color is global from register D021.[13] Enabling multicolor character mode (via bit 4 of register D016) divides each 8x8 character into four 4x8 pixel blocks, allowing up to four colors per character: the global background from D021, two additional backgrounds from D022 and D023, and a fourth color from the low 3 bits of color [RAM](/page/Ram) (colors 0–7), with bit 3 of color [RAM](/page/Ram) set to enable multicolor for that position.[2][16] This expands visual expressiveness for text, such as in games or interfaces, while maintaining the 320x200 effective resolution. The character generator base is configurable in 2,048-byte increments via bits 1–3 of register D018, and the video matrix base in 1,024-byte steps via bits 4–7 of the same register.[13] Bitmap mode provides direct pixel control, rendering a 320x200 monochrome display (1 bit per pixel) or a 160x200 multicolor variant (2 bits per pixel, four colors).[2] Pixel data is packed 8 bits per byte across an 8,192-byte bitmap area, with the video matrix repurposed to supply color information for each 8x8 block: in monochrome, the low 4 bits set the foreground color (for set pixels), with the global background from D021 for clear pixels, and the high 4 bits unused; in multicolor (bit 4 of D016), 2-bit pairs map to the global background (D021), auxiliary backgrounds (D022–$D023), and video matrix color bits.[13][16] The VIC-II fetches bitmap bytes sequentially, using a row counter (0–7) to select the vertical offset within each block and the video counter (derived from the 40x25 matrix position) for horizontal progression.[10] Switching between character and bitmap modes is controlled by bit 5 of register D011 (BMM): cleared for character mode (default) and set for bitmap mode, which overrides character fetches with direct bitmap data starting from the eighth raster line of each text row.[13] The bitmap base address is derived from the character base bit 3 (CB13 in D018, shifting in 8,192-byte steps) combined with video matrix counter bits and the row counter, effectively positioning the 8K bitmap relative to screen memory.[2] For example, in a typical configuration with the video matrix at $0400 and character base at $1000 (CB13=0), the bitmap base aligns at $2000, calculated as the video base offset integrated into the fetch addressing ($2000 = base + offset derived from VM10 set in D018).[10] Scrolling can be applied to both modes via horizontal and vertical shift registers (D011 bits 0–2 and $D016 bits 0–2), adjusting the display window without altering base addresses.[13]Sprite System
The MOS Technology VIC-II graphics chip includes hardware support for eight movable object blocks, commonly known as sprites, which enable dynamic foreground elements independent of the background display. These sprites are particularly useful for applications requiring real-time animation, such as game characters or cursors, and are fetched directly from system memory by the VIC-II via direct memory access (DMA).[16] Each sprite measures 24 pixels wide by 21 pixels high in high-resolution (hi-res) mode, where each pixel is represented by a single bit, allowing for two colors: the sprite's assigned color or transparent. In multicolor mode, the width effectively halves to 12 pixels, enabling up to four colors per sprite by interpreting pairs of bits. The data for one sprite occupies 63 bytes in memory, consisting of three bytes per scanline across 21 lines (with each byte controlling eight pixels), typically aligned to 64-byte boundaries for convenience. Sprite pointers, located at the end of the screen memory area (offsets $3F8–$3FF relative to the video matrix base address), specify the starting location of this data for each of the eight sprites.[16][10] Positioning of sprites is controlled through dedicated registers in the VIC-II's I/O space. The X-coordinate (0–255 pixels) for each sprite is set using the low eight bits in registers D000–D00E (for sprites 0–7), with the ninth bit (for positions beyond 255) stored in D010. The Y-coordinate (0–255 pixels) is set in D001–D00F. Horizontal expansion, doubling the width to 48 pixels, is enabled per sprite via bits in D01D (MxXE), while vertical expansion, doubling the height to 42 pixels, uses $D017 (MxYE); both can be applied simultaneously for 48×42 pixels. These expansions do not alter the underlying data resolution but replicate pixels for scaling.[16][10][17] Sprite priorities and interactions are managed through additional control registers. Among sprites, priority is fixed in numerical order, with sprite 0 having the highest precedence over sprite 7; relative to the background, each sprite's layering is set via bits in D01B (MxDP), where a 0 places it in front and 1 behind. Collisions are detected automatically: sprite-to-sprite overlaps set bits in D01E (MxM), and sprite-to-background overlaps set bits in D01F (MxD), both triggering raster interrupts if enabled via D019. These flags must be cleared by software to detect subsequent events. Each sprite is assigned a color from the 16-color palette using registers D027–D02E.[16][10][17] For animation, the VIC-II fetches sprite data via DMA during the active raster period, performing three memory accesses per visible scanline per active sprite to load the relevant bytes into internal buffers. This process repeats for each line the sprite is visible on, based on its Y-position. To exceed the limit of eight simultaneous sprites, multiplexing techniques reuse the hardware by altering positions and pointers mid-frame using raster interrupts, though DMA bandwidth constrains the total to approximately 120 pixels of height across all sprite instances per frame.[16][10][18]Scrolling and Raster Effects
The MOS Technology VIC-II enables smooth scrolling of the display area through hardware-controlled offsets, allowing pixel-level adjustments without requiring software-based memory shifts. Horizontal scrolling is managed by the XSCROLL bits (0-2) in register D016, which shift the screen content to the right by 0 to 7 pixels with 3-bit granularity, effectively delaying the start of character data fetches during each scanline.[2] Vertical [scrolling](/page/Scrolling) operates similarly via the YSCROLL bits (0-2) in [register](/page/Register) D011, offsetting the display downward by 0 to 7 pixels and influencing the timing of row counter resets.[2] Coarse adjustments to scrolling position can be achieved by selecting different rows or columns through screen memory mapping, complementing the fine offsets for broader repositioning.[19] Raster interrupts provide precise synchronization with the electron beam's vertical position, facilitating advanced display manipulations such as split-screen effects. These interrupts are triggered by setting a target raster line in register D012 (an 8-bit value from 0 to 255, with bit 8 in D011 for lines 256-311), generating an IRQ when the beam reaches that line.[2] This allows programmers to alter VIC-II parameters mid-frame, such as changing border colors or display modes to create banded effects or vertical holds that stabilize scrolling across frame boundaries.[19] Badlines represent a key aspect of the VIC-II's raster timing, where forced direct memory access (DMA) occurs to fetch character pointers and reset the 3-bit row counter, ensuring consistent display of text or bitmap rows. These badlines activate on every eighth line within the visible area (starting from raster line $30, adjusted by YSCROLL), during which the VIC-II steals 40 to 43 CPU cycles per line for memory access, potentially disrupting timing-sensitive operations.[2] The mechanics of badlines interact with scrolling by shifting their positions vertically, which can be exploited for effects like flexible line distancing, though they impose constraints on CPU availability during raster interrupts.[19] Representative effects enabled by these features include horizontal fine scrolling up to 7 pixels, which produces fluid side-to-side motion in games and demos by leveraging XSCROLL's per-scanline delay. Vertical hold via raster synchronization maintains stable positioning during smooth vertical scrolls, preventing jitter by aligning interrupts with beam position changes. Split-screen techniques, achieved through raster IRQs, divide the display into independent zones—such as a status bar at the top and main graphics below—by modifying registers like $D011 for screen enablement mid-frame. These capabilities, rooted in the VIC-II's timing architecture, allowed for dynamic visuals in resource-constrained systems despite the era's hardware limitations.[2][19]Variants and Revisions
Standard VIC-II Versions
The standard VIC-II chips were produced in several variants tailored to different video standards and markets, all sharing the core architecture for generating video signals, DRAM refresh, and graphics primitives in the Commodore 64. These NMOS implementations operated on a 5 V supply voltage, with an additional 12 V on pin 13 (V_DD) for internal video amplification in the NMOS process.[13] The early versions used a 40-pin DIP package, initially in ceramic for reliability but later switched to plastic for cost reduction without altering functionality.[10] The MOS Technology 6567 was the original NTSC variant designed for North American Commodore 64 models, featuring 60 Hz timing with 262 raster lines and 65 color clocks per line to support the full 16-color palette without phase issues in composite output. It provided 320×200 pixel resolution in hi-res mode and included support for 8 sprites, bitmap graphics, and character modes, all accessed via a 16 KB address space. This version was used in early production runs starting in 1982, with early revisions like R56A having timing bugs that were addressed in later versions such as R7 and R8, improving sprite collision detection reliability.[13][10][20] The MOS Technology 6569 served as the PAL counterpart for European and other 50 Hz markets, maintaining identical core logic and 16-color support but adjusted for 312 raster lines and 63 color clocks per line, resulting in slight color phase shifts relative to NTSC (e.g., reds appearing more orange in some outputs). It ensured compatibility with PAL-B/G standards, enabling smooth scrolling and raster interrupts optimized for 403 visible pixels per line. Like the 6567, it used the 40-pin DIP and was integral to PAL C64 units from launch.[13][10] The MOS Technology 6572 was a specialized variant for PAL-N markets in South America, operating at 60 Hz like NTSC but with PAL color encoding to match regional broadcast requirements, preserving the full 16 colors and sprite capabilities of prior versions. It shared the same 5 V supply and 12 V V_DD pin configuration, with minor timing tweaks for 262 lines to avoid vertical hold issues in PAL-N TVs. This chip appeared in later regional C64 revisions for cost alignment with local production.[4] Later HMOS-II process revisions, such as the 8562 (NTSC replacement for 6567) and 8565 (PAL replacement for 6569), were introduced in later C64 production runs. These operated on a single 5 V supply, eliminating the need for 12 V, while reducing power consumption and heat generation. They maintained identical functionality, pinout, and compatibility with standard VIC-II software and hardware, housed in the same 40-pin DIP package.[21] All standard VIC-II versions featured compatible pinouts for the 40-pin DIP, including a 14-bit address bus (pins 2-15), 12-bit bidirectional data bus (pins 21-32), and key control signals like IRQ (pin 37), light pen input (pin 38), and clock inputs (pins 1 and 20). Differences were limited to internal timing generators for video standards, with no changes to register interfaces or memory mapping, ensuring drop-in interchangeability within matching regional hardware. Over time, die shrinks in subsequent mask revisions reduced manufacturing costs while maintaining functionality.[13][10]| Variant | Video Standard | Supply Voltage | V_DD Voltage | Key Timing | Package | Primary Use |
|---|---|---|---|---|---|---|
| 6567 | NTSC (60 Hz) | 5 V | 12 V | 65 color clocks/line, 262 lines | 40-pin DIP (ceramic/plastic) | Early North American C64 |
| 6569 | PAL-B (50 Hz) | 5 V | 12 V | 63 color clocks/line, 312 lines | 40-pin DIP (ceramic/plastic) | European C64 |
| 6572 | PAL-N (60 Hz) | 5 V | 12 V | 65 color clocks/line, 262 lines | 40-pin DIP (plastic) | South American C64 revisions |
| 8562 | NTSC (60 Hz) | 5 V | None (single supply) | 65 color clocks/line, 262 lines | 40-pin DIP (plastic) | Late North American C64 |
| 8565 | PAL-B (50 Hz) | 5 V | None (single supply) | 63 color clocks/line, 312 lines | 40-pin DIP (plastic) | Late European C64 |