XL1200-EMU Symbolics XL1200 Emulator

Host Runtime, GUI Workbench, s7 Scripting, Live Debug IPC & Snapshots

This document covers the Host Shell subsystem of emu/: OS portability (emu_os.h, emu_io.h, emu_ipc.h/emu_ipc.c), the 2-thread coordinator (main.c), SDL3 console & LED strip (sdl_console.c, keymap.c), microui workbench (ui_workbench.c), s7 Scheme machine configuration and call/cc automation (emu_script.c), live debug/puppet IPC (debug_ctl.c, scripts/xl1200-ctl.sh), and COW checkpointing / time-travel / sparse .snap persistence (snapshot.c).


1. Host Runtime & Portability Layer

Strict 2-Thread Execution Model (emu/src/main.c)

Interactive GUI sessions (ivory-xl1200) and --puppet sessions run with two threads sharing an EmuRuntime coordinator (emu/src/main.c):

  1. Main Thread:
    • Owns SDL3 window/renderer lifecycle (sdl_console_poll_events, sdl_console_prepare_frame, sdl_console_flush_present) and microui UI rendering.
    • Polls debug_ctl_poll for local socket/Named Pipe/TCP commands and serial_host_poll for host UART I/O.
    • Drains rt.pending_hooks (EMU_HOOK_BOOT, EMU_HOOK_HALT, EMU_HOOK_BREAK, EMU_HOOK_WATCH) and steps emu_script_tick() on the main thread so Scheme callbacks can safely access UI, config, and debug controls.
    • Evaluates GUI --script and --eval flags without holding rt.state_mu, using rt_lock_state/rt_unlock_state only around synchronous state access.
  2. Emulation Thread (emu_thread):
    • Sleeps on rt.wake_cv while dbg.powered_off, dbg.paused, cpu->halted, or while the Main Thread signals atomic_load(&rt.ctl_waiters) > 0.
    • Acquires rt.state_mu and executes IvoryCoreApi step chunks up to min(slice, rt.script_step_ceiling - cpu->instr_count) instructions, polling merlin_step_timers, SCSI/Ethernet/console DMA, and auto-checkpoints (ivory_ckpt_maybe_auto).
    • Releases rt.state_mu cleanly between slices so Main Thread UI rendering, Scheme tasks, and IPC inspection never contend on fine-grained per-instruction locks.

Separate synchronous entry paths (--steps N without GUI, --puppet without --headless vs continuous) share debug_ctl_run_budget and emu_script_tick.

Powered-Off Startup vs --autostart

By design (main.c), interactive GUI launches start powered off (dbg.powered_off = true, dbg.paused = true): the SDL3 window, top menu bar, and Machine Setup (automatically opened when firmware/config is missing or incomplete) appear first, and firmware loads only when the user clicks Power On (or triggers power-on over debug IPC).

Automatic immediate boot happens when any of these are true:

  • --autostart on the CLI, or :autostart #t inside (define-machine ...)
  • --headless, --puppet, --puppet-file, --puppet-stdio, --script, --eval, or --steps
  • --load <file.snap> (restores a powered-on machine snapshot; stays paused in GUI unless --autostart or non-interactive flags are passed)

CLI Flag Reference (EmuCliConfig in emu/src/main.c)

CategoryFlags
Firmware & Config--config <file.scm>, --script <file.scm> (repeatable), --eval <expr> (repeatable), --rom <path> (combined rom.dump or low chip 115988), --rom-hi <path> (high chip 115989), --kernel <file>, --nvram <file>, --load <file.snap>, --autostart
Memory & Clock--ram-mw <8|16|32|64|127|256>, --clock <auto|realtime|deterministic>, --idle-yield / --no-idle-yield, --mlock-state, --core-so <path>
SCSI Storage (IDs 0–6)--disk <img|spec> (RO), --disk-rw <path>, --disk-overlay <path>, --overlay-file <path>, --cdrom <iso>, --scsi-disk <id:path[:ro|rw|overlay]>, --scsi-cdrom <id:path>, --scsi-tape <id:path[:ro|rw]>
Ethernet & Serial--eth-user, --eth-net <cidr>, --eth-hostfwd <proto:hostport:guestport>, --eth-tap <if>, --eth-veth <if> / --eth-packet <if>, --eth-mac <xx:xx:xx:xx:xx:xx>, --serial-a <spec>, --serial-b <spec>
Display & Capture--headless, --overscan <trim|full>, --no-status-bar, --keymap <name> / --list-keymaps, --mouse-mode <capture|relative>, --record-y4m <path>, --dump-pbm <path>, --dump-panel-ppm <path>
Debug, Puppet & Snapshots--steps <N>, --break <addr>, --trace, --puppet <cmds>, --puppet-file <path>, --puppet-stdio, --debug-sock <path> / --debug-pipe <path>, --debug-tcp <[host:]port>, --no-debug-sock / --no-debug-pipe, --ckpt-interval <N>, --ckpt-max <N>, --ckpt-ttl <N>

POSIX & Win32 / MinGW-w64 Portability Layer

HeaderPurpose & Implementation Split
emu_os.hThread/sync (pthread on POSIX vs CRITICAL_SECTION, CONDITION_VARIABLE, _beginthreadex on _WIN32), monotonic clock (clock_gettime vs QueryPerformanceCounter), emu_aligned_alloc/free, emu_mlock/VirtualLock, dynamic core loader (dlopen/dlsym vs LoadLibraryA/GetProcAddress), emu_setenv, emu_unlink_file.
emu_io.hLarge-file >4 GiB offsets (emu_fseek64/ftell64/ftruncate64 -> fseeko/_fseeki64), thread-safe positional I/O (emu_pread/emu_pwrite -> POSIX pread/pwrite vs Win32 ReadFile/WriteFile with OVERLAPPED offset), atomic replacement (emu_atomic_replace -> rename vs MoveFileExA(..., MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)), _O_BINARY stdio helpers.
emu_ipc.h + emu_ipc.cNon-blocking EmuLocalServer (AF_UNIX SOCK_STREAM on POSIX vs overlapped Win32 Named Pipes \\.\pipe\ivory-xl1200-<pid>), dual-stack IPv4/IPv6 EmuTcpListener (IPV6_V6ONLY=0 on :: fallback to 0.0.0.0, Winsock2 WSAStartup on _WIN32), unified EmuEndpoint (>0 bytes, 0 would-block, -1 EOF/error).

2. SDL3 Console, Overscan, LED Strip & Y4M Recorder

Implemented in sdl_console.c and keymap.c:

  • Resizable Letterboxed Viewport: Renders the 1-bit monochrome XL1200 VRAM (1152x896 full raster, 36 32-bit words/line) as an SDL_PIXELFORMAT_ARGB8888 streaming texture with aspect-ratio-preserving letterboxing below the 28 px top menu bar (or full window height in fullscreen F11).
  • Overscan Modes (:trim vs :full):
    • :full: renders the full 1152x896 framebuffer (1152x924 when the 28 px LED bezel is enabled).
    • :trim: crops the Genera dark overscan border to the active 1084x812 console region (1084x840 with LED bar). Toggleable live via View -> Toggle Overscan Trim or :overscan / --overscan.
  • Passive XL1200 Status LED Bezel (XL1200_STATUS_BAR_HEIGHT = 28 px): Mirrors physical front-panel telemetry without interactive controls inside the bezel (render_status_bar_snap in sdl_console.c):
    • PWR: PANEL PWR (green when powered on; amber when powered off)
    • MAIN CPU: FAULT (red), RUN (green), U1, U0 (Merlin-II diagnostic LEDs <3:0>)
    • I/O BOARD: +12V (green when powered on), RCV (amber, serial/eth RX activity), CD (amber, carrier/net), XMT (amber, TX activity), SCSI (green, WD33C93 activity)
    • Right-Side Pills: CPU execution state (POWER OFF, HALTED, PAUSED, or RUN), CAP / REL mouse mode, active keyboard mapping tag (KM:<badge>), and REC indicator while .y4m recording is active.
  • 1:1 Mouse Capture & Uncaptured Fallback:
    • Clicking inside the active VRAM rectangle while powered on and running enters SDL_SetWindowRelativeMouseMode(true) (CAP), forwarding relative (dx, dy) + 3-button (L/M/R) packets directly to console_hw.
    • Pressing Right Ctrl (R-Ctrl) releases capture cleanly without passing the modifier to the guest.
    • Pausing the CPU or opening a UI menu automatically releases relative mouse mode.
  • Multi-Profile Keyboard Mapping Engine (ivory_keymap.h, keymap.c):
    • Translates host SDL3 scancodes into physical Symbolics SLB press/release packets (0..0127) across 9 selectable profiles (IVORY_KEYMAP_COUNT = 9):
      1. xl1200 ([XL]) — Symbolics XL1200 / Lisp Machine layout
      2. nxp-default ([NXP]) — Default X/Genera workstation mapping
      3. ncd-n101 ([NCD]) — NCD N101 X terminal
      4. nds ([NDS]) — NDS terminal mapping
      5. sun-type-4 ([SUN4]) — Sun Type 4 workstation keyboard
      6. sgi-iris ([SGI]) — SGI IRIS keyboard
      7. pc-101 ([PC]) — Standard PC-101 layout (default modifier/bucky ergonomics on modern PCs)
      8. mac-ext ([MAC]) — Apple Extended Keyboard
      9. nxp-ascii ([ASC]) — ASCII key-sequence mode with one-shot bucky modifier arming (Shift/Ctrl/Meta/Super/Hyper/Symbol)
  • Async YUV4MPEG2 (.y4m) Video Recorder (Xl1200VideoRec):
    • Writes standard YUV4MPEG2 W<w> H<h> F<fps>:1 Ip A1:1 C420mpeg2 headers (fps clamped to 1..60, default 15, including the LED bezel when enabled).
    • Double-buffered 2-slot VRAM snapshot ring (VIDEO_REC_RING_SLOTS = 2) offloads ARGB -> BT.601 YUV420 planar conversion and disk writes to a dedicated worker thread so video capture never stalls CPU stepping or UI rendering.

3. microui Workbench UI (ui_workbench.c, ivory_ui.h)

The immediate-mode overlay uses vendored rxi/microui v2.02 rendered into an SDL3 texture atlas with embedded antialiased proportional typography (15 px Normal and toggleable 18 px Large UI Font in emu/include/ui_font_atlas.h) via a 28 px (XL1200_TOP_MENUBAR_HEIGHT) top menu bar and 6 draggable, resizable floating windows:

Top Menu Bar (ui_draw_top_menubar, hidden in F11 Fullscreen)

  • Menus:
    • Machine: Configure Machine..., Open Config (.scm)..., Save Config, Save Config As..., Power On / Pause / Resume, Send NMI (Drop to FEP), Warm VME Reset, Cold Power Reset, Quit
    • Media: Configure SCSI Disks... (opens Machine Setup on the Disks & SCSI tab), Disk & Image Tools..., Insert / Swap CD (ID 4)..., Eject CD-ROM (ID 4), Insert Tape RW (ID 5)..., Insert Tape RO (ID 5)..., Create Blank Tape..., Eject Tape (ID 5)
    • Net & Serial: Network & Serial...
    • Actions: dynamic buttons for every (define-action ...) registered in s7 (showing [hotkey]), Load Script (.scm)..., Cancel Running Actions
    • Debug: Debug & Snapshots..., s7 Lisp REPL..., Save Snapshot..., Load Snapshot..., Save Screenshot..., Video Recording..., Save Bug Dump (.zip)..., Hot-Reload Core
    • View: Toggle Fullscreen (F11), Toggle Overscan Trim, Toggle Status LED Bezel, Large UI Font (18px) toggle, Video Recording..., Keyboard Mapping... (opens the 9-profile TOP_MENU_KEYMAP picker)
  • Quick Controls: | Stop Task (shown while Scheme coroutines are active), crimson Stop REC mm:ss (shown while .y4m video recording is active for one-click stop with live elapsed time), Bug Dump (one-click single-archive .zip bug report saver pre-populated with ivory-bug-report-YYYYMMDD-HHMMSS.zip), Power On / Pause / Resume button, KM:<badge> quick keymap selector, and live status hint (Setup Machine to Boot, Powered off (Power On), Paused (Click Resume), Click screen to capture, or recent toast).

6 Floating Workbench Windows

  1. Machine Setup — Three tabs (Open .scm..., Save, Save As..., Save & Power On):
    • [Identity & NVRAM]: Machine name, Merlin Main/IO serials, IO part number, Main/IO revisions, Sony Monitor toggle, Symbolics MAC (08:00:05:..) with Gen Symbolics MAC button, NVRAM file picker (Browse...), Historical RTC year override, and Save NVRAM Now.
    • [Firmware & Memory]: Boot PROM low (115988 or combined rom.dump), Boot PROM high (115989), IFEP Kernel, RAM preset buttons (8 MW / 16 MW / 32 MW / 64 MW), Realtime Microsecond Clock, CPU Idle-Yield Power Saving, and Overscan Trim (1084x812).
    • [Disks & SCSI]: Targets 0–6 (FEP Units 7–13) SCSI image assignments (Empty / Disk / CD-ROM / Tape, RW / RO / Ovl mode, path textbox + native Browse... + Clear, optional .ovl overlay file path, Apply Disk Changes Live, and 2-click Commit Ovl / Reset Ovl for active overlays).
  2. Disk & Image Tools — Active attached SCSI summary with shortcut to Machine Setup -> Disks & SCSI, 2-click overlay commit/reset for active overlays, and the embedded FEPFS & Disk Image Toolkit (create initialized XL1200 FEPFS disk, create blank disk/tape, inspect image metadata including APM/HFS hidden volume inventories, and Convert MacIvory..., which automatically discovers and saves all MacIvory FEPFS volumes inside raw, Apple Partition Map, or Classic HFS images as <base>_<vol><ext>).
  3. Network & Serial — Network backend mode (None, User NAT (slirp), Linux TAP), CIDR, host port-forwarding rules, and Serial A/B (none, tcp-listen:<[a]:port>, tcp:<[a]:port>, pipe:<name_or_path>, file:<path>) for the Signetics SCN68562 DUSCC Ch.A & Ch.B attach/apply controls.
  4. Debug & Snapshots — 4-tab live symbolic debugger and checkpoint workbench:
    • [Overview & Controls]: Live PC/SP/FP/LP/LED/instr_count readout, Save Bug Dump (.zip)..., Save .snap... / Load .snap..., Video Recording... / Stop .y4m Rec, Screenshot... (.pbm/.ppm), Reload Core, COW checkpoint table (Take, Restore, Pin, Del, auto-interval/max/TTL, Rewind -1, Goto instr), and Breakpoints (0..7) + VMA/PMA Write Watchpoints (0..3).
    • [Registers & State]: Full Ivory Rev 4 CPU registers, BAR0–3, US-CLK/PREEMPT, ZONE-OLD/EPH-OLD, W3x64 FPA status, and decoded active trap context (trap_mode, vector, handler, Rev 4 microstate).
    • [Disassembly & Stack]: Live 40-bit disassembly around PC (or custom VMA) in human or canonical Lisp S-expression mode (ivory_disasm.c) alongside a symbolic control-stack backtrace (ivory_sym_walk.c) with resolved Genera function names.
    • [Memory]: Side-effect-free VMA/PMA memory and Genera tagged object inspector.
  5. Video Recording — Dedicated YUV4MPEG2 (.y4m) capture controls: live resolution/FPS/frame-count/duration telemetry, output path textbox + Browse... (pre-filled with ivory-video-YYYYMMDD-HHMMSS.y4m, auto-appending .y4m), FPS preset buttons (10, 15, 24, 30, 60) + custom 1..60 FPS input, live capture geometry checkboxes (Trim Overscan Border, Include Status LED Bezel), Start Recording / Stop Recording + Save As & Start..., and an ffmpeg MP4 conversion hint.
  6. s7 Lisp REPL — Scrollable evaluation transcript, textbox with SDL_StartTextInput focus, Ctrl+V clipboard paste, Ctrl+C copy of current input, and Up/Down command history recall.

Single-Archive Beta Bug Report (ivory_bug_report.h, bug_report.c)

Clicking Bug Dump in the top menu bar (or Debug -> Save Bug Dump (.zip)..., Debug & Snapshots -> Save Bug Dump (.zip)..., or running bug-report [path.zip] over live debug IPC) writes a single standard DEFLATE-compressed .zip archive atomically with zero external CLI or compression library dependencies:

  • README.txt — manifest and privacy notice for beta testers
  • report.txt — UTC timestamp, host/build/CPU accel tier, full Ivory Rev 4 CPU & W3x64 FPA registers, decoded active trap context (mode, vector, handler, Rev 4 microstate), non-zero scratchpad, symbolic disassembly window around PC, control stack window with Genera object summaries & 16-frame symbolic backtrace, Merlin-II/PIT/SCSI/Ethernet/Console/VRAM/Serial/Checkpoint diagnostics
  • config.scm — privacy-sanitized machine configuration (local directory prefixes stripped to basenames)
  • screen.ppm — XL1200 VRAM + front-panel LED strip screenshot
  • nvram.bin — raw 2 KiB Mostek MK48T02 NVRAM dump
  • state.snap — sparse binary machine snapshot (when powered on; load directly via ivory-xl1200 --load state.snap)

Input & Native File Dialog Safeguards

  • Native SDL3 File Dialogs: SDL_ShowOpenFileDialog and SDL_ShowSaveFileDialog run asynchronously on SDL's worker thread and enqueue results that ui_drain_dialog_result() safely consumes on the Main Thread inside ui_overlay_render().
  • Text-Input Focus Gate: SDL_StartTextInput activates only when a microui textbox holds focus and hardware mouse capture is inactive, preventing desktop dead-keys or text events from bleeding into Lisp keyboard scancodes.
  • Dropdown Click-Through Guard: Clicking outside an open menu dropdown dismisses it (last_click_dismissed_menu = true) and consumes that mouse-down event (ui_overlay_allow_mouse_capture returns false), so closing a menu never accidentally captures the mouse cursor into Genera.

4. s7 Scheme Config & Cooperative Workbench (emu_script.c, ivory_script.h)

(define-machine ...) S-Expression Schema

Machine configurations (see emu/xl1200.scm.example) are real s7 Scheme files loaded before emulation starts:

(define-machine
  :name         "Symbolics XL1200"
  :serial       1042
  :mfg-days     4520
  :io-serial    2042
  :io-part      1200
  :io-rev       '(2 1 0)
  :monitor      :philips
  :mac          "08:00:05:11:22:33"
  :nvram        "xl1200-nvram.bin"
  :rtc-offset   (emu/rtc-year 1993)
  :ram-mw       8
  :rom          '("../ivory-fep-roms/fep330/115988-e.bin"
                  "../ivory-fep-roms/fep330/115989-e.bin")
  :kernel       #f
  :snapshot     #f
  :clock        :realtime
  :idle-yield   #t
  :autostart    #f
  :overscan     :trim
  :keymap       :pc-101
  :mouse-mode   :capture
  :scsi         '((0 :disk "genera-sys.dsk" :mode :overlay :overlay "genera-sys.ovl")
                  (4 :cdrom "genera-8-3.iso"))
  :net          '(:mode :user :cidr "10.0.2.0/24" :hostfwd ("tcp:2023:23"))
  :serial-a     "none"
  :serial-b     "none"
  :debug-local  #t
  :debug-tcp    #f
  :ckpt         '(:interval 0 :max 64 :ttl 0))

Supported :rom forms: a single string ("rom.dump" or "115988-e.bin" with automatic 115989 sibling probing), a 2-element list '("115988-e.bin" "115989-e.bin"), or #f. Optional :eco #x..., :kernel, :snapshot, and :autostart #t are also persisted when configured.

Surgical Byte-Span Save Config

When saving from the GUI (Machine -> Save Config / Machine Setup -> Save Config), emu_script_save_machine_config locates the exact top-level (define-machine ...) S-expression span in the original .scm file (find_top_level_define_machine_span), rewrites only that span atomically via .tmp + emu_atomic_replace, and preserves all surrounding comments, (define-action ...), (emu/on-boot ...), and custom Scheme helpers verbatim.

(define-action ...) & Pure-Scheme call/cc Cooperative Scheduler

User-defined macros in .scm files register GUI menu items + hotkeys in the Actions menu:

(define-action quick-checkpoint (:label "Take Checkpoint" :hotkey "F5")
  (emu/cmd "ckpt take quick"))

Non-blocking automation uses pure Scheme first-class continuations (call/cc) in the g_s7_prelude (emu_script.c):

  • (emu/spawn label thunk) and emu/yield-until suspend tasks in *emu-tasks* and compute the earliest target instruction count (*emu-script-step-ceiling*) via emu/%recompute-ceiling!.
  • In continuous GUI/runtime execution, emu_thread runs uninterrupted up to that ceiling (rt.script_step_ceiling), then main ticks ready tasks via emu_script_tick(), resuming each continuation seamlessly without blocking SDL events or UI frames.
  • In --steps / synchronous runs (*emu-yield-esc* is #f), emu/yield-until falls back to emu/%run-sync-until! using emu/%sync-step!.
  • Exposed primitives include:
    • State, registers & symbolic inspection: emu/state, emu/pc, emu/instr-count, emu/halted?, emu/paused?, emu/reg, emu/vma, emu/pma, emu/word, emu/disasm, emu/bt-sym, emu/inspect, emu/trap-info
    • Execution & resets: emu/pause, emu/resume, with-paused-cpu, emu/nmi, emu/warm-reset, emu/power-reset, emu/nvram-save
    • Waits & automation: emu/wait-steps, emu/wait-until, emu/wait-pc, emu/wait-leds, emu/wait-vram-change, emu/wait-vram-stable, emu/wait-genera-idle, emu/cancel-task!
    • Input & media: emu/key, emu/type-line, emu/send-keys, emu/mouse, emu/serial-set, emu/overlay-commit, emu/overlay-reset, emu/fep-info, emu/fep-create, emu/rtc-year
    • Hooks & escape hatch: emu/on-boot, emu/on-halt, emu/on-break, emu/on-watch, emu/cmd (dispatches any debug_ctl line command synchronously)

5. Live Debug IPC, Puppet Mode & Time-Travel Snapshots

Unified DebugCtlSink Transports (debug_ctl.c, scripts/xl1200-ctl.sh)

Every command handler writes into a unified DebugCtlSink spanning four frontends simultaneously:

  1. Local socket / pipe (enabled by default unless --no-debug-sock / :debug-local #f):
    • POSIX: AF_UNIX stream socket /tmp/ivory-xl1200-<pid>.sock (cleaned up on exit)
    • Windows: Win32 Named Pipe \\.\pipe\ivory-xl1200-<pid>
  2. Dual-stack TCP listener (--debug-tcp [host:]port or :debug-tcp): 0.0.0.0:port / [::]:port via EmuTcpListener.
  3. Puppet mode (--puppet "<cmds>", --puppet-file, --puppet-stdio): semicolon/newline script execution against the exact same parser.
  4. s7 bridge (emu/cmd "..."): direct in-process invocation without socket overhead.

Client convenience helpers: ./scripts/xl1200-ctl.sh [--list | --sock PATH] [COMMAND...] (POSIX shell) and python3 scripts/xl1200-ctl.py [--list | --sock PATH | --pipe NAME | --tcp HOST:PORT] [COMMAND...] (cross-platform Linux/macOS/Windows; see docs/TROUBLESHOOTING.md).

Live Debug Command Reference (debug_ctl.c help)

GroupCommands
Execution & Statestate / status, pause, cont / resume, step [N], wait-vram <max> [chunk], nmi, reset, power-reset, power-on, quit
Breakpoints & Watchpointsbreak <hex> / del <hex> / clear / list (up to 8 VMA breakpoints); watch pma|vma <hex> / list / clear [idx] (up to 4 write watchpoints)
Symbolic Debug & Profilingregs, disasm [--lisp] [vma] [count], bt [max_frames], bt-sym [max_frames], inspect <hex_vma>, trap-info, mem <hex_vma> [count], pma <hex_pma> [count], hw, sample [N] (top-16 hot PCs), sample-sym [samples] [step_k] [out.folded] (top-20 hot functions + flamegraph export), bug-report [path.zip], trace on|off
Hardware & Settingsclock [realtime|deterministic], idle-yield [on|off|status], keymap [status|list|set <name>], scsi ..., disk ..., serial ..., reload [path]
Input & Media Capturetype <text>, key <name>, keydown <name>, keyup <name>, mouse <dx> <dy> [btn], serial-rx <ch> <hex>, record start <path> [fps] | stop | status, dump <path.pbm>, dump-panel <path.ppm>
Checkpoints & .snapckpt [take [lbl]|list|config|purge|pin|unpin|del|clear], rewind [id|-N], goto <instr>, save <path>, load <path>

COW Checkpoints, Deterministic Replay & .snap Binary Format (snapshot.c, ivory_snapshot.h)

  • 256-Word COW Dirty-Page Checkpoints (IvoryCheckpointStore): Checkpoints deduplicate unmodified 256-word Ivory pages across RAM/VRAM/ROM/SCSI overlays using page-hash refcounting, tracking unique page memory and eviction via --ckpt-max / --ckpt-ttl / pin.
  • Deterministic Input Replay (rewind / goto): Keyboard packets, mouse deltas, serial RX bytes, NMI, and warm resets are logged against cpu->instr_count in store->input_log. goto <instr> locates the nearest preceding checkpoint and deterministically replays logged hardware inputs step-exact up to the requested instruction count.
  • Sparse .snap Binary Format (IVORY_SNAP_MAGIC = 0x59525649, "IVRY", v1):
    • 24-byte header: [magic:u32, version:u32, payload_size:u64, fnv1a_64(payload):u64]
    • Payload: struct/size guard metadata -> host-pointer-sanitized IvoryCpu, MerlinBoard, boot_comm, map_cache -> io_sram & scsi_io_buf -> sparse non-zero 256-word pages for boot_prom, ram, and vram -> per-target sparse SCSI overlays -> deterministic IvoryInputEvent log.
Related Chip Datasheets (7)All Component Datasheets →