# Domains and speed ## Domains and channels | Domain | Contents | Channels | | --- | --- | --- | | **M** main | Z80, Dave's paging, waits, interrupts and strobes, Nick (LPT walk, video RAM, clock stretch), RAM, ROM, cartridge, keyboard | - | | **S** sound | Dave's tone, noise and amplitude synthesis | ports A0-AF (write-only) and the tone-generator interrupt source: if A7 selects a tone generator as the interrupt clock, M must know that generator's phase, so S's counter 0/1 state is shared (a channel M reads at each interrupt check; or the board keeps those two counters in M) | | **F** floppy | EXDOS's WD1770 and drives | ports 10h-1Fh; status reads are joins; stepped inside M in x-python | | **P** picture | Nick's pixel output | a pure producer from the video RAM write log and the LPT in fast tiers; in x-python Nick's fetch stays in M because it stretches the Z80 | Nick is in M because its slots set the Z80's stretched accesses; its pixel drawing can still be a producer beside M from x-rust-fast on. ## Instructions per second, with the arithmetic - Z80: 4,000,000 T/s (OBSERVED: MAME 4.00 MHz). A 312-line frame of 64 us lines is 19.97 ms, 79,872 T. MAME's trace ran 34,773 instructions in 239,997 T in three frame notifications (6.9 T per instruction during the boot's memory test). With Dave's M1 waits and video RAM stretches typical code runs at 7-10 T: **0.4-0.57 M instructions/s**. - Nick: 57 slots x 312 lines x 50 = **889,000 slot steps/s**, each two bytes of video RAM; up to 46 x 16 = 736 pixels a line in PIXEL 2-colour mode (about 11.5 M pixels/s as a producer, if a frame's every slot is drawn). - Dave sound: tone counters at 125 kHz granularity (f = 125,000 / (n + 1)), noise at 31.25 kHz: about **0.4-0.5 M counter steps/s** for three tones and noise. - WD1770: 31,250 bytes/s while a command runs. ## The no-JIT path A 4 MHz Z80 is close to the ColecoVision's 3.58 MHz (colecovision-python: 0.3-0.5 x real time CPython, 0.6-2.9 x PyPy, MEASURED there). Nick's slot walk is heavier than a TMS9918's per-line work but of the same order. Estimates, not measured: - **x-python**: roughly 0.25-0.45 x real time on CPython, 0.5-2 x on PyPy. - **x-rust**: real time on desktop, phone and browser with large margin (a sub-1 M instructions/s Z80 plus an 0.9 M slots/s video walk; compare the live z80-wasm board). - **x-rust-fast**: run-ahead and rewind room; Nick's picture as a producer thread only if a weak target measures the need. `recompile: none`.