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

give the IIgs its shadowing, and the screen something to show

Shadowing is the wire between the two halves of this machine. The display buffers are in banks $e0 and $e1, on the Mega II; every program written before the IIgs existed puts its display in bank $00, on the fast side; and without the duplicate write between them a IIgs shows nothing at all. Which is exactly what this was doing: eight million instructions and a blank screen. With it, the machine draws "Check startup device!" in the middle of the text page, which is the right answer from a machine whose disk port is empty and the first thing this model has ever put on a screen. A write to a shadowed address is made twice, once to fast RAM and once to the Mega II; a read is not, and comes from the fast side. That asymmetry is the point of the whole arrangement, and the manual is plain about the cost of it: "only write instructions to the video locations require the system to operate at 1.024 MHz". So a shadowed write is three fast cycles and a read of the same byte is one. Every bit of the Shadow register is an inhibit, and a reset clears the register, so a machine comes up shadowing everything. Two of the bits are not simply an area. Bit 4 names banks rather than a buffer: it takes the Hi-Res pages away from the odd banks alone. And bit 3 is the Super Hi-Res buffer, a single 32K span from $2000 to $9fff in the odd bank, which puts it over the top of the two Hi-Res pages -- so the two paths are separate and either one enabled carries the write. Which of the Mega II's halves a shadowed write lands in turned out to be the same question as which half $e1xxxx reaches, and the Hardware Reference answers both in one sentence. So megaHalf now decides it for both, and the bank-latch rule that was written inline in decode has a name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LSWNW9MMZZR2RyijsASzbS


Author jcollie.dev
Co-author Claude Opus 5 Date Commit Parent 29634bba
+326 -13
2 changed files
+326 -13
2 changed files