Saving Zork Game Progress
Or “How playing Zork taught me how to use the MITS disk operating system”
In this brief tutorial I'll go over using the virtual disks the Altair-Duino supports. I'll assume that you have a display (a serial terminal, or a serial link via the USB or Serial ports using a serial terminal on your computer) connected to your Altair, so you can see text and enter commands.
Do you have the Altair-Duino with a SD Card of goodies, including some CP/M copies of the Zork adventure games? Great! However, if you start playing Zork you’ll find you can’t save your progress as the ‘Save’ command will fail. Why? Turns out with all three Zork games on one virtual disk, there isn’t enough room to save the progress file. What to do?
Option 1. Delete the Zork2 and/or Zork3 files to make more space on that disk.
But I might want to play Zork2 or Zork3! Next option.
Option 2. Copy Zork2 and/or Zork3 to another, different, virtual disk and so make room.
Excellent. But where can you get another disk?
You will need to mount a new virtual disk. I initially tried this with the Tarbell disk controller, as it was first in the excellent David Hansel manual, but depending on how you or someone else created your Altair-Duino firmware, there may not be support for the Tarbell floppy disk emulation activated. So instead let’s use virtual floppy drives with the MITS Disk Controller. You have probably accessed a virtual drive in this way if you have played the Zork CP/M disk in the first place, but hopefully by the end of this tutorial it will be more than some random switch settings for you.
What are drives and disks in this context?
A drive is the (virtual) disk drive you can imagine connected to your Altair. Your system is probably set up to support at least four drives : A:, B:. C: and D:.
A disk is a (virtual) disk that is “inserted” into one of those drives. Disks can be inserted, accessed and then removed.
By using combinations of the A15-A0 and the AUX 1 and 2 switches, the Altair-Duino software can select drives, and insert disks. Once you understand it a little, it stops being a random pattern of switches and starts making some sense.
Here’s the plan.
Yes, you might be thinking this is rather like an adventure in its own right. I can’t argue, so here’s how to do it, step by step.
Here are the disks we’ll need to use:
Disk 01 - CP/M
Disk 08 - Zork
Disk 1F - An empty disk we’ll create
If you were to take the SD card and read it in a computer, you would see a list of these disks, each stored as a file named DISKxx.DSK., where xx is a two digit hex number (e.g. 01, 0f, 20 etc). You can’t read the files easily on a computer, but you can copy them, email them, back them up etc etc.
So many switches
The trick to controlling things with the A15 to A0 switches is as follows:
First set the switches to enable the MITS Disk Controller. We use A15 to A12 for this, set to 0001.
That is: A15 = Down, A14 = Down, A13 = Down, A12 = Up
Now we select the drive (A: B: C or D:) using the next four switches, A11 to A8, as follows:
0000 = Drive 0 = A:
0001 = Drive 1 = B:
0010 = Drive 2 = C:
0011 = Drive 3 = D:
The last set of eight switches, A7 to A0 specify the number of the virtual floppy disk that will be popped into the virtual drive. Several pre-loaded floppy drives are included (the CP/M and Zork ones for example), but you can create your own just by picking a number that isn’t used.
To select the CP/M disk, set A7 to A1 down, and A0 up
00000001 = Disk 1 = DISK01.DSK = CP/M
So, to load CP/M into drive 0 set the switches like this:
A15 -> A0
0001 0000 0000 0001
Now we can tell the Altair-Duino to mount it, by pressing AUX 2 down.
If you do this, you should see a message like:
[mounted disk image 'DISK01.DSK: CP/M (63k)' in drive 0]
If you see a different message about a disk image has been mounted, but it doesn’t say CP/M, then either your switches are in the wrong position, or the SD card is missing, corrupt, or doesn’t have CP/M stored in the DISK01.DSK file.
Assuming it did mount as expected, we can continue to boot the disk. This will load part of it into memory and execute the code there, effectively starting CP/M. To do this, we need to engage the Altair’s Disk Boot ROM (a special program that your Altair-Duino includes as if you had installed a floppy disk controller with a ROM in a real Altair). There is using another special switch combination:
A15 -> A0
0000 0000 0000 0100
And press AUX 1 down.
You should see:
[Running Disk boot ROM]
..and then the CP/M prompt.
If you just see a load of random characters scrolling by, the SD card isn’t installed or is corrupt.
Congratulations! You’ve just booted CP/M.
Loading Zork
Now we need to mount disk 8, into drive 1. Can you work out the switch pattern?
0001 = MITS DIsk Controller
0001 = Drive 1 = B:
00000100 = Disk 08
So set the switches like this:
A15 -> A0
0001 0001 0000 0100
And press AUX 2 down to mount it.
Now, at the CP/M prompt, you can enter:
DIR B:
And you’ll see the Zork files listed.
Mount a new drive and format it
Let’s add a brand new virtual floppy. By default, disk 15 (hex) doesn’t exist, so let’s create that. First we mount it, this time in drive C: like this:
0001 = MITS DIsk Controller
0010 = Drive 2 = C:
000010101 = Disk15
Set the switches to be:
A15 -> A0
0001 0010 0001 0101
And press AUX 2 down to mount it.
You should see:
[mounted new disk image DISK15.DSK in drive 2]
If you were to enter DIR C: right now, bad things would happen, as the disk is not formatted or ready to use. This is because the file DISK15.DSK hasn’t been created yet.
Were you able to resist typing DIR C:? Did you see
Bdos Err On C: Bad Sector
And now you can’t do anything? Don’t worry, press the Altair Reset switch up and CP/M will restart.
You need to format drive C: to cause it to spring into existence. To format it, enter:
FORMAT
You’ll see the prompt
*** DISKETTE INITIALIZER ***
DISK DRIVE (A-P)?
Type:
C <return>
And when you see the COMMAND: prompt, enter:
FULL <return>
And press C to continue.
You’ll see a PROCESSING TRACK #x message count up to 77. The first time you do this, the verification will probably fail, so repeat it. Then enter STOP to leave the FORMAT program.
Now when you enter
DIR C:
..you won’t see any errors, but of course you won’t see any files either.
File copying
To copy files, we’ll use the CP/M command PIP. To copy ZORK2’s files from B: to C: enter this:
PIP C: = B:ZORK2.*
And this will copy ZORK2.COM and ZORK2.DAT to drive C:
Now you can erase them from drive B:. like this:
ERA B:ZORK2.*
Conclusion
Alright! Now you have created a bunch of space on the Zork disk, and finally you can save a game from within Zork (by typing SAVE), and recover it later (by typing RESTORE)
As you continue to play with the Altair-Duino, you should look at some of the other virtual floppy disks that have been included. Some of the more fun ones include:
DISK10.DSK: Hitchhikers Guide to the Galaxy
DISK11.DSK: Planetfall
DISK12.DSK: Colossal Cave Adventure
There are also hard disk images, and these include other adventure games and CP/M versions - but we’ll save that for another time.
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/altair-duino/643fe1c1-96c3-446c-9931-7089edebc8e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to altair...@googlegroups.com.