It is hard to overstate the influence the Ultima series had on my teens, both just in terms of playing the games but also motivating me to really dive into programming.
I had the opportunity to tell Richard Garriott this at SxSW in 2004 and occasionally via Twitter more recently.
Ultima IV was the first game I really got into although I went back and played the earlier ones, including Akalabeth.
In my teens I remember hacking the map files for both Ultima IV and Ultima V. A couple of years ago, I redid that work in Python: https://github.com/jtauber/ultima4.
Of course, many of you know I've written an Apple ][ emulator in Python (https://github.com/jtauber/applepy) although haven't got disks working yet.
Five years ago, I wrote a Python script that could at least retrieve the CATALOG and raw files (if text) from Apple ][ disk images (of which there are many archived on the Internet).
A couple of days ago, Richard posted a photo of Akalabeth running on his original Apple ][+.
I asked him if it was true that Akalabeth was written in BASIC and, if so, if the source was available.
He confirmed it was BASIC and said he'd look for the source for me.
Last night, still reminiscing about the Apple ][ days (as I often do), I dusted off my Apple ][ disk image reader and put it up on Github: https://github.com/jtauber/a2disk.
I then decided to go looking for disk images of Akalabeth to see if I could extract the source from those (I hardly wanted to bug Lord British himself).
I found a bunch of Akalabeth disk images on the archive.org backup of the Asimov Apple ][ Archive.
a2disk
could read their CATALOG perfectly.
The results fell into two categories.
Some disk images had:
Others had:
The A
indicates Applesoft BASIC.
The Apple ][ stored BASIC programs in tokenized form on disk, very similar to how they were stored in memory.
So I decided to write a de-tokenizer, which now ships with a2disk
.
Here's what HELLO
looks like de-tokenized:
And AKALABETH START
looks like:
AKALABETH INSTRUCTIONS
looks like:
That's the files in the first type of disk image. What about the second, the one with the AKA0-6
?
AKALABETH
in the first disk image is identical to AKA6
in the second. That's the main game (which will get to in a lot of detail shortly).
AKA2-5
are binary files. We'll return later to decoding those.
AKALABETH
in the second disk image is:
AKA0
is:
And AKA1
is:
Same as AKALABETH START
in the first disk image.
I strongly suspect the second disk image is the original and the first disk image is some simplification.
It has the odd "Ultima I" reference and also includes instructions which presumably were provided in printed form in the original game.
I think I'll use child streams to separately explore the preamble files and main game file.