Tick() ran the video scanner (Scan1) every CPU cycle even under a no-op Plotter: it computed the beam address, RamRead a byte, decoded text/lores/ hires, and did a last[row][col] compare — all purely to keep a2.lastRead (the floating bus) current and to feed a real Plotter. Headless (the Sargon driver's nullPlotter) renders nothing, so that per-cycle work is dead weight and was the dominant cost of the headless emulation loop. Add WithLazyVideoScan(): in headless mode Tick() skips Scan1 entirely, and EmptyRead computes the floating-bus byte on demand from the cycle counter. The Apple II beam position is closed-form (65 cycles/scanline, 262 scanlines/ frame), so no per-cycle state walk is needed; the byte the CPU sees on a floating-bus read is bit-identical to what the per-cycle scan would have latched (proven for every h,v and soft-switch config in floatingbus_test.go). The default (rendering) machine is unchanged: it still scans every cycle so the Plotter sees every byte and the latch stays current. address() is left byte-for-byte identical; scanAddress is a separate pure implementation the test proves equal. Measured on the Sargon III driver (boot + moves): ~1.9x wall-clock speedup (steady-state search 30.0x -> 57.3x realtime). Sargon plays bit-identically (RAM, screen, and cycle counts match across full A/B games); a poison experiment confirms it does not even depend on the floating-bus value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
goapple2
Apple ][+ emulator written in Go.
Install
go get -u github.com/zellyn/goapple2/{texty,shiny}
Status
Basic functionality (keyboard input, text, low and hires graphics) works.
Very basic (and fake) read-only disk access works, for .dsk images
where no trickery is involved.
This was one of my early Go-learning projects: the code organization is pretty horrible.
Shiny
This is the main "supported" interface, hacked together during hack day at GopherCon2016. It's almost certainly doing things wrong Shiny-wise: pull requests welcome. Press backquote/tilde to exit.
Texty
texty/ contains a hackish version of the emulator that runs in a
terminal. It interprets all videoscan outputs as text, regardless of
any other settings. Press ~ to exit.
Where to find ROMs
cd data/roms ./getroms.sh
Contributing
Pull requests welcome. If you have any questions, feel free to get in touch with me: username "zellyn" on gmail, twitter, facebook, github, golang slack.