A cycle-accurate Apple II and Apple IIgs emulator written in Zig, usable as both a program and a library.

document every function

Every function in src now carries a doc comment, and the instruction implementations carry references to both manuals. The references in the tree were to the MOS MCS6500 Family Programming Manual, not to the 6502 User's Manual, so the two are now named. Carr's book is a hardware interfacing text and puts its whole instruction reference in chapter 16, pages 245 to 277, which is a different shape from the MCS6500 chapter and section numbering already here. Left unlabelled the two would have read as the same scheme disagreeing with itself. Carr's chapter 16 has no entry for TAY, so that one says so rather than pointing at a page that does not discuss it, and the nine instructions that never had an MCS6500 reference still do not, since that manual was not to hand to check. The undocumented opcodes get descriptions but no references, being in neither book. Two things turned up while writing the comments. Registers.changed read self.cpu.timer, and neither field exists; like the 16-bit write fixed earlier it was never called, so it was never instantiated and never compiled. It now goes through getCPU and the clock, the way Flags.since always did, and has a test so it stays compiled. And decode.zig is documented as what it is: unreferenced, and older than the opcode table it would have to work against. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FawbWzEu5hoLLZSMCehUGP


Author jcollie.dev
Co-author Claude Opus 5 (1M context) Date Commit Parent 272f610b