On November 6, I isolated everything that was loaded from the disk to their own files, except for the boot splash. Periodically I made notes about things I figured out from looking at the code in AppleWin's debugger. But something just wasn't sinking in...until very early this morning when I got brainstruck. In a few minutes I banged out some code and got Donkey Kong almost running from ProDOS. (There isn't the memory to use DOS 3.3, which eats almost 10K of conventional RAM. ProDOS uses memory that DOS 3.3 doesn't know about, underneath the ROM, and thus only requires a very small amount of the original 48K for itself, although now it needs 64K instead of 48K.)
I tweaked the code a little bit more...then it struck me again. I had a tool for compressing and decompressing graphics, and it was very small. Could I appropriate it for use in Donkey Kong, as I had in Rocky's Boots a couple days ago? In a word, YES... the way I had designed my own hacks, coupled with the way the original code was written, made it possible to use the same memory space for decompression that was already used to hold the levels, with no harm done because I loaded the graphics before the other data.
So I went from a full disk game (that didn't use the whole disk), to a disk using an early version of ProDOS and having 20K free, to a disk using a late version of ProDOS and having 46.5K free.
I also added the ability to exit the game somewhat cleanly by pressing Ctrl-Reset (it will perform a proper ProDOS exit). That makes it potentially suited for a hard drive install.
Some further thoughts...
- Might it be possible to add, using a similar mechanism to the existing levels, the opening cutscene? Everything else is there - Kong climbing the ladder with Pauline under his arm, the elevator level, even the damn PIE LEVEL, and "How High Can You Get?" - it's actually one of the more complete ports of the game.
- I wonder if it might be possible to hack in support for the Mockingboard, to replace the original Apple sound (if the card is detected) with sound more like the arcade game.
- Perhaps it might be possible to make it run through all stages on levels 1 and 2 also (the Japanese arrangement) instead of just having Barrels-Rivets on level 1 and Barrels-Elevator-Rivets on level 2.
- If some POKEs will add features like infinite lives, similar to C64 trainers, I'm willing to add a tool to apply them.