Hot Rod
unread,Aug 30, 2012, 6:24:20 PM8/30/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Greetings,
I ran across another old Apple program ('Moptown Parade') that works on a real Apple //e, but a .dsk image did not work on AppleWin (1.20.0). The cause is a bit different, so thought I'd share.
After checking the usual suspects (volume number, hardware checks), I'll admit I got stumped. So, I reached out to Brendan Robert to see if he could try it on JACE, and perhaps shed any more light on what was happening. Brendan reported that it also failed (initially) on JACE in the same way I was seeing, but then through some masterful keystrokes, was able to get it to run. He happened upon invoking both HGR and HGR2, and then doing a warm-boot. That allowed it to work correctly, and I was also able to repeat that success with AppleWin.
So armed with that info, it seemed that something in the hi-res memory was tripping things up, and Brendan was able to point out addresses that narrowed it down, based on how RAM was init'd with a FF FF 00 00 pattern.
I did a search for #$FF in the range of $4000-$6000, and found a lone value of #$FF at $5500. By setting it to #$00, the program ran fine. That explained the what, but not the why.
Now, some background. Moptown Parade boots by running a binary HELLO program at $9000, which in turn uses direct RWTS calls to load its title screen into hi-res page 1, and then copies chars directly to the keyboard buffer to load some shape info files and then ultimately run the BASIC menu program. It was this BASIC program that was bombing out with a SYNTAX ERROR, when running in the emulator. Works great on a real Apple //e though.
However, right at the end of the binary HELLO program, before running the BASIC menu file, it stores #$55 at zero page location $68. This changes the address of where BASIC programs load and run. So instead of the usual $801, it was changing it to $5501.
But the problem is that on a cold-start in the emulator (AppleWin in this case), RAM is initialized to a FF FF 00 00 pattern. So $5500 was set to #$FF from that init. When Applesoft went to execute the BASIC program, it was reading the #$FF at $5500, and causing it to throw the SYNTAX ERROR and stop.
When a BASIC program loads and runs at the normal $801 location, $800 is usually a #$00 (leftover from boot), so apparently this doesn't cause a problem.
So why does it work fine on a real Apple?
On my real Apple //e, from a cold boot, RAM seems to be initialized in a slightly different pattern than the FF FF 00 00 AppleWin uses.
Example from real Apple //e:
$2000: FF FF 00 FF 00 FF 00...
$2100: 00 FF 00 FF 00 FF 00...
...
$5500: 00 FF 00 FF 00 FF 00...
$5600: FF FF 00 FF 00 FF 00 ...
So the pattern is generally 00 FF 00 FF, except 'even' pages start with FF FF instead of 00 FF.
This means that when Moptown Parade is cold-booted and run on a real Apple, it just happens to be getting a #$00 at $5500, and is getting away with relocating the program to $5500. In theory, if they'd used $5400 or $5600, it wouldn't work (maybe that's why $5500 was chosen in the first place though).
I'm not sure if all Apple IIs init RAM in this pattern, but maybe the emulators would want to consider it. I'll patch this .dsk image to properly init $5500 at least, so it will be able to work (and consider it another latent 'bug').
But I thought I'd pass it along. (And thanks again, Brendan!)
]HR