# 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). Its family table puts era-1 machines ("2600, NES, Game Boy, SMS, Coleco, Atari 8-bit") at "one" domain, "every bus cycle is observable", JIT "no". The MSX1 belongs there. ## Domains (MSX1) | Domain | Holds | Clock | Why | | --- | --- | --- | --- | | **M: main** | Z80, the M1-wait logic, slots and every slot device (ROM, RAM, cartridges and their mappers, the SCC, the FM-PAC's OPLL), VDP, PSG, PPI, keyboard, joysticks, cassette pins | one crystal on the VDP, CPU = master / 3 (U2 per row) | every device is reached by the CPU's bus cycles at known clocks; a VDP port write lands in a TMS9918A access window by the cycle, so the CPU and VDP cannot be separated without the per-cycle order | | **D: disk drive** (once modelled at bit level, milestone B of disk.md) | FDC, drive mechanics, flux | the FDC's own crystal | own clock, meets M only at the FDC's registers and its DRQ/INTRQ lines; in the order of record it is stepped inside M at each register access (as the charter allows: the Sega CD's drive on the sub CPU's clocks) | | **T: tape** | the cassette signal source/sink | analogue | a pure producer/consumer of levels in time; it meets M at PSG port A bit 7 and PPI port C bits 4-5 | MSX2 adds no new domain (the V9938 shares the crystal; the RP5C01's 32.768 kHz is a counter computable from time). turbo R: the R800 and the Z80 share one bus (one at a time), the PCM is stepped in M; still one domain. ## Channels and sync points | Channel | Between | Sync point | | --- | --- | --- | | VDP ports 98-99h, /INT | inside M | every access (the core's access windows decide lost writes) | | FDC registers (7FF8-7FFF on the Philips-style interface), DRQ, INTRQ | M <-> D | every register access; INTRQ/DRQ edges computed ahead from D's schedule | | CSAR in, CASW/CASON out | M <-> T | none needed: T is a timestamped level stream | | Sound outputs (PSG, SCC, OPLL, key click) | M -> host | pure producers: synthesis from register writes logged with time | ## Instructions per second: the arithmetic - CPU clock 3,579,545 Hz. **Measured on MAME (tier 5, a detector of workload, not of hardware): 1,374,251 instructions in the first 3 emulated seconds of `cf2700` from reset = 458,000 instructions a second**, mean 7.8 clocks each including M1 waits (BIOS start-up and its VRAM clears: short instructions). Games run longer instructions; take **~0.4-0.5 M instructions/s** as the need. - VDP: 342 dots a line x 262 lines x 59.92 frames (NTSC) = 5.37 M dot clocks a second if stepped per dot (tms9918-python steps its memory schedule; its own speed is below). - PSG: 1.79 MHz input, internal steps at a sixteenth (112 k/s); SCC and OPLL at the bus clock with their own dividers (OPLL: one sample per 72 clocks, ym2413-python). ## Does the no-JIT path reach real time? | Target | Path | Evidence | Verdict | | --- | --- | --- | --- | | desktop, Python (the specification) | z80-python + tms9918-python + ay8910-python in one board | colecovision-python, the same Z80 + TMS9928A + PSG at the same clocks: PyPy 0.6-2.9 x real time, CPython 0.3-0.5 x (its docs/results.md); tms9918-python alone: PyPy 0.95 x with access windows on (its README) | about real time on PyPy; below on CPython. Reference boards are correct, not fast (Aubrey's rule): tests stay short | | desktop, Rust `-fast` | z80-rust-fast + transcriptions of the VDP and PSG cores | z80-rust-fast: 344 M instructions/s (its README, `cargo build --release`): ~700 x the need | far above real time; no cached interpreter, no threads needed | | phone (native, no JIT allowed) | the same `-fast` interpreter | a phone core is several times slower than the desktop above; the margin is two orders of magnitude | real time with run-ahead; `recompile: none` | | browser (wasm) | the same, compiled to wasm | the family's Z80 boards already run live in browsers (z80-wasm's Galaxian, play-md's Z80 side, play-2600) | real time; `recompile: none` | So the MSX meets every target with `recompile: none`: interpreter only, no cached interpreter, no threads. A `-turbo` would be built only if run-ahead on a weak device measurably needs it (whole-line VDP paths, as the 2600's). The disk domain (D) and sound synthesis are the only places threads could ever go, and nothing here says they will be needed. ## Capabilities to state (when built) Frame milliseconds per tier; snapshot size (64 KB RAM + 16 KB VRAM + registers + mapper state + SRAM: well under 128 KB for MSX1, up to ~1 MB for an MSX2 with a large mapper); deterministic save states, run-ahead and rewind: yes (one domain); threads: no; `recompile: none`; concessions: none planned.