Downgrade

rom01

So I finally decided that since I had both motherboards laying around, perhaps it was time to revert to ROM 01, and at least evaluate its merits. I think I'm going to stick with it. I'm not sure that the performance difference from running tools out of ROM, or not loading them from mass storage, is subjectively all that great, and yeah I really did miss the Sales Demo, Shufflepuck Cafe, and Alien Mind. Yes, sound artifacts seem to be increased somewhat, the old familiar cadence of ROM 01 at idle in Finder was frighteningly recognizable from childhood, versus the quieter ROM 03. But that's the biggest difference. Nothing broke. And on a platform where nostalgia clearly matters, I felt it was prudent to aim for maximum compatibility.


To be honest, I tried it the other way, at first. I began stepping through the IIGS Sales Demo and finding out exactly what was breaking on ROM 03. The first hitch was easy enough to see: A BRK crash into E1/00A8, the inline-based GS/OS or ProDOS 16 dispatch vector. But the Sales Demo was written for ProDOS 8. The explanation is that in ROM 03, one of the tool startup calls (I didn't look far enough to see which, I hope it wasn't _QDStartUp) actually makes a GS/OS (or ProDOS 16) stack-based call, thus dispatched via E1/00B0, to open FastFont. E1/00B0 is set up at cold boot, to jump to a ROM-based subroutine that pulls the parameters off of the stack, and allocates new space on the stack to store a dynamically-generated subroutine to make a class-0 (inline) translation of the same OS call (presumably for greater compatibility), and dispatch that via E1/00A8.


Without commenting too deeply on the merits of that decision, I have to say that must have been a tough call for the firmware engineers to make, coupling the ROM tools that closely with the operating system. In the past, I've seen tool calls made from ProDOS 8 very often, and this appears to break them.


But it's an easy fix, right? Change E1/00A8 to something like 5C 00 00 30 6B, to JML to 30/0000, and at 30/0000, add something like:

  PLA

  CLC

  ADC #0006

  PHA

  SEC

  LDA #0046

  RTL


Pull the return address off the stack, increment it so the RTL will return to the address after the inline parameters, set carry to indicate error, and set A to $0046 (File Not Found). Fixes everything, right?


Nope. Things do get a few seconds farther, but it only leads up to another crash. But after pondering the number of patches I'd end up doing to make everything run, as well as the nature of ROM changes such as this, I decided to give downgrading a shot.


Oh, and the silly stuff I wrote back in high school that uses $C4xx on the mouse instead of _ReadMouse, magically works again. Ha.


-Chris