Ports cpu.c, mem.c, and the 6502 half of ins.c to rust/ewm-core: - bus.rs: the Bus trait (replacing the mem_t linked list) and a flat 64K TestBus for the CPU test harness - cpu.rs: registers, separate raw-valued flag fields packed/unpacked only in status()/set_status(), stack ops with u8 sp wraparound, reset/irq/nmi (keeping the pc+1 interrupt push quirk the Dormann tests depend on), strict-mode stack overflow checks, and step() with pc advanced before handler dispatch - ins.rs: the 3-variant Handler arity enum, addressing-mode and RMW helpers ported expression-for-expression from mem.c (including the indx zero-page wrap and the indy non-wrap), ~200 handlers in ins.c source order, and the 256-entry table transcribed verbatim - tests/dormann.rs: the cpu_test.c harness (success PC $3399, branch-to-self deadlock detection) plus unit tests for status round-trip, stack wraparound, and the indexed-indirect quirks The Rust core executes 88,957,316 cycles for the functional test — exactly the C emulator's count. 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
Running the emulator
From the command line:
./src/ewm two --color --drive1 disks/DOS33-SamplePrograms.dsk
