# The cartridge port, cartridge types, the library census Source tags as in [start-here.md](start-here.md). Census: `tests/census/census-2026-11-11.txt`, made by `scripts/census.py` (read in place, nothing copied). ## The connector (J201, 36 pins) Read from the redraw at 300 dpi on 2026-11-12 [sch]; the empirical `PINOUT.TXT` in Vide's documents (tier 3, "This information is empirical") agrees on every pin it names. | Pin | Signal | | Pin | Signal | | --- | --- | --- | --- | --- | | 1 | **/HALT** (6809 pin 40, 3.3k pull-up R206) | | 2, 4 | +5 V | | 3, 5, 7, 9, 11, 13, 15, 17 | A7, A6, A5, A4, A3, A2, A1, A0 | | 6, 8, 10, 14 | A8, A9, A11, A10 | | 19, 21, 23 | D0, D1, D2 | | 12 | **/E** (the inverted E clock) | | 25, 27 | ground | | 16 | **A15** | | 29, 31, 33 | A12, A13, A14 | | 18, 20, 22, 24, 26 | D7, D6, D5, D4, D3 | | 35 | **PB6** (VIA pin 16) | | 28 | ground | | | | | 30 | **R/W** | | | | | 32 | **/CARTS** = A15 OR /E (low for `$0000-$7FFF` while E is high) | | | | | 34 | **/NMI** (6809 pin 2, 3.3k pull-up R203) | | | | | 36 | **/IRQ** (6809 pin 3, shared with the VIA's IRQB, 3.3k pull-up R202) | No /FIRQ (it is on controller line SW3: [controllers.md](controllers.md), C2), no /RESET, no audio, no separate chip select for `$8000-$BFFF`: a cartridge that wants that range decodes A15/A14 itself. A plain ROM cartridge uses /CARTS as its chip select and ignores R/W, so a CPU write to `$0000-$7FFF` reaches the cartridge with R/W low; the board must offer the write to the cartridge socket and a ROM cartridge ignores it. ## The socket the board exposes ```python class CartridgeSocket(Protocol): def read(self, address: int, cycle: int) -> int | None: ... # None: not driving the bus def write(self, address: int, value: int, cycle: int) -> None: ... def pb6(self, level: int) -> None: ... # the VIA's PB6 pin as driven, or the pull-up nmi: bool; irq: bool; halt: bool # lines the cartridge drives (default released) ``` Called for **every** access in `$0000-$7FFF`, and for `$8000-$BFFF` too (no chip on the board answers there; a cartridge may). `None` means open bus (the board returns its last bus value: a choice, U7). ## Types | Type | Behaviour | In the library | Source | | --- | --- | --- | --- | | plain ROM, 4K / 8K | `$0000-$0FFF` or `$0000-$1FFF`; mirrored or open above (a 2732/2764 sees only its own address lines and /CARTS, so a plain cart should **mirror** through `$7FFF` [inf: no cartridge board was read]; MAME returns `$FF` past the image: U16) | 21 x 4K, 24 x 8K | census; MAME `rom.cpp` `read_rom` | | 12K | Dark Tower (proto) | 1 | census | | 2K RAM at `$2000-$27FF` | AnimAction: "Uses 2Kb of external RAM" [faq]; Vide maps it there (read from its source in Phase 0: HYPOTHESIS). MAME's list calls it plain `vec_rom` (C7) | 1 | faq, Vide (HYPOTHESIS) | | 32K | RA+A Spectrum I+ stress tester, which is MAME's separate `raaspec` arcade machine (`$8000` battery RAM, LEDs at `$A000`, coin on PB6) | 1 (out of scope: open decision 8) | census; MAME `vectrex.cpp` | | PB6-banked 64K | two 32K banks selected by PB6 (MAME `vec_rom64k`: `m_bank = data >> 6`), homebrew only | **0** | MAME `rom.cpp` | | SRAM homebrew | MAME `vec_sram`, detected by `"SRAM"` at offset 6 | 0 | MAME `slot.cpp` | | modern carts (VecFever, Vectorblade/Telengard flash, VecVoice, Vectrex32, multicarts) | out of scope | 0 | MiSTer's notes list some; open decision 7 | **PB6:** the VIA leaves PB6 an input (`DDRB = $9F`), so the pin floats high through a pull-up and a banked cart sees bank 1 at boot. MAME says of itself that it "does not currently emulate the pull-up resistor on the 6522's PB6 line" and forces bank 1 [mame `rom.cpp`]. Vide's help page for DDRB (tier 3, Malban): "if PB6 is configured as input, bit 6 goes automatically high. If set to output it goes to low automatically. Even if in output mode and a ONE is written to pb6, it only goes high for a short period of time and than switches back to low automatically" - an observation the data sheet does not explain and nobody we found measured (U10). Nothing in the library exercises it; the milestone that adds banking needs a homebrew image (open decision 7). ## The header and the boot check See [memory-map.md](memory-map.md): the Executive's `Warm_Start` accepts a cartridge whose first six bytes are `g GCE ` and whose eleventh is `$80`; otherwise it runs Mine Storm from the system ROM. **MAME refuses** to load any image not starting with `g GCE` ("Invalid Vectrex ROM", `slot.cpp` `call_load`), so the No-Intro "Mine Storm (World)" image (the system ROM's `$E000` half, which has no copyright string) cannot be loaded as a cartridge in MAME even though its software list names it (`minestrm`). The board must not refuse: an image that fails the check is a cartridge that boots Mine Storm, exactly as on hardware. ## Census (2026-11-11, `tests/census/census-2026-11-11.txt`) - **No-Intro "GCE - Vectrex": 48 archives = 47 cartridge images + the system ROM.** Sizes 21 x 4K, 24 x 8K, 1 x 12K, 1 x 32K, 1 x 3,671 bytes (Sledge 3D sample). **None exceeds 32K: nothing needs PB6 banking.** 43 match MAME's software list by SHA-1, all `vec_rom`; 4 do not (Berzerk (Europe) (Rev 2), Fortress of Narzod (Europe) (Rev 2), Star Ship (Europe) (1983), the Spectrum I+ tester). - `/vectrex`: 31 archives (7z) at the top level, all in the No-Intro set by SHA-1. - Includes the factory **Test Cartridge (USA) (Rev 4) (Proto)** (SHA-1 `e3418055...`): the manual's adjustment patterns; Graham Toal's disassembly `TestRev4.asm` and Johannsen's analysis are pinned. - Light pen titles: Art Master, Melody Master, AnimAction (and the protos Engine Analyzer, Mail Plane). 3D Imager titles: 3D Crazy Coaster, 3D Mine Storm, 3D Narrow Escape. - Interrupt use, by a byte-pattern scan for an immediate load with bit 7 set stored to `IER` ([ran], heuristic, misses computed values): CA1 (`$82`) in the three light-pen titles, T2 (`$A0`) in Bedlam, T1 (`$C0`) in Spike; the 3D titles reference the RAM interrupt slots. Short MAME runs of Berzerk, Bedlam and Spike (14 emulated seconds, title screens) took **no** interrupt (vector-fetch tap, see [mame-oracle.md](mame-oracle.md)). System ROMs: [executive.md](executive.md).