Infocom Games on an Apple 1

Reading the leaflet in Zork 1 on an emulated Apple 1
Reading the leaflet in Zork 1 on an emulated Apple 1

For VCFMW last Fall, I ported the Infocom interpreter from the Apple II to run on an Apple 1.  This process included taking Eric Smith’s disassembly and creating a small patch utility to use the CFFA1 as the disk drive and adjust for the Apple 1 display and keyboard input.

At the time, I described the process in a posting at applefritter.

However, with the inclusion of CFFA1 emulation in MESS, it is now possible to emulate the hardware configuration on a system other than OpenEmulator.

Starting Zork on an emulated Apple 1
Starting Zork on an emulated Apple 1

Starting MESS with the the interpreter and data file located on a virtual compact flash card requires loading the image with the zip.bin interpreter (composed of the patcher and original Apple II interpreter) and then changing to the directory where the game’s data file is located.

Opening screen for Zork 1 on an emulated Apple 1
Opening screen for Zork 1 on an emulated Apple 1

Once this has been done the patcher can be run, and it patches the original Apple II interpreter to redirect access to the keyboard, display, and disk drives to the routines that I have written.  Once the patch is complete, the interpreter is started and the game commences.

While most of the details regarding the creation of the compact flash image are located in the original applefritter article, here is a link to a local copy of the original preload.zip file.

For the above examples, I have combined the contents of preload.zip with the original revision A interpreter from an Apple II into one file called zip.bin and used infocom.dat as the name of the data file in the zork1 directory.

Below is the original applefritter posting:


I have uploaded a zip file containing the small “preload” code that patches and then executes the Apple II version “A” z-machine interpreter. The patches allow the interpreter to use the CFFA1 as storage as well as to properly access the display and keyboard of the Apple 1.

In order to use this, you will need three things, besides the Apple 1 (replica or emulator) and CFFA1.

1. The preload utility
2. The Apple II Infocom interpreter version “A”
3. The datafile for the Infocom game (version 3/z3 games only)

All three of these items should be placed on the compact flash card (or image) as:

PRELOAD.BIN
ZIP.BIN
INFOCOM.DAT

Using the CFFA1, load PRELOAD.BIN at $0500 and ZIP.BIN at $0800. Then quit the CFFA1 menu and execute 0500R from the Woz monitor. The preloader will patch the interpreter, and start executing it with the current game stored as INFOCOM.DAT.

preload.zip (679 bytes)

Version “A” of the interpreter can be spotted on games that when run on an Apple //e do not prompt for 40/80 columns. I found it on a version of Zork III. Using the technique found in the Infosnarf package, this can be obtained by loading the game, and at the prompt hitting reset. Move the game temporarily out of the way by issuing *4000<0800.08FFM, boot a DOS 3.3 disk without a hello program, restore the original version by using *0800<4000.40FFM, and save with BSAVE ZIP.BIN,A$800,L$1A00

The original instructions from Infosnarf can be found here: http://apple2.org.za/gswv/a2zine/Utils/InfocomProInfo.txt I found that I had to adjust the first two bytes to read D8 A9, as indicated.

Alternatively, some emulators allow the saving of memory directly, which may be easier for some individuals. Appending the ZIP.BIN to the PRELOAD.BIN can save an extra step as well.

Typically, I load the compact flash card with the following tree (using preload+zip combined as ZIP.BIN)

ZIP.BIN
GAME1/INFOCOM.DAT
GAME2/INFOCOM.DAT
GAME3/INFOCOM.DAT

This allows me to load the two bin files into memory, and then select the game with the prefix command. The interpreter will save/restore games into the current prefix as well, which allows a user to not interfere with other saved games. If saving a game fails, verify that there is sufficient space left on the Compact Flash card (or image.) Saved games should always be done to the default disk 2, although positions 0-7 can be used.

This has been run on an original Apple 1 with a CFFA1, OpenEmulator, and a modified version of the MESS emulator (to add the CFFA1.)

Thanks go to Eric Smith for his disassembly of the Apple II version “A” interpreter.

Apple 1 with CFFA1 Emulation with MESS

MESS Apple 1 CFFA1 Emulation
MESS Apple 1 CFFA1 Emulation

Recent versions of the MESS emulator have included CFFA1 emulation on an Apple 1.

In order to obtain a working system you will now need the correct ROM images for both the Apple 1 and the CFFA1 itself.

These should be placed in the  roms/apple1 directory and are (currently) apple-a1.a1 and apple-a2.a2 for the Woz monitor, apple-a3.3 and apple-a4.4 for the cassette interface, s2513.d2 for the character generator, and cffaromv1.1.bin for the CFFA1 card itself.

Once the correct ROM images are installed they can be verified by running MESS with the -verifyroms apple1 command argument.

In order to use the CFFA1 emulation, MESS currently requires the following arguments: -exp cffa -ram 36k
Specifying the amount of RAM as 36K allows the emulation to correctly allocate space for the CFFA1 ROM.

As a demo of the capabilities of the Apple 1, Philip Lord has put great effort into compiling existing Apple 1 software into his Ultimate Apple 1 Software Collection.  This collection is distributed as a .po image, which can be written to a Compact Flash card and used with the CFFA1.  However, it can also be turned into a hard drive image that can be used with the Apple 1 emulation provided by MESS.

chdman createhd -f -c none -i ultimate.po -o ultimate.chd

This file can be used as the input to MESS using the following.

mess64 -window apple1 -exp cffa -hard1 ultimate.chd -ram 36k

This configuration creates an excellent software development platform for the Apple 1 Computer.