- Benches: cpu_bench.c and mem_bench.c ported as plain std::time
cargo benches (harness = false, no criterion), same output formats
so C and Rust numbers compare directly. The mem addressing helpers
in ins.rs become pub, mirroring mem.h. Numbers recorded in
REWRITE.md: parity or better on most paths (Rust ADC 2x faster,
JSR 1.7x faster; ind* modes ~2.5x slower from dyn Bus dispatch —
all orders of magnitude beyond the 1.023 MHz requirement).
- --trace wired end to end: Cpu grows a trace sink written before
each step via the fmt.rs formatters ('PC: disassembly state');
both frontends open it from --trace[=file]. In C the write path
was dead code — recorded as a documented divergence. Unit-tested
against exact expected lines, and smoke-tested (767k lines from a
3s replica1 run, matching the Woz monitor reset sequence).
- --strict audited: accepted but inert at runtime in both C and Rust
(the only runtime caller of irq/nmi discards the error) — recorded
as quirk #7.
- REWRITE.md: flag-by-flag and feature-by-feature parity checklist,
a new 'Documented divergences' section (exact --flag parsing, no
PC in unexpected-I/O messages, frame-sampled joystick, working
--trace, Rust-only --screenshot, the skipped dsk.c OOB write,
no Lua), bench numbers, Phase 8 -> Done.
- README: 'Building the Rust version' section.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Emulated Woz Machine
Introduction
Two years ago between christmas and new year I wrote a tiny and incomplete 6502 emulator and turned it into an original Apple 1 emulator. It was a fun and nostalgic project to work on. I grew up with the Apple II and never had a change to see an Apple 1 in action.
A few weeks ago I decided to pick this project up again. I am extremely motivated to turn this into a high quality emulator that supports the Apple 1, Replica 1, Apple ][+ and Apple IIe. Some of that work is really close to being finished, other work will take many months of spare time hacking.
Note: A Rust rewrite is in progress; see REWRITE.md. The C build below remains the primary build until the rewrite completes.
Goals & Status
Here are some of the things I want to accomplish for each emulated machine:
CPU Emulator
6502 support65C02 supportTracing facility- Debugger
- Speed throttling
Apple 1
8K / 6502 / Classic ROM
Terminal based emulationClassic display emulation (SDL based)- Cassette interface
Replica 1
32K / 65C02 / KRUSADER ROM
Terminal based emulationClassic display emulation (SDL based)- Cassette interface
- CFFA1 Support
Apple ][+
48K / 6502
Basic Apple ][+ architecture implementation - In progressDisk II emulation - In progressDisplay Emulation - 40 Column modeDisplay Emulation - Low resolution graphicsApple Language CardJoystick Support- Audio Support
- Display Emulation - High resolution graphics - Mostly works.
Building the emulator
cd src
make
Building the Rust version
The Rust rewrite (see REWRITE.md) is at feature parity with the C build, minus Lua scripting:
cd rust
cargo build --release
cargo run --release -p ewm -- two --color --drive1 ../disks/DOS33-SamplePrograms.dsk
cargo test runs the full gate (Dormann CPU tests, golden traces, machine
boot tests, DOS 3.3 boot, golden screenshot). Headless consoles for quick
experiments: cargo run -p ewm-core --example one (Woz monitor) and
cargo run -p ewm-core --example two -- ../disks/DOS33-SystemMaster.dsk
(AppleSoft/DOS).
Running the emulator
From the command line:
./src/ewm two --color --drive1 disks/DOS33-SamplePrograms.dsk
