Stefan ArentzandClaude Fable 5 f81a806906 Phase 2: 65C02, disassembler, and golden-trace harness
Completes the CPU core port:

- ins.rs: the 65C02 override handlers ((zp) modes, BRA, STZ, PHX/PHY/
  PLX/PLY, TRB/TSB, RMB/SMB, BBR/BBS, INC/DEC A, BIT imm/zpgx/absx,
  JMP (abs,X)) and the override table transcribed verbatim from
  instructions_65C02 — including its 1-cycle NOPs and the stray 0x03
  opcode fields. The table is overlaid onto the 6502 table once, the
  Rust version of cpu_initialize()'s back-fill. C's arity-cast NOPs
  become explicit nop_byte/nop_word wrappers.
- fmt.rs: cpu_format_state, cpu_format_stack, and the disassembler
  from fmt.c, bugs preserved (0x9c prints JMP; BBR/BBS targets are
  computed from pc+2).
- tests/dormann.rs: dormann_65c02 passes at $24a8 after 65,094,140
  cycles — exactly the C emulator's count.
- Golden-trace harness: scripts/gen-golden-trace.{c,sh} builds a
  capture program against the unmodified C sources and records the
  first 100k instructions of the functional test as normalized
  'PC A X Y SP P' lines; checked in gzipped. trace_compare.rs replays
  it on the Rust core and reports the first divergent instruction
  (currently: zero divergence). flate2 is a dev-dependency only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 09:12:29 -04:00
2016-11-29 21:52:29 -05:00
2016-11-26 08:50:38 -05: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%