Apple Bard's Tale I Disassembly
Posted: Mon Mar 22, 2010 8:23 pm
In parallel with ZeroZero's efforts I am initiating the project of disassembling Bard's Tale 1 on the Apple ][. The scope of this will be similar yet different, since I am not only looking to disassemble a memory dump, but also look for similarities and differences to the codebase of the C64.
First off, here's a snippet showing what I think is the relevant section of the randomizer that drops items in BT1:
Click for screenshot
Second of all, the memory managament of the Apple is different and that will impose fundamental constraints on how similar the codebases are.
$2000-$3FFF are absolutely forbidden to the Bard's Tale 1 code on the Apple because that's the high-res page. $4000-$5FFF may or may not be forbidden if the code modifies the same memory page all the time. Typically, however, this lack of page flipping usually causes the screen to flicker because the screen updates aren't synched to the vertical blanking interrupt.
The BT1 code folks may have purposely synched all page updates to $2000-$3FFF with the VBL, though.
As well, all memory above $BFFF is forbidden with one exception, because $C000-$CFFF are reserved for expansion slots and hardcoded EPROMs on them. $D000-$FFFF are the system ROMs.
However, on the Apple, $D000-$FFFF can be "swapped-out" for what's called language card memory. The original purpose of this was to add software support for Integer BASIC on Apples that didn't have it. However the versatility of being able to swap between ROM and RAM that maps onto it gives an extra 12K of RAM, and to top it off, thre is a SECOND 4K bank of $D000-$DFFF that can be swapped-in so in fact there can be three concurrently existing $D000 banks that can be swapped-in and out - the ROM, Language card bank 1, and language card bank 2.
Total: 16K of RAM available above the 48K hardcoded limit for Apples.
So the disassembly of the Bard's Tale will have to include the language card, and I suspect the savestate has this information, since the image is >128K in size.
Anyway, my hold-up on disassembling the savestate is for me to find a disassembler that will disassemble ALL of the savestate. The ones I could find either don't let me save to a text file, or only disassembled a portion of the savestate.
First off, here's a snippet showing what I think is the relevant section of the randomizer that drops items in BT1:
Click for screenshot
Second of all, the memory managament of the Apple is different and that will impose fundamental constraints on how similar the codebases are.
$2000-$3FFF are absolutely forbidden to the Bard's Tale 1 code on the Apple because that's the high-res page. $4000-$5FFF may or may not be forbidden if the code modifies the same memory page all the time. Typically, however, this lack of page flipping usually causes the screen to flicker because the screen updates aren't synched to the vertical blanking interrupt.
The BT1 code folks may have purposely synched all page updates to $2000-$3FFF with the VBL, though.
As well, all memory above $BFFF is forbidden with one exception, because $C000-$CFFF are reserved for expansion slots and hardcoded EPROMs on them. $D000-$FFFF are the system ROMs.
However, on the Apple, $D000-$FFFF can be "swapped-out" for what's called language card memory. The original purpose of this was to add software support for Integer BASIC on Apples that didn't have it. However the versatility of being able to swap between ROM and RAM that maps onto it gives an extra 12K of RAM, and to top it off, thre is a SECOND 4K bank of $D000-$DFFF that can be swapped-in so in fact there can be three concurrently existing $D000 banks that can be swapped-in and out - the ROM, Language card bank 1, and language card bank 2.
Total: 16K of RAM available above the 48K hardcoded limit for Apples.

So the disassembly of the Bard's Tale will have to include the language card, and I suspect the savestate has this information, since the image is >128K in size.
Anyway, my hold-up on disassembling the savestate is for me to find a disassembler that will disassemble ALL of the savestate. The ones I could find either don't let me save to a text file, or only disassembled a portion of the savestate.