Skip to content

Running old BASIC computer games

This post was originally published in March 2014. I’ve included the original post here, with an update below it.

If you’re a computing enthusiast who’s been around for a while, you may remember David Ahl’s classic books, BASIC Computer Games and More BASIC Computer Games, from 1978 and 1979 respectively. These two volumes contained BASIC listings for many games taken from the pages of the hobbyist magazine Creative Computing.

The covers of David Ahl's books BASIC Computer Games and More Basic Computer Games.
David Ahl’s classic books collect listings for many popular games from the 70s written in BASIC

These books provided a popular source of games to build and experiment with for people who acquired microcomputers in the late 1970s and early 1980s. All of the games in the book are designed to run in Microsoft BASIC on systems with a simple teletype terminal. Partly as an exercise in nostalgia and partly as an exercise in programming, I decided to make updated graphical versions of some of the games from these books.

Many of the games are very simple and you can easily understand the algorithms from just examining the listing and looking at the example printouts of the game running. Some are more complex – and for these it is useful to be able to see the game running. So I had my first challenge: how could I run games written in a language that is over 40 years old and intended to be used on systems that you’d be lucky to find outside of a museum or an e-bay auction?

Ideally I wanted to be able to run the games on my MacBook in OSX Mavericks. Looking at the introduction to the books reveals that most of the games were written in Microsoft 8080 BASIC on an Altair 8800 with 16K of RAM. Obtaining, restoring and running an original hardware 8800 is not impossible, but potentially difficult and expensive. Fortunately, there’s another option. As the MITS Altair 8800 was a popular machine there are a few emulators out there for modern platforms.

A good option for OSX seemed to be a popular multi-system simulator called SIMH. This has two Altair 8800 simulators that simulate the systems based on both the 8080 and the Z80 chipsets. Some research turned up a few binaries for OSX, but all of those that I found seemed to have been compiled for PowerPC Macs and were unceremoniously spat out by my Intel-based MacBook.

Fortunately SIMH is very actively maintained by a group of enthusiasts and the current codebase can be found on GitHub. I cloned it from https://github.com/simh/simh.git using the Github Desktop app.

Building SIMH was a breeze thanks to the comprehensive and well-maintained makefile. After starting Terminal and navigating to the folder containing the source files, entering make all will build all the currently supported simulators. I received a warning during the build, but this was because of a formatting issue and the binaries were created successfully.

The makefile creates a BIN folder with all of the simulators as Unix executables. There are two Altair simulators. I chose to use Altairz80. The simulator is run by navigating to the relevant folder in Terminal and then entering either altairz80, if the folder is included in the PATH environment variable, or ./altairz80 if it isn’t. If the simulator has compiled successfully, it responds with the following:

The output when starting the Altair Z80 simulator.
Successful start of the Altair Z80 simulator

So far so good, I had the start of a working environment. The next challenge was to get those BASIC games up and running. The website of Peter Schorn, the creator of the AltairZ80 simulator, has a collection of operating systems for the Altair. These include a CP/M 2.2 bundle that includes Microsoft BASIC and Eliza, one of the games from the books. After downloading, these files should be placed in the same folder as the simulator. CP/M can be started within the simulator by entering do cpm2.

The terminal should now be showing:

The output when starting CP/M on the Altair Z80 simulator.
Successful start of CP/M on Altair Z80 simulator

Microsoft Basic can be started by entering MBASIC:

The output when starting Microsoft BASIC on the Altair Z80 simulator.
Successful start of Microsoft BASIC on Altair Z80 simulator

A game can then be loaded with, for example, LOAD “ELIZA.BAS” and then run with RUN:

The output when starting the Eliza BASIC program on the Altair Z80 simulator.
Successful start of Eliza BASIC program in Microsoft BASIC

So now I had a fully working environment, it was time to get the games. The full text of both books is available at atariarchives.org:

BASIC Computer Games
More BASIC Computer Games

One option at this point is to simply type in the games by hand – remember doing that? – and then save them to the virtual disk with e.g. SAVE “CHECKERS.BAS”. Fortunately a lot of them have been collected here: http://www.vintage-basic.net/games.html, which saves some considerable hours of monotonous typing.

To get the listings from this site into the virtual disk I first saved them as text files on my MacBook, using a CP/M compliant filename, i.e. maximum of 8 characters followed by a dot and a three character extension e.g. ACEYDUCY.BAS. The files must be saved to the folder containing the simulator and the CP/M image.

Now to get them into the virtual disk image, you start the simulator and CP/M and then use the R (read) command, e.g. R ACEYDUCY.BAS:

Output showing how a file is added to the virtual disk image on the Altair Z80 simulator.
Adding a file to the virtual disk image using the R (READ) command

If you now get a directory listing, using DIR, you should see the file has been added to the virtual disk image:

Output of a DIR command showing a file has been added to the virtual disk image.
Using DIR to confirm the game has been added to the virual disk image

Now you can start MBASIC and load and run the game as normal:

Output showing a game being loaded and run after adding it to the virtual disk image.
Loading and running the game after it has been added to the virtual disk image

UPDATE AUGUST 2020
If you want to replicate this on a Windows machine, it’s a lot simpler as you don’t need to rebuild from source. You can download an executable version of the Altair Z80 simulator and the CPM package directly from Peter Schorn’s website, unzip them to the same folder and run them as detailed above. I’ve tested this on Windows 10 and it works without a hitch.

Published inRetro Computing

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *