# Start here: the Vectrex in one page Facts carry a source tag: **[sch]** the logic-board schematic (the CC BY-SA KiCad redraw, Rev 3GE, read as an image on 2026-11-11), **[sm]** the HP3000 Service Manual, **[kw]** Keith Wilkins' *Programming Notes* (INTERNAL.TXT, Rev B, 1993), **[bt]** Bruce Tomlin's Executive disassembly (the `bios.lst` listing with cycle counts), **[cs]** Christopher Salomon's tutorial, **[mame]**, **[vide]**, **[vecx]**, **[vectrexy]** emulator sources, **[ran]** something run here. Tiers are in [validation.md](validation.md). ## The machine | Part | What | Source | | --- | --- | --- | | IC206 | Motorola **68A09** (internal clock: not the 6809E), 6 MHz crystal, E = 1.5 MHz | [sch]; [sm] says "1.6 MHz" (C1) | | IC207 | **6522 VIA**: the only I/O device on the bus | [sch] | | IC208 | General Instrument **AY-3-8912**, clocked by E, on VIA port A, BC1/BDIR from VIA port B, BC2 tied high | [sch] | | IC201 | 8K system ROM (2363): the Executive at `$F000` and Mine Storm at `$E000` | [sch], [bt] | | IC204, IC205 | two 2114 (1K x 4): 1K of RAM | [sch] | | IC301 | **MC1408** 8-bit DAC on port A, its MSB inverted by Q303 so the byte is signed | [sch] | | IC302 | **CD4052B** dual 4-way analog multiplexer: one half routes the DAC, the other the joystick pots | [sch] | | IC303 | LF347: Y sample-and-hold buffer, Z buffer, the two integrators | [sch] | | IC304 | LF353: the DAC's current-to-voltage converter and the joystick comparator | [sch] | | IC305 | 4066: the two RAMP switches and the two ZERO switches | [sch] | | IC202, IC203 | 74LS00 and 74LS32: the whole address decode | [sch] | | J201 | 36-pin cartridge port; J202, J203 the two controller ports | [sch] | There is no video chip, no frame buffer and no fixed frame. The picture is whatever the program makes the beam do. ## Who drives what | VIA pin | Signal | Use | | --- | --- | --- | | PA0-PA7 | bus | DAC input **and** the PSG's data bus, at the same time, always | | PB0 | SH | multiplexer inhibit: 0 = multiplexer enabled | | PB1, PB2 | SEL0, SEL1 | multiplexer channel: 0 Y, 1 zero-reference offset, 2 Z (brightness), 3 sound; and joystick pot 0-3 | | PB3 | BC1 | PSG bus control | | PB4 | BDIR | PSG bus control | | PB5 | COMPARE | input: the joystick comparator | | PB6 | PB6 | to the cartridge port (pin 35); an input after the Executive's set-up (`DDRB = $9F`) | | PB7 | /RAMP | low = integrate. Driven by timer 1 in one-shot mode (`ACR = $98`) | | CA1 | | controller button line SW7 (the line the 3D Imager's index pulse and one light-pen port use) | | CA2 | /ZERO | low = discharge both integrators (beam to centre) | | CB1 | | not connected | | CB2 | /BLANK | low = beam off. Driven by the shift register (mode 6, shift out under the system clock) for dashed lines and text, or held by `PCR` | | IRQB | /IRQ | the 6809's IRQ, shared with cartridge pin 36 | [sch] for the wiring; [bt] `Init_VIA` for the register values; confirmed in the MAME run (`W 2 9F`, `W 3 FF`, `W B 98` at cycles 2242-2258: [ran]). The 6809's other inputs: **/NMI** and **/HALT** come from the cartridge port (pins 34 and 1), with pull-ups; **/FIRQ** does **not**: it is wired to controller button line SW3 (see [controllers.md](controllers.md) and conflict C2). MRDY and /DMA-BREQ are pulled high [sch]. ## Time One clock: E, 1.5 MHz, 666.67 ns. The CPU, the VIA's timers and shift register and the PSG all count it. The Executive's frame is timer 2 loaded with `$7530` = 30,000 cycles = 20 ms: **50 Hz**, in every country, and only by convention: a program may load any value, never call `Wait_Recal`, and many games overrun the 30,000 cycles and run slower [bt], [cs]. So the board has no frame of its own. A host that wants "frames" picks a slice (the T2 reload is a good one, as MAME does for its refresh). ## What is hard 1. **The VIA at cycle resolution.** Timer 1 times RAMP, the shift register clocks BLANK two cycles per bit, and the Executive's drawing loops are written to those cycle counts. The CPU must present each bus access on its own cycle, including the read that `CLR`, `INC` and `DEC` make before they write: `CLR everything via.py the 6522 (or the pinned mos6522-python: open decision 2) analog.py DAC, multiplexer, sample-and-holds, integrators, RAMP/ZERO/BLANK delays -> beam segments beam.py the segment record and the list a host drains cartridge.py plain ROM, PB6-banked ROM, RAM carts; the port's lines as a socket controllers.py joystick, buttons, light pen, 3D Imager as devices on the two controller sockets raster.py optional: segments -> a picture (for a window and for comparisons); not imported by machine.py ``` Pinned siblings: `m6809-python` (the CPU, to be built first), `ay8910-python` (the PSG, built). The board owns the clock: it steps the CPU, and on every bus cycle advances the VIA, the PSG and the analog model by one E cycle, in that order of dependency. That needs the CPU to show the board every bus cycle on its true cycle: the requirement on `m6809-python` is spelled out in [handoff-brief.md](handoff-brief.md). Performance: 1.5 M cycles a second, each with a VIA step and an analog step. Reference boards are correct, not fast; measure at milestone M3 before guessing. Keep every hot object under 80 attributes (PyPy's limit).