# Domains and speed Read with the charter's "Domains and channels" and "Capabilities", and the accepted JIT proposal (emulator-lineage `docs/proposals/2026-11-jit.md`: the no-JIT path first). Every figure is either arithmetic from a stated clock or a MAME trace count (OBSERVED, `scripts/mame_trace.py`, files in `reference/mame/-/summary.txt`); the Rust throughput figures are planning estimates to be replaced by measurements. ## Domains ### M72 family | Domain | Holds | Clock | Why | | --- | --- | --- | --- | | **M: main** | V30, work RAM, program ROM, µPD71059, the video timing and the two tile layers, sprite RAM and its DMA, palettes, inputs | 32 MHz master: V30 /4, pixel /4 (8 MHz each) | the CPU and the pixel clock divide one crystal (i8086-python timing.md; MAME's 512-clock line); the CPU reads the raster only through the interrupt controller, so video could be split off for `-fast` threads (a channel at the raster interrupt and every video-RAM access), but the specification keeps them together | | **S: sound** | Z80, its 64 KB RAM (or ROM + RAM on the M84), YM2151, DAC and sample ROM | 3.579545 MHz crystal | own crystal (M84SCH sheet 7: X1 3.579 MHz) | | **P: protection** (MCU rows) | i8751 and its internal ROM | 8 MHz (MAME) | its own program; meets M only at the dual-port RAM and (U6) the sample port. Whether it has its own crystal is U20 | | Channel | From -> to | Mechanism | Sync point | | --- | --- | --- | --- | | sound latch | M -> S | an LS374 written by an I/O write (I/O 00h on the M72; M84SCH sheet 7) and its request line into the Z80's RST interrupt buffer | the write | | sound RAM window (R-Type) | M -> S | E0000-EFFFF reaches the Z80's RAM | every access; in practice the Z80 is held in reset while the V30 loads it (U5) | | sound reset | M -> S | a bit of I/O 02h (HYPOTHESIS) | the write | | YM2151 /IRQ | inside S | into the RST buffer | none | | dual-port RAM | M <-> P | MB8421: B0000-B0FFF on the V30, C000-CFFF on the MCU; mailbox interrupts at its top locations (U7) | every access to it | | interrupt lines | video -> PIC -> V30 | VBLK (IR0), raster compare (IR2), DMA done (IR1) | the line's time | ### M92 / M107 | Domain | Holds | Clock | Why | | --- | --- | --- | --- | | **C: main CPU** | V33, ROM, work RAM, µPD71059, inputs | V33 clock (9 MHz in MAME; U3) | | | **V: video** | GA21/GA22 (and the M107's extra layer), video RAM, buffer RAM, OBJ RAM, palette RAM, the raster | 26.6666 MHz (M92DOC `clock_gen`) | a crystal unrelated to the CPU's; the CPU reaches it through video RAM, the buffer-RAM DMA (IC42), the scroll and control registers, and raster interrupts | | **S: sound** | V35S, its ROM and RAM, YM2151, GA20, sample ROM | 14.31818 MHz (V35 at 7.16 MHz; YM2151 and GA20 at 3.579545 MHz = /4) | own oscillator (M92DOC `audio_cpu`) | Channels: the two sound latches (V33 -> V35 at A8044, V35 -> V33 read at I/O 08h, with interrupts on each side: U21), the sound reset, video-RAM and palette accesses, the DMA control writes (F9000), the raster and VBLANK interrupts. Three crystals, so three domains in one order of record in `x-python`; `-fast` may run S on its own thread (latches only), and V as a pure producer from a timestamped write log if no game reads video state back mid-frame. ## Instructions per second, with the arithmetic | Processor | Clock | Ceiling | Measured in MAME (frames 901-903, every instruction logged) | Need | | --- | --- | --- | --- | --- | | V30 (M72) | 8 MHz | 2 clocks minimum: 4 M instr/s | `rtype`, attract-mode play: 12,492-14,566 instructions per frame, 145,379-145,395 clocks per frame (all of it: no HALT), 11.0 clocks per instruction | 12,492-14,566 x 55.02 = **0.69-0.80 M instr/s** | | Z80 (M72 sound) | 3.579545 MHz | ≈ 0.9 M instr/s at 4 T-states | `rtype`: 8,064-8,131 instructions per frame in 65,050-65,060 T-states (= 3,579,545 / 55.02), 8.0 T-states each | 8,131 x 55.02 = **0.45 M instr/s** | | i8751 (M72 MCU rows) | 8 MHz / 12 = 0.667 M machine cycles/s | 0.667 M instr/s | `nspirit`: 8,064-8,065 instructions per frame in 12,115-12,117 machine cycles (= 666,667 / 55.02), 1.5 cycles each | 8,065 x 55.02 = **0.44 M instr/s** | | V33 (M92) | 9 MHz (MAME) | 2 clocks minimum: 4.5 M instr/s | `gunforce` title screen: 28,072-28,246 instructions per frame in 149,957-149,964 clocks (= 9 M / 60.01), 5.3 clocks each | 28,246 x 60.01 = **1.70 M instr/s** | | V35 (M92 sound) | 7.16 MHz (14.31818 / 2) | 2 clocks minimum: 3.6 M instr/s | `gunforce`: 15,725-15,730 instructions per frame in 119,276-119,291 clocks (= 7,159,091 / 60.01, which confirms the V35 runs at half its oscillator in MAME too), 7.6 clocks each | 15,730 x 60.01 = **0.94 M instr/s** | | V33 (M107) | 14 MHz | 7 M instr/s | not traced | at 5.3 clocks each, ≈ **2.6 M instr/s** | Every traced CPU is busy for the whole frame (idle loops, not HALT), so these are the real loads, not ceilings. Video: M72 8 M dots/s (512 x 284 x 55.02), 5.4 M visible pixels/s; M92 6.67 M dots/s, 4.6 M visible pixels/s. Sound: the YM2151 makes one sample per 64 clocks, 55.93 kHz, 32 operator slots each, 1.79 M operator steps/s; the GA20 is 4 channels. **Busiest cases.** An M72 MCU set: 0.80 + 0.45 + 0.44 ≈ **1.7 M instructions/s**, plus 8 M dots/s and 1.8 M FM operator steps/s. An M92: 1.70 + 0.94 ≈ **2.6 M instructions/s**. An M107: ≈ 2.6 + 0.94 ≈ **3.6 M instructions/s** (estimate). ## The no-JIT path | Target | Verdict | Why | | --- | --- | --- | | Desktop, Python (PyPy) | slower than real time, expected | 1.7-3.6 M instructions/s plus 7-8 M dots/s and 1.8 M FM steps/s is beyond a readable Python board; reference boards are correct, not fast (Aubrey) | | Desktop, Rust (`-rust`, then `-fast`) | real time with a large margin | ~2-4 M simple instructions/s and ~8 M dots/s are light for a compiled interpreter (the family's 6502/Z80/68000 Rust tiers run tens of M instructions/s: to be measured here) | | Phone, Rust `-fast` | real time expected, with run-ahead of 1-2 frames (Aubrey uses 1, sometimes 2) | the same arithmetic at a third of desktop speed | | Browser, wasm `-fast` | real time expected | as the phone; threads at the S channel help if needed | `recompile: none` is the stated capability for every row. Nothing here calls for a cached interpreter; threads at the sound channel are the first lever if a phone falls short, and the M92's video domain as a pure producer the second.