Skip to content

Zork Z-Engine implementaiton for an Intel 4004 Microprocessor

Notifications You must be signed in to change notification settings

sbelectronics/4004-zork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zork "Z-Machine" implementation for the Intel 4004 Microprocessor

Scott Baker, https://www.smbaker.com/

Purpose

Zork is a popular adventure game. Dating back as far as 1977, though most people would be familiar with it from during the Infocom era, beginning in the early 1980s. Zork is written in a language called ZIL, which is compiled to a byte code that is executed by an interpreter called a Z-Machine. Infocom implemented the Z-Machine for many popular computers.

This repository contains an implementation of the Z-Machine for the Intel 4004 CPU, the world's first commercially produced microprocessor. This is not without it's challenges -- the 4004 CPU is only 4-bits, and can natively address only 4 KB of ROM and 640 bytes of RAM.

As this is a Z-Machine, it's suitable for other Infocom games that use version 3 of the Z-Machine. This includes Zork I, Zork II, Zork III, The Hitchhiker's Guide to the Galaxy, etc.

Scott's 4004 Computer

I build a custom 4004 single-board computer, intended specifically to run Zork. This computer extends the 4004 with 256 KB of ROM and 512 KB of RAM, making playing the game Feasible. For more details, see my blog.

Dependencies

You will need the firmware from Scott's 4004 Single Board Computer. This can be found at https://github.com/sbelectronics/4004 in the directory 4004-smbaker/firmware. I recommend simlinking the firmware/ directory out of that repo directly into your local copy of 4004-zork.

You will also need the AS assembled, which can be found at https://github.com/Macroassembler-AS/asl-releases.

Building

make blocks will build the assembly files that include the Zork data blocks. Doing so is a precursor to building the ROM image.

make zork-uart.rom will assemble the source files and build the ROM image for the SBC. Other games can be built similarly, for example make-hitch.rom to build a ROM for HitchHiker's Guide to the Galaxy.

make upload will upload the ROM image to a PicoRom module if you have such a device. I use it for development. Alternatively, you can burn the ROM image to a suitable flash device, such as a 39SF040 using the EPROM programmer of your choice.

make play will play the game using my custom-built 4004 emulator, which also emulates the UART and the RAM and ROM. I used this for development.

Playing on actual hardware

The monitor runs at 9600 baud by default.

The ROM image includes a small monitor program, originally written by Jim Loos for his 4004 SBC projects. The monitor supports banking, with various additional programs located in the various banks. Zork is located in "Bank D", which you can launch by

About

Zork Z-Engine implementaiton for an Intel 4004 Microprocessor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published