# M4: the live DOSBox seam — design note (2026-07-19) The last milestone of GPU-RETARGET.md: the decoded renderer running live behind the game. All gates are now open: geometry = emu860c (351×, checkpoint-perfect), raster = the GPU tile path (M1/M2 conformant), spec = igc_conformance. ## The loop ``` DOSBox-X (FLYK.EXE etc., unmodified) │ port I/O 0x150-0x161 (C012 link) [VELOCIRENDER_PROTOCOL.md §7] ▼ virtual C012 link device [NEW — small FSM] │ byte stream ⇄ message assembler (§1-§2 framing, verified vs real EXE) ▼ protocol server (Python, exists as emu_main) [boot handshake done] │ wire commands -> the firmware receive path ▼ emu860c: VREND.MNG geometry stage [DONE — real-time 3.5×] │ per-draw DMA stream + payload programs (captured live from C memory) ▼ igc_gpu frame loop: tile dispatch + readout [DONE for fixtures] │ RGBA frame ▼ present: (a) vr_readpixels reply -> host SVGA [FLYK readback path] (b) or the render-bridge window [existing live_bridge seam] ``` ## What exists vs what's new | piece | status | |---|---| | Wire protocol + framing | verified against the shipped EXE (protocol doc §9) | | Boot handshake (iserver ×3, BTL/MNG swallow) | implemented in emu_main | | Geometry at real-time | **emu860c** — done | | DMA-stream capture at draw time | the send_capture pattern — port the w32 tap into emu860c (a C-side write-watch range on the queue pages, cheap) | | Tile raster on GPU | igc_gpu / igc_gpu_frame — done for fixtures | | Texel path (TXDN) | the remaining spec item (M3) — effects/bench render without it; texture-mapped content needs it | | C012 DOSBox device | NEW: six ports + byte FIFO in DOSBox-X (protocol §7 calls it "bounded and testable in isolation") | | Present path | reuse render-bridge/live_bridge (frozen renderer window) or implement vr_readpixels for FLYK's own SVGA display (§6: "expected") | ## Sequencing 1. **M4b — offline end-to-end**: wire capture in, frames out, no DOSBox: emu860c runs a mission, the C-side DMA tap feeds igc_gpu_frame per draw, frames dump to disk. Validates the whole chain at speed. (next) 2. **M4c — the C012 device** in DOSBox-X + the protocol server as a socket bridge (the emulator process stays Python+C+GPU; DOSBox talks to it over a local pipe — same shape as the existing namedpipe serial work). 3. **M4d — present**: vr_readpixels or the bridge window; frame pacing. 4. M3 texel path lands whenever the TXDN spec closes — orthogonal.