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

the Apple III's four slots hold cards, and the second card exists

Two things, and the first is a correction. This had `pub const profile_slot: u8 = 4` compiled into it, on the reasoning that the ProFile's manual says slot 4 and every SOS.DRIVER that came to hand agrees. Both are true and neither makes it a fact about the machine: slot assignment on an Apple III is *software*. The System Configuration Program's Peripheral Slot Assignment "enables you to tell each device driver the slot number into which you" put its card, "a number from 1 to 4", and a driver for something built in shows n/a instead (Apple Computer, Inc., 1981b, p. 17). A SOS.DRIVER built with the ProFile assigned elsewhere expects the card elsewhere, and a model with the slot compiled in could not follow. Four is now the default and not the law. So the machine has four slots and an array saying what is in each. **Not `slots.zig`** -- that is the Apple II's seven, and its cards are Apple II cards; a Videoterm in an Apple III would be a card the machine has no driver for and no business holding. What the two share is the `$c080 + s0` convention and nothing else, so four entries is the whole of the apparatus. An empty slot now floats at its ports and its window. That was already true of slot 4 and not of slots 1 to 3, which fell through to a case answering nought. The second card is the **Universal Parallel Interface Card**, Apple's A3L0009, built from chapter 6 of its manual with the eight addresses read off the page images rather than the scan's text. Two output latches, an input port, a write-only control register setting the strobe width and three polarities, two status flip-flops with an interrupt apiece, and autostrobe -- which comes on when the card's ROM space is touched and off at CLEAR, being there for Apple II emulation. The far end is a file and a file is never busy, so the acknowledgement a printer would send comes back at once and a driver that waits for ACK never waits; that is `parallel.zig`'s choice for the same reason. The manual disagrees with itself once and the disagreement is kept rather than quietly resolved: DATARDY's own entry says it turns the DATA READY status off, where the STATUS entry and the address-decode table both say on. Two against one, and a table of what the hardware does outweighs a sentence about it. `--slot 2=block` moves the ProFile and `--slot 3=parallel` places the UPIC, which are the same names that mean the same cards on a IIe -- a III's ProFile interface *is* its block device and the UPIC *is* its parallel printer card. Only the defaults differ, because a III has no slot 7. Eleven tests: seven on the card, four on the machine, including both cards on the bus at once not answering for each other, and a volume being taken away taking its interface card off the bus with it. What is **not** shown is a byte printed by SOS end to end: no SOS.DRIVER in the disk catalogue is built for a parallel printer -- .PRINTER on the Business BASIC disk reaches neither this card nor the serial port -- and making one means driving the System Configuration Program, which is a job of its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyUnXWJRv6j7Pt6MBMxexh


Author jcollie.dev
Co-author Claude Opus 5 (1M context) Date Commit Parent 2f52c283
+681 -38
5 changed files
+681 -38
5 changed files