# 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). This page proposes the X68000's domains, channels and sync points and shows the instructions-per-second arithmetic for each target. Everything here is a proposal for the specification to confirm. ## Domains The X68000 has several clocks whose relationships are not established (U12, U25): the CPU's 10 MHz (16 MHz on the XVI), the CRTC's dot clocks (MAME: 38.86 MHz, and a 34.77 MHz screen clock, half of 69.55 MHz), the MFP's and OPM's 4 MHz, the FDC's 8 MHz, the SCC's 5 MHz and the RTC's 32.768 kHz (MAME's figures: OBSERVED). | Domain | Holds | Clock | Why one domain | | --- | --- | --- | --- | | **C: CPU** | the 68000, main RAM, the IPL ROM and CGROM, SRAM, the HD63450 DMAC (a bus master on the CPU's bus), the area set, the system port, the I/O controller, the MFP (its timers on their own 4 MHz clock but read and written every few instructions, and the interrupt controller for everything), the PPI | CPU clock (MFP 4 MHz converted inside) | the DMAC steals the CPU's bus cycle by cycle, and the MFP is polled constantly (10,444 MFP reads in the IPL's first 60 frames: OBSERVED), so splitting either off would put a channel on nearly every bus cycle | | **V: video** | CRTC, the video controller, CYNTHIA (sprites, BG), palettes, text and graphics VRAM, sprite/BG/PCG RAM | dot clocks | talks to C only through VRAM and register accesses (from the CPU or the DMAC) and three interrupt lines into the MFP | | **S: sound** | YM2151, MSM6258 | 4 MHz; ADPCM 4 or 8 MHz | talks to C through two register ports, the OPM's /IRQ, and the ADPCM's DMA requests; the OPM's CT outputs reach S itself (ADPCM clock) and D (FDC ready) | | **D: disk** | uPD72065 and the drives; the SASI interface and its target, or the MB89352 and its targets | FDC 8 MHz; SPC 5 MHz | talks to C through registers, DMA requests and the I/O controller's interrupt | | **K: serial devices** | the keyboard MCU (functional), the mouse (functional), the Z8530 SCC's line side | the serial bit rates | meets C at the MFP's USART and the SCC (bytes, at their arrival times) | | **R: clock** | RP5C15 | 32.768 kHz | its registers and the alarm line | The SCC's register side sits in C (the CPU reads and writes it); its line side meets K. K and R are trivial domains kept apart only because they have their own time. ## Channels (where domains meet) | Channel | From -> to | Mechanism | Sync point for | | --- | --- | --- | --- | | VRAM and register writes | C -> V | CPU or DMAC accesses to C00000-E7FFFF, E80000-E83FFF, EB0000-EBFFFF | every access (reads return what V holds; the raster copy and fast clear change VRAM by themselves) | | CRTC operations | V -> C | raster copy and fast clear progress flags read back through the CRTC | the operation's start and end times | | V-DISP, CIRQ, H-SYNC | V -> C (MFP GPIP 4, 6, 7) | interrupt and timer-input lines | the edge's time: C must not run past it; computable ahead from the CRTC registers | | OPM ports, /IRQ | C <-> S | E90001/E90003; /IRQ to MFP GPIP 3 | every access; the OPM timers' overflow times are computable ahead | | ADPCM | C <-> S | DMAC channel 3 requests at the sample rate; E92001 commands | each request time (fsample / 2 per byte); the rate set by PPI port C and OPM CT2 | | OPM CT1 -> FDC ready | S -> D | a latch output | the write's time | | FDC, hard disk | C <-> D | registers; DMAC channels 0 and 1 requests; the I/O controller's interrupt | every access; each DRQ time (16 us a byte on 2HD) | | keyboard, mouse | K <-> C | MFP USART bytes, SCC channel B bytes; the RTS strobe | each byte's arrival (about 4.2 ms a byte at 2,400 bit/s) | | RTC | R <-> C | registers, alarm to MFP GPIP 0 | access; the alarm edge | | interrupt switch | host -> C | NMI | the press | ## Sync points and code invalidation (the JIT proposal's four declarations) - **Sync points**: every channel above, plus interrupt sampling between instructions. - **Memory kinds and writers**: memory-map.md's last table. Code runs from main RAM (written by the CPU and by DMA from the FDC, hard disk and user channel) and from SRAM. - **Timing as data**: m68000-python holds the 68000's per-instruction clocks (its `step_clocks` and timing.md); the board adds wait states per region (U6). - **Restricted semantics**: applies to the CPU core, not the board. ## Instructions per second, and the no-JIT path **The need.** The IPL's first 60 frames execute 875,417 instructions in 10,740,642 CPU clocks (MAME trace, OBSERVED): 12.3 clocks an instruction, much of it a polling loop. A 68000 program averages roughly 8-12 clocks an instruction (HYPOTHESIS, the usual range for 68000 code with a 4-clock bus cycle), so: | Model | Clock | Instructions a second | | --- | --- | --- | | X68000 to PRO, SUPER | 10 MHz | 10 M / 12 to 10 M / 8 = **0.83-1.25 M** | | XVI, Compact | 16 MHz | 16 M / 12 to 16 M / 8 = **1.33-2.0 M** | | X68030 | 25 MHz 68EC030 | at 3-5 clocks an instruction with its caches (HYPOTHESIS), **5-8 M** | Video: 768 x 512 visible at 55.45 Hz is 21.8 M pixels a second, each composed from up to five sources (text, up to four graphics pages or one, sprites, two BG layers): about 110 M layer-pixel steps a second at worst (arithmetic). Sound: the OPM's 62.5 kHz x 32 operator slots = 2 M slot steps a second; the ADPCM at most 15.6 k samples a second. **What the tiers deliver** (measured elsewhere; the X68000 board has no code yet): | Tier | CPU | Against the need | | --- | --- | --- | | x68000-python (PyPy) | m68000-python: 1.39 M instructions a second (its validation.md, base loop) | the CPU alone near real time on a 10 MHz model; the video composition (21.8 M pixels a second) makes the board well below real time. Expected and accepted: reference boards are correct, not fast; test cases are short (the IPL screen, a floppy boot) | | x68000-rust-fast, desktop | m68000-rust-fast: 112-191 M instructions a second (its README) | 90-150x the 10 MHz need; the video at a few ns per layer-pixel is 0.1-0.3 s per emulated second single-threaded (HYPOTHESIS until measured) | | -fast, phone | assume a third to a quarter of this desktop (HYPOTHESIS): 30-60 M | still more than 25x the CPU need; video 0.3-1 s per emulated second at worst: tight in the heaviest graphics modes, so the V domain on its own thread (a register-write log, as the charter's "pure producers") is the planned margin | | -fast, browser (wasm, no JIT of our own) | m68000-rust-fast's reference loop "about 112 M instr/s under Node 22 on the i9 (native: 134 M)" (its README) | the same as desktop within 20 % | **Conclusion: `recompile: none` on every target for every 68000 model.** The no-JIT path's first step (Rust -fast) is enough for the CPU by two orders of magnitude; a cached interpreter is not needed; threads at the V channel are the only planned speed structure, for phones in the heavy graphics modes. The X68030 row at 5-8 M instructions a second with cache modelling is within a -fast interpreter's reach on desktop and likely on phones (to measure when that core exists). No turbo tier is foreseen.