# Start here: the Williams 6809 boards on one page Phase 0 notes for `williams-python`, the board of Williams's first-generation 6809 arcade games (Defender 1980, Stargate 1981, Robotron: 2084, Joust, Bubbles, Sinistar, Splat! 1982, Blaster 1983). No emulator code exists yet. Every fact names its source key from [sources.md](sources.md) and an evidence tag (methodology): DOC (a Williams or maker's document), MEASURED (a capture on a real board, here Sean Riddle's), OBSERVED (MAME run as a closed box), FITTED, HYPOTHESIS. ## The machine Five boards in the cabinet (DOC: DEF-T section 1; SR-HW): | Board | What is on it | Clock | | --- | --- | --- | | CPU/video | MC6809E; 48 KB of DRAM in three banks of 16K x 8 bits (24 x 4116: SR-HW; "three RAM banks", each 16K locations: DEF-T section 2); the video address generator, shift registers, colour RAM (16 x 8 bits, two 7489s: SR-LINES); the vertical count buffer; CMOS RAM with batteries; the watchdog; the reset circuit; two decoder PROMs (later boards) | 12 MHz crystal; 6 and 4 MHz derived; E and Q at 1 MHz from 4 MHz (DOC: DEF-T "Clock generator", "E and Q generator") | | ROM | up to 12 x 4 KB program ROMs (D, E, F always mapped; banks 0-8 shadow RAM at 0000-8FFF), the ROM-board 6821 PIA (coin door in, sound command and LEDs out), and from Robotron on the two Special Chips (blitter) | E | | Interface ("widget") | the second 6821 PIA with multiplexed player inputs | E | | Sound | MC6808 (or MC6802) with its own 3.58 MHz crystal, one 6821 PIA, an MC1408 8-bit DAC, a 2 or 4 KB ROM at F000; a 40-pin connector for the speech module | 3.58 MHz / 4 (DOC: SIN-DS p. 17, sound board D-8224-3006: Y1 3.58 MHz on the 6808/02) | | Speech (Sinistar; Blaster has a second sound board instead) | a ROM extender (4 x 2 or 4 KB) and an HC-55516 CVSD decoder whose output is mixed with the DAC (DOC: SR-HW) | driven from the sound CPU | | Power supply | +5, -5, +12, -12, +27 V | | ## The numbers that set the timing - CPU: MC6809E, E = 12 MHz / 3 / 4 = **1.000 MHz** (DOC: DEF-T; OBSERVED: `mame -listxml` says `MC6809E clock="1000000"`). - Video address generator: a 14-bit counter clocked once per microsecond that reloads to 0x3F00 after its first overflow, so a frame is 16,384 + 256 = **16,640 E cycles** (DOC: DEF-T fig. 3-6 "preloads these counters to 16,128"; SR-HW: "reloaded with 0x3F00 ... total count of 16640 in 16.64ms"). 64 counts per line, so **260 lines of 64 µs**; 15,625 lines a second; 60.096 frames a second (OBSERVED: MAME's display row `refresh=60.096154`, `vtotal=260`). - Picture: bitmap, 4 bits a pixel, two pixels a byte, 16 colours from 256 (3 bits red, 3 green, 2 blue) through the colour RAM (DOC: DEF-T section 2). Screen memory 0000-97FF, 304 x 256 pixels, laid out in columns: the next byte is the next line down, the next pixel pair to the right is 256 bytes on (SR-MAP; SR-BLIT). - Interrupts: only IRQ is used on these boards; it is the OR of the ROM-board PIA's IRQA and IRQB. CA1 = COUNT 240 (VA10-VA13 all high, video line 240 and on), CA2 = the coin door slam switch, CB1 = VA11 (a "4 ms" interrupt), each on the edge the program selects (DOC: DEF-T "ROM board PIA/decoder"; but see C1 in the brief). NMI and FIRQ are pulled up and unused (DOC: DEF-T "MPU"). - Sound: MC6808 E = 3,579,545 / 4 = **894,886 Hz** (OBSERVED: MAME `MC6808 clock="3579545"`; the 6808 divides its crystal by 4: m6800-python's start-here). ## The generations and where each game sits | Group | Games (MAME sets, [census.md](census.md)) | Differences | | --- | --- | --- | | Defender map | defender (+ 6 label variants and 11 bootlegs), mayday (3) + batlzone, colony7 (2), jin | ROM and I/O paged into C000-CFFF by a latch at D000; RAM always at 0000-BFFF; no blitter ([defender.md](defender.md)) | | Later map, no blitter | stargate | the map below; CPU board slightly modified (DOC: SR-DIFF) | | Later map, SC1 | robotron (+5), joust (+2), bubbles (+2), sinistar (+4, with speech), alienar (+1), conquest, lottofun, spdball, playball (speech) | Special Chip 1 with the XOR-4 width/height bug | | Later map, SC2 | splat, blaster (+2: two sound boards, extra video control) | Special Chip 2, bug fixed | | Second generation (`williams2`) | mysticm, tshoot, inferno, joust2 | tile background, palette RAM, 4 MHz sound board, Joust 2's System 11 background sound board (6809E + YM2151 + HC-55516): **out of Phase 0 scope**, open decision 6 | ## The family pieces it uses - **m6809-python** (Phase 0 only: documents, no core) for the MC6809E. The board is blocked on it: [cpu-cores.md](cpu-cores.md) lists what the board needs from it. - **m6800-python** (built, v0.2.0, seven rungs) for the sound board's MC6808/MC6802; its rung 4 already ran a Williams sound board as a host script against MAME. - The 6821 PIA, the Special Chips, the video generator, the MC1408 DAC and the HC-55516 stay in this board (chip rule); the PIA is a candidate shared core (open decision 3). ## Modelling level (charter axis B), proposed | Component | Level | Why | | --- | --- | --- | | MC6809E | cycle (every bus cycle, m6809-python) | the blitter halts it between instructions and the video reads interleave per microsecond | | Blitter (SC1/SC2) | cycle (one byte per E cycle, two in slow mode) | Riddle's per-blit timings and RAM dumps decide it ([blitter.md](blitter.md)) | | Video | per microsecond fetch, per pixel output | colour-RAM writes and mid-line screen changes are visible (SR-LINES) | | PIAs, CMOS, watchdog | cycle (register level on E) | documented chips | | MC6808 | cycle (m6800-python) | existing core | | DAC | per write (the DAC holds its value) | the output is a step function of PIA port A writes | | HC-55516 | per bit clock, behavioural (digital syllabic and integrator filters from the data sheet) | sound "good enough" rule; no die netlist exists ([sound-speech.md](sound-speech.md)) | ## The order to read [memory-map.md](memory-map.md) and [defender.md](defender.md); [video.md](video.md), [blitter.md](blitter.md), [pia-cmos-watchdog.md](pia-cmos-watchdog.md), [sound-speech.md](sound-speech.md); [cpu-cores.md](cpu-cores.md), [domains-and-speed.md](domains-and-speed.md); [sources.md](sources.md), [validation.md](validation.md), [mame-oracle.md](mame-oracle.md), [census.md](census.md); then [handoff-brief.md](handoff-brief.md).