a slow access on a IIgs costs what the phase says, not always three
The Hardware Reference gives a best case and a worst and this modelled only the best: "if a single (8-bit) slow I/O read or write cycle is perfectly synchronized, it takes nearly three fast cycles to complete... if either a single or double slow cycle is not synchronized, the maximum delay for synchronization is one extra slow cycle" (Apple Computer, Inc., 1989a, p. 25). The mechanism behind those two sentences is that the processor is held until the Mega II will begin a cycle. So the cost is the distance to the next boundary plus a slow cycle: three when it arrives in step, four or five when it does not. A run of slow accesses stays in step because each one lands the clock back on a boundary, and a fast access in the middle is what knocks it out -- which is why an instruction that is all slow accesses costs the synchronised figure and one that mixes them does not. **The phase is discrete here and continuous on the machine**, and the comment says so rather than rounding quietly. A real IIgs runs 2.8 against 1.024, a ratio of 2.73, and its phase drifts through every value; this uses a whole 3 so that the processor and the video agree about how long a frame is, and a whole 3 gives the phase three values. What comes out is the shape of the variation rather than the exact sequence a particular machine would produce. Apple's own worst case is a round +3, being "up to one slow cycle" stated conservatively; the largest wait an integer 3:1 ratio can produce is 2. Two tests: every phase costing what it should, a run staying in step, a fast access knocking it out; and a machine held at 1.024 MHz having no synchronising to do at all, since then the whole machine is the Mega II's. Two existing tests wanted adjusting and both were asserting the old constant. A shadowed write now costs five rather than three because the read before it took the processor out of step, which is the case the manual gives a worst case for, so it asserts the range. And the IIgs 3.5-inch boot waits for its last line rather than expecting it on the spot: the machine is now honestly a little slower, so the menu finishes drawing a little later. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Aieuyb2KR2DsKyZWPJpas6