# Who uses the chip: consumers, successors, libraries ## MAME's count (run here, 2026-11-12) `python -I scripts/mame_census.py` streams `mame -listxml` (MAME 0.285) and counts the machines whose device list holds a TMS99x8: **217 machines (131 parents, 86 clones)**. | Device | Machines | Device | Machines | | --- | ---: | --- | ---: | | `tms9928a` | 52 | `tms9118` | 17 | | `tms9929a` | 50 | `tms9128` | 15 | | `tms9918a` | 34 | `tms9918` (no A) | 8 | | `tms9129` | 33 | `tms9929` (no A) | 7 | | `efo90501` (EFO's part, MAME's device) | 1 | | | By source folder: MSX 135; misc 16 (arcade: Arachnid darts, Kingpin, Pachinko Fever, Trivia Quiz, Re-900, Tecnodar...); Sega 12 (SG-1000, SC-3000, SF-7000, Othello Multivision, and the SG-1000-based arcade boards *Champion Boxing*, *Champion Pro Wrestling*, *Doki Doki Penguin Land*, *Super Derby*); VTech 9 (CreatiVision family); TI 8 (TI-99/4, 4A, 8, TM990/189); Coleco 8 (ColecoVision NTSC/PAL, ADAM, Onyx, Bit90, CZZ-50, Dina, Telegames Personal Arcade); Stern 4 (*Cliff Hanger*, *Goal to Go*: a TMS9128 over a laserdisc, the external-video case); SVI 4; Bally pinball video 3 (*Baby Pac-Man*, *Granny and the Gators*); Sord 3 (M5); Memotech 3 (MTX); Tomy 3 (Tutor, Pyuuta); and one each from Tatung (Einstein), Casio (PV-2000), Nichibutsu (My Vision), Unicard (BBC Bridge Companion), NABU, EFO (*Nightmare*), the Ultim809 homebrew and two skeleton drivers. The TMS91x8/91x9 are TI's later parts of the same design (MAME: no 4K/16K bit, and the Graphics II colour mask does not affect the pattern mask; [PG 5.1.2]: the 4/16K bit is a "Don't Care" on them). The `tms9918` and `tms9929` without A lack Graphics II (`m_reva` false). All are rows of the same variant table if a consumer ever needs them. ## Present consumers and what each needs from the contract ### colecovision-python (first consumer; Phase 0 done, build order: core first) Read in `../colecovision-python` (`9cc71d9`), `docs/handoff-brief.md` and `docs/vdp.md`. - **Chips**: TMS9928A (NTSC) and TMS9929A (PAL), 16K of 4116s, XTAL 10.738635 MHz, the Z80 at XTAL/3 from the same crystal (so CPU and VDP clocks are locked). - **Ports**: `$BE` data, `$BF` control/status, mirrored through `$A0-$BF`; the board decodes, the core sees MODE. - **/INT drives the Z80's /NMI**: the board needs the level and turns its falling edge into an NMI request. Setting IE while F is 1 must produce that edge at once (games mask the NMI through R1 bit 5 instead of the CPU, so this path is exercised every frame). - **Time**: the board's timeline is in master clocks or CPU clocks x 3; it brings the core up to the moment of each port access before making it (as sn76489-python's hosts do). - **Frames**: colour indices plus the backdrop index for the border, 256 x 192 (and the border area if the frontend wants it); RGB stays in the board. - **Board-owned**: the M1 wait, the SN76489A's READY wait, the NMI edge, the spinner /INT. The core never inserts CPU wait states: the TMS9918A has no wait output, which is why lost accesses exist at all. ### sms-python (later adopter; keeps its own VDP for now) Read in `../sms-python` at `3f26bc3` (`main`). Its SG-1000 (TMS9918A), SC-3000 and SF-7000 rows use `VDP(TMS9918A)` from `src/sms_python/vdp.py`. The board and system call the VDP 15 ways ([colecovision-python's brief, open decision 1](../../colecovision-python/docs/handoff-brief.md) lists them; counted again here): `run(cycles)`, `irq`, `read_status()`, `read_data()`, `write_control(v)`, `write_data(v)`, `frame_ready`, `visible_frame()`, `line`, `m`, `lines_per_frame`, `lines_started`, and the counter reads `read_v_counter()`, `read_h_counter()`, `latch_h_counter()` (Sega's; the TI part has no counters, and the SG-1000 board answers those ports with open bus). An adapter in sms-python can map all 15 onto a smaller core surface: `run` takes CPU cycles there (x 3 = master clocks); `irq` is the core's /INT level; `visible_frame()` becomes the core's index frame through the board's palette; `line`, `m`, `lines_per_frame`, `lines_started` are the core's beam position and counters. The core should expose its beam position (line, dot) read-only for exactly this. **What sms-python's TMS9918A row does, and what a TI-timed core must do differently** (read, not copied): | Behaviour | sms-python `vdp.py` (TMS9918A row) | This core | | --- | --- | --- | | time base | mclocks, 684 a line, 3 per CPU cycle: the same unit | same unit (master clocks); the 171-cycle memory schedule on top | | line timing | `SMS_TIMING`, fitted to FluBBa's tests of Sega's 315-5124/5246; line origin at Sega's V counter change; a whole line rendered at one point (`RENDER_MCLOCK` 93, MAME's `HORZ_DISPLAY_START`) | TI table 3-3 positions; pixels produced from fetches at their cycles | | frame flag | set at Sega's measured point (end of line 192, flags visible as line 193 begins) | TI: end of line 191's active scan (C10) | | VRAM access | every access served at once | access windows by mode; a too-early access is lost by a stated rule (U3) | | 4K/16K | not modelled | MacDonald's mux table plus the 4K address roll-over (C11) | | Graphics II masks | pattern mask = R4 bits only | R3's low mask bits also mask the pattern index on the 99xx parts (MAME; TI's 1982 memo calls it a logic error: C3) | | sprite collision | only the 256 visible columns | TI: off-screen pixels too (C7) | | fifth-sprite number | MAME's bookkeeping (kept current while 5S is clear) | same rule, timed to the pre-processing pass | | colours | `TMS9918A_RGB` inside the VDP | indices out; RGB in the board | | text mode position | 6 pixels in (TI table 3-3) | same | | undocumented modes | Young 3.5-3.7 | same, plus the plain-9918 row (U6) | Its Sega VDPs (315-5124, 315-5246, Game Gear, Mega Drive) are their own silicon with their own legacy-mode quirks; they keep their code. The five adoption steps are in colecovision-python's open decision 1. Expect SG-1000 sweep rows to move when it adopts: today's SG-1000 timing is Sega's. ## Later consumers (none started) | Machine | Part | What it would add to the contract | | --- | --- | --- | | MSX1 (135 MAME machines) | TMS9918A/9928A/9929A, TMS9118/9128/9129 (some machines carry other makers' compatible parts; not surveyed) | the M1-wait CPU; VATT as a directly runnable hardware test (openMSX and the msxgl wiki); the largest software library (945 No-Intro MSX images) | | ColecoVision ADAM | TMS9928A | nothing new (same chip as the ColecoVision) | | TI-99/4A | TMS9918A (TMS9929A in Europe); TI-99/4 plain TMS9918 | the plain-9918 row; GROMCLK if GROMs are emulated by the board (it is an output the board can derive from the clock) | | Spectravideo SV-318/328, Sord M5, Memotech MTX, Tomy Tutor, Casio PV-2000, Einstein, CreatiVision | TMS9918A/9928A/9929A | nothing new | | Arcade: SG-1000-based Sega boards, Kingpin, Bally *Baby Pac-Man* | TMS9928A/9128 | nothing new | | Stern *Cliff Hanger* | TMS9128 over a laserdisc | external video: colour index 0 where every plane is transparent, so the board can key the disc picture | ## Successors: out of scope - **Yamaha V9938 / V9958 (MSX2, MSX2+).** Supersets with 128K of VRAM, 47 registers, bitmap modes, a command engine, sprite mode 2 and a different memory schedule (1,368 cycles a line at 21.48 MHz, burst accesses). They run TMS9918A software in compatible modes, but openMSX's own measurements show their timing "cannot be extrapolated" to the TMS9918, and their status race is the only one measured. A separate core (`v9938-python`) if an MSX2 board comes. *Door kept open*: registers are an indexed array, variants are data, the schedule is a per-mode table. *Deliberately not*: the core does not take a register-count or VRAM-size parameter beyond 16K, has no command engine hooks, and does not share a class hierarchy with a future V9938: the family copies no code, and a V9938 core would cite this one. - **Sega's VDPs (315-5124 in the Mark III and Master System, 315-5246 in the later Master System, the Game Gear's, the Mega Drive's YM7101).** Sega's own silicon: Mode 4, CRAM, H/V counters, line interrupts, scrolling, and their own implementation of the TMS modes with Sega quirks (SMS1 masks, overflow without the number, CRAM-coloured TMS modes on the Game Gear). They live in sms-python and megadrive-python and stay there; FluBBa's tests measure them, not the TI part. *Door kept open*: nothing; this core implements TI's parts only. The shared idea is the variant-as-data shape, not code. - **F18A, PICO9918 and other replacement chips.** FPGA or microcontroller boards that plug into the socket, run the same software and add their own extensions. Detectors of intended behaviour at best. ## Software libraries on disk (census, 2026-11-12) Counts of files; nothing was run over them. | Library | Where | Count | | --- | --- | ---: | | ColecoVision (No-Intro) | `$NO_INTRO_DIR/Coleco - ColecoVision` | 201 (Aftermarket folder empty) | | ColecoVision (curated) | `/colecovision` | 145 | | SG-1000 (No-Intro) | `.../No-Intro/Sega - SG-1000` | 247 | | SC-3000 (No-Intro) | `.../No-Intro/Sega - SG-1000 - SC-3000` (+ 5 Aftermarket) | 242 | | SG-1000 (curated) | `/sg1000` | 40 | | MSX (No-Intro, MSX1 and MSX2 mixed) | `.../No-Intro/Microsoft - MSX` (+ 7 Aftermarket) | 945 | | MSX1 (curated) | `/msx1` | 43 | | CreatiVision (No-Intro) | `.../No-Intro/VTech - CreatiVision` | 39 | BIOS for MAME runs: `coleco.zip`, `colecop.zip`, `adam.zip`, `ti99_4a.zip`, `svi318.zip`, `m5.zip`, `tutor.zip`, and the arcade sets `chboxing.zip`, `cliffhgr.zip`, `babypac.zip` are in `$MAME_ROMPATH`; `sg1000` needs none. The core itself needs no ROM: it is tested by register streams and directed tests. **No hardware-verified TMS9918 test ROM with a pass/fail screen was found** other than VATT (an MSX program; it reports lost writes per loop speed) and the factory diagnostics the boards already use (Coleco's Final Test Cartridge, Sega's SG-1000 M2 Check Program), which test a console, not the chip's corners.