Stefan ArentzandClaude Fable 5 6b143cbc3f Phase 1: 6502 core, passing the Dormann functional test
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>
2026-07-05 08:58:31 -04:00
2016-11-29 21:52:29 -05:00
2016-11-26 08:50:38 -05:00
2017-09-20 18:06:30 -04:00
2016-12-26 11:10:26 -05:00
2017-09-18 21:21:57 -04:00

Emulated Woz Machine

Build Status

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 support
  • 65C02 support
  • Tracing facility
  • Debugger
  • Speed throttling

Apple 1

8K / 6502 / Classic ROM

  • Terminal based emulation
  • Classic display emulation (SDL based)
  • Cassette interface

Replica 1

32K / 65C02 / KRUSADER ROM

  • Terminal based emulation
  • Classic display emulation (SDL based)
  • Cassette interface
  • CFFA1 Support

Apple ][+

48K / 6502

  • Basic Apple ][+ architecture implementation - In progress
  • Disk II emulation - In progress
  • Display Emulation - 40 Column mode
  • Display Emulation - Low resolution graphics
  • Apple Language Card
  • Joystick 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
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%