Stefan ArentzandClaude Fable 5 328671353d Add a slot 7 hard drive for ProDOS block images (boots Total Replay)
New ewm/src/hdd.rs: a virtual hard disk controller card, the device
every emulator adds for 32MB .hdv images. A 256-byte hand-assembled
firmware ROM at $C700 (assembly listing in comments, embedded like
DSK_ROM) speaks the ProDOS block-driver protocol — command/unit/buffer/
block in $42-$47, entry published at $C7FF — and pumps data byte by
byte through magic I/O ports at $C0F0-$C0FF, so blocks move over the
normal bus and the Device never touches machine RAM.

The Autostart ROM's slot scan (verified in 341-0020: it checks
$Cn01/03/05/07 = $20/$00/$03/$3C, slots 7 down to 1) finds the card
before the slot 6 Disk II, so 'ewm two --hdd image.hdv' boots straight
from the hard drive; without --hdd the card does not exist and floppy
boot is unchanged.

Writes persist: committed blocks go to the in-memory image and are
flushed to the .hdv file, so Total Replay preferences and high scores
survive restarts. Read-only files mount with writes failing as WRITE
PROTECTED ($2B).

Tests: port protocol, write persistence to the file, the firmware
driver called ProDOS-style (READ/WRITE/STATUS via JSR $C740), and a
full boot from a synthetic image through the Autostart scan. Total
Replay v6.0.1 verified booting to its menu (472 games detected).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 21:05:45 -04:00
2016-11-29 21:52:29 -05:00
2026-07-05 11:38:04 -04:00
2016-12-26 11:10:26 -05:00

Emulated Woz Machine

EWM is an emulator for the machines Steve Wozniak built: the Apple 1, the Replica 1 and the Apple ][+. It started life many years ago as a tiny 6502 emulator written between christmas and new year, and has since grown into a full emulator with Disk II support, graphics, and sound.

Note: EWM is a hobby project and still under development. Things may be incomplete, quirky, or broken — bug reports and pull requests are welcome. See REWRITE.md for the project's verification gates and a list of known quirks and deliberate divergences.

The EWM bootloader menu

Replica 1 running KRUSADER Apple ][+ booting DOS 3.3
Replica 1 — KRUSADER 1.3 from the Woz Monitor Apple ][+ — booting the DOS 3.3 sample programs disk
Frogger Bandits
Frogger in color hi-res graphics Bandits by Sirius Software

What's emulated

  • Apple 1 — 6502, 8KB RAM, Woz Monitor
  • Replica 1 — 65C02, 32KB RAM, KRUSADER assembler ROM
  • Apple ][+ — 6502, 48KB RAM, Apple Language Card, Disk II with two drives, a slot 7 hard drive for 32MB ProDOS block images (boots Total Replay!), 40-column text, low-resolution and high-resolution graphics (color or green monochrome), speaker sound, joystick paddles and buttons

Requirements

  • A Rust toolchain (the pinned version is in rust-toolchain.toml; rustup picks it up automatically)
  • SDL2 — brew install sdl2 on macOS, apt install libsdl2-dev on Debian/Ubuntu

Building

cargo build --release

Running

Running EWM with no arguments opens the bootloader, a menu where keys 1/2/3 select the machine to start:

cargo run --release

Or start a machine directly:

# Apple ][+ with color graphics and the DOS 3.3 sample programs disk
cargo run --release -- two --color --drive1 disks/DOS33-SamplePrograms.dsk

# Apple ][+ booting Total Replay from a ProDOS hard drive image
cargo run --release -- two --color --hdd "disks/Total Replay v6.0.1.hdv"

# Replica 1 (Woz Monitor + KRUSADER)
cargo run --release -- one --model replica1

# Classic Apple 1
cargo run --release -- one --model apple1

Each subcommand accepts --help for all options. Useful keys while the emulator runs:

Key Action
Cmd-Esc Reset the machine
Cmd-Return Toggle fullscreen
Cmd-P Pause (Apple ][+)
Cmd-I Toggle the status bar with drive lights (Apple ][+)

There are also headless terminal consoles, handy for quick experiments without a window:

cargo run -p ewm --example one                                  # Woz Monitor
cargo run -p ewm --example two -- disks/DOS33-SystemMaster.dsk  # AppleSoft / DOS 3.3

Testing

cargo test

This runs the full verification suite: the Klaus Dormann 6502 and 65C02 functional tests, golden instruction traces, headless machine boot tests, a complete DOS 3.3 boot with CATALOG, and a golden screenshot comparison. The cc65 assembly sources under tests/ are manual test programs for the machines themselves and are not part of the automated suite.

History

EWM was originally written in C and was ported to Rust in 2026 — the full phase-by-phase plan, parity checklist, and benchmark numbers are preserved in REWRITE.md. The original C implementation lives in the git history.

License

MIT, as declared in Cargo.toml (the same license the original C carried in its source headers).

S
Description
Emulated Woz Machine - Apple ][+ Emulator
Readme
4.4 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 95%
Lua 1.8%
Makefile 1.5%
Assembly 1.4%
CMake 0.3%