# The VIC-II (6567, 6569, 8562, 8565; the 6566) The hard chip. It makes the system clock, owns phase 1 of every bus cycle, steals phase 2 when it needs more (bad lines, sprite fetches), refreshes the DRAM, draws 8 pixels a cycle and raises the raster, collision and light-pen interrupts. Everything cycle-exact on the C64 (raster splits, FLI, open borders, stable rasters, fast loaders that must avoid bad lines) depends on it. ## The evidence, honestly - **No die-level model exists** that this Phase 0 found: no netlist, no transistor simulation; a 2020s forum thread on reverse engineering it from a die shot, and die photographs of the 6569 R1/R3 by Michael Huth (licence not stated) (sources.md). The best description is **Bauer's article (VIC, tier 3)**, which says of itself that "as no schematics of the VIC are available it can of course only be speculative, but in all cases a descriptive model has been chosen that explains the observed phenomena with the minimally required circuitry" (VIC, 1). Its timing diagrams come from Mäkelä's 1994 "PAL timing" measurements, made in software by reading the VIC's phase-1 bytes through open bus (VIC section 4). - **The 2024 revision of VIC corrects the 1996 text** on the VMLI, on sprite Y expansion and on the sprite priorities, and clarifies raster interrupts (VIC, 5). Implementations built from the 1996 text (most of the older emulators, the copies on the web) carry those errors: **use the 2024-09-29 text** (pinned as `VIC-Article.txt`; the 1996 one as `vic-ii.txt` for comparison). - **Manufacturer documents (tier 2)**: the 6567 preliminary specification (VICDS) and PRG appendix N (pp. 436-456) give registers, pins and the bus timing diagram; they say nothing of bad-line corners, sprite crunch or border tricks. Two US patents cited by VIC (4,551,682 the digital sine-cosine generator for colour; 4,561,659 the multiple-object priority logic) are public documents and worth pinning (open decision). - **Test programs (tier 3 where verified on hardware)**: 47 directories in VICE `VICII/`, 361 entries in the C64 test list. A keyword search of their readmes finds real-hardware notes in `colorfetchbug`, `dmadelay`, `luma-levels`, `sequencer-bug`, `spritefetchbug`, `spritegap`, `videomode`, `vspbug`, `vsp-tester` (each to be read before it counts as hardware-verified). Many tests carry reference screenshots taken with an emulator (VICE's testbench readme: "taken with default screen dimensions, with CRT emulation disabled", pepto palette): those are tier 5 until a test says the picture was checked on hardware. - **FPGA reimplementation (tier 4)**: VIC-II Kawari (GPL-3.0; closed box only). Its author's repository has an AGENTS.md (no AI objection). ## The model the specification follows (VIC, sections 3.4-3.14) Everything below is from VIC (tier 3) unless tagged otherwise; it is the structure the code takes, one unit per paragraph. - **Coordinates and timing.** Per line: 63 (6569), 65 (6567R8) or 64 (6567R56A) cycles; per frame 312, 263 or 262 lines (3.4). The raster line starts at the raster IRQ's X coordinate (412 for the 6567s, 404 for the 6569); X runs to $1FF ($1F7 on the 6569) then wraps (3.4). Two half-cycles per cycle: phase 1 VIC, phase 2 CPU unless AEC stays low. - **Accesses** (3.6.2): c (video matrix, 12 bits with colour RAM), g (character or bitmap data), p (sprite pointers, every line for all eight sprites), s (sprite data, three per sprite when its DMA is on), r (five DRAM refreshes a line), i (idle reads of $3FFF). Idle-state g-accesses read $3FFF, or $39FF with ECM set (3.7.3: ECM holds address lines 9 and 10 low). VIC 3.7.1 says "the ECM bit in register $d016"; ECM is bit 6 of $D011 by VIC's own register table (3.2): an internal slip (C4). Their place in the line, per chip type, is the timing diagram in 3.6.3, transcribed into a table in the specification and unit-tested cycle by cycle. - **Bad Line Condition** (3.5): at the negative edge of phi0 at the start of any cycle, RASTER is $30-$F7, RASTER & 7 = YSCROLL, and DEN was set in some cycle of line $30. "This definition has to be taken literally": it can arise, vanish and return within a line, which is how FLD, FLI, linecrunch, doubled text lines and VSP/DMA delay work (3.14.2-3.14.6). - **BA and AEC** (2.3, 2.4.3): BA falls three cycles before the first stolen phase 2; the CPU stops at its next read; up to 40 c-accesses on a bad line ("40-43 cycles" stolen with the BA lead: 3.5) and two per enabled sprite plus the BA lead. - **The display unit** (3.7): VC, VCBASE, RC, VMLI; display and idle states; the eight graphics modes including the three invalid ones (black output, but collisions still happen: 3.7.3.6-3.7.3.8); the 40 x 12-bit video matrix line buffer. - **Sprites** (3.8): MC, MCBASE, the Y-expansion flip-flop, DMA on/off in cycles 55, 56, 58 and 15/16; 24-bit shift register per sprite; X expansion; priorities and collisions (sprite-sprite, sprite-background) and the order the priority multiplexer applies them (corrected in 2024: 3.8.2). Sprite crunch and stretching (3.14.7). - **Border unit** (3.9): the main and vertical flip-flops, the CSEL/RSEL comparison values (left 31/24, right 335/344, top 55/51, bottom 247/251), matched only exactly, the six rules; hyperscreen tricks fall out of them (3.14.1). - **DEN** (3.10), **light pen** (3.11: one negative edge per frame latches LPX (X/2) and LPY; the LP input shares CIA 1 port B bit 4, so software can trigger it), **interrupts** (3.12: raster compare in cycle 1 of each line, cycle 2 for line 0, at most once a line; MBC and MMC only on the first collision; bit 7 of $D019 the inverted IRQ output), **DRAM refresh** (3.13: five r-accesses a line, the refresh counter's addresses visible on the bus). - **Registers** (3.2): 47 at $D000-$D02E, mirrored every 64 bytes up to $D3FF; $D02F-$D03F read $FF; unconnected bits read 1; $D01E/$D01F cleared on read; $D016 bit 5 (RES) unused on the 6567/6569, stops the 6566 (3.2). ## Revisions and rows | Chip | Used in | Differences known (to confirm per test) | | --- | --- | --- | | 6567R56A | early NTSC C64 | 64 cycles, 262 lines (VIC 3.4); its own line diagram in 3.6.3; "the differences are mostly negligible with the exception of the 6567R56A" (VIC 2.3) | | 6567R8 | NTSC C64 | 65 cycles, 263 lines | | 6569 (R1, R3, R4, R5) | PAL C64 | 63 cycles, 312 lines; luminance levels differ by revision (VIC 3.3; VICE `luma-levels` measures on real hardware) | | 8562 / 8565 | C64C, C64GS | "functionally equivalent" (VIC 2.3); VICE tests distinguish "old" (6569) and "new" (8565) VIC-II for the light-pen trigger delay (`lp-trigger/test2` vs `test2new`) and the grey-dot artefact (`greydot`) | | 6566 | MAX (Ultimax) | static-RAM interface; RES bit stops it (VIC 3.2) | ## Output The board emits, per cycle, eight 4-bit colour indices (and the border, blanking and sync state), not RGB: the VIC's colour is an analogue signal built from a sine-cosine generator (VIC 3.3; patent 4,551,682). Palettes (pepto's "colorvic", VIC's own 3.3 discussion) are the host's choice and are not hardware-judged here; luminance per revision is recorded as data when the `luma-levels` measurements are read. ## Judges for the VIC-II | Tier | Judge | Can decide | Cannot | | --- | --- | --- | --- | | 3 | VIC (2024 text) | the model, every access's cycle, the flip-flop rules | anything Bauer did not test; analogue output | | 3 | VICE `VICII/*` tests whose readmes record hardware results; Lorenz 2.15's VIC-timing parts | exit-code verdicts written from real machines | tests whose expected values came from an emulator | | 2 | VICDS, PRG appendix N, the two patents | registers, pins, bus timing diagram | corners | | 4 | VIC-II Kawari (GPL-3.0) | closed-box detector, built in emu-tools-gpl if wanted | | | 5 | MAME 0.285, VICE (x64sc) as closed boxes | detectors | |