Spotlight › Frotz
os8088 plays Infocom games now
There is a new program on the disk called Frotz. It plays the text adventures Infocom sold in the 1980s -- Zork and its relatives -- on a processor from 1978.
- the interpreter
- 23,722 bytes
- story formats
- v1 to v8
- games it fetches
- 15
What it is
Two minutes on text adventures, the Z-machine, and what got added.
Text adventures
Before games had graphics, they had prose. The computer describes where you are, and you
type what you want to do -- open mailbox, go north,
take lamp. It writes back what happened. That is the whole interface, and the
screenshots on this page are what it looks like.
Infocom, founded in 1979, made the best-known ones: Zork, The Hitchhiker's Guide to the Galaxy, Planetfall. People still write them today.
The Z-machine, and why a 1982 game still runs
Infocom had a problem. They wanted to sell one game to people who owned an Apple II, a Commodore 64, an IBM PC and a dozen other machines that shared no common ground. Rewriting each game for each computer would have been most of the work, every time.
So they invented a pretend computer and wrote the games for that instead. They called it the Z-machine. It has its own instructions and its own idea of what a screen is, but no Z-machine was ever built out of silicon. To sell a game on a new computer, Infocom wrote one program for that computer -- an interpreter, which reads the pretend computer's instructions and carries them out. The game itself never changed. Java and WebAssembly do the same thing today.
So a game published in 1982 is still a plain file, still fully specified, and still
playable on anything somebody writes an interpreter for. Those files are called
story files, and they end in .z3, .z5 or .z8 --
the number is which version of the Z-machine they expect.
Frotz is the interpreter
Written for os8088, in 23,722 bytes of 8086 assembly, handling every version of the Z-machine from 1 to 8. Give it a story file and it plays it.
It is not a port of the well-known Frotz. That one is written in C, and this
project has no C compiler in it on purpose. This is a separate implementation of the same
published standard, written from scratch in assembly, and named the way dfrotz
and wfrotz are -- after the spell in Enchanter that makes things glow. The
program's own About box says so too.
Watch it run
NostalgiaPC on how the interpreter was built and what it does.
Four stories, running
Every image is a screendump of os8088 in an emulator, driven by a script that opens the interpreter, picks the story off the floppy and types into it.
[MORE] at the
bottom is the interpreter holding a long passage until you press a key.
How it works
The two problems worth describing, what saving gets you, and how it is checked.
A story is bigger than the processor can point at
The 8086 reads memory in 64KB chunks called segments, and a single address in a register cannot reach past 65,536 bytes. Zork: The Undiscovered Underground is 229,888 bytes, and the Z-machine expects the whole story to be addressable as one flat run.
So Frotz keeps it as a base segment plus an offset and converts on every access. Two shortcuts carry nearly all the traffic: anything in the first 64KB is reached with no arithmetic at all, and the place the program is currently executing is kept in a register pair that only needs correcting once every 32KB of straight-line code.
It says no instead of failing strangely
The whole story sits in memory while you play. There is no reading pieces off the disk as it goes, and that is deliberate: one floppy access costs about 400 milliseconds on the machine this is built for, and working out a single turn's text touches memory hundreds of times. Fetching from disk would not be a slower design, it would be a broken one.
Which means some stories will not fit on some machines. Frotz checks the size before it reads a byte, and says so:
Anchorhead needs 508K and this
machine has 149K free.
On a 640KB machine a story gets about 501KB; on a 256KB one, about 117KB.
Saved games open on your laptop
Saving writes a Quetzal file, which is the standard format other interpreters use. A game saved in os8088 can be restored in Frotz on a modern computer, and one saved there can be restored here.
Checked by playing the games
An interpreter is only correct if the games agree, so every story on the disk is played through a fixed script and the transcript is compared line by line against the one a reference interpreter produces from the same script.
A second check compares what is actually on screen, pixel by pixel, against screenshots of the reference -- because two interpreters can print identical text and still draw it differently, and no transcript would ever catch that.
What it will not do
A list that only says yes is not much use.
- Timed input is turned down, not faked. Some later games can ask "do something within ten seconds". Frotz tells the story up front that it cannot do that, so the story never asks. The alternative is a game waiting forever for a clock that never ticks.
- Sound is tones. The two standard beeps are exact. A game asking for a recorded sound gets the nearest tone instead.
- Version 6 graphics are written but not proven. Version 6 games are the ones with pictures, and every one of them is still owned and sold by Activision -- so there is nothing that can ship on the disk to test against. It is checked with a game compiled for the purpose and with made-up picture files, which is a weaker guarantee than the rest of this, and it is listed here rather than left for you to discover.
- Infocom's own picture files do not draw. The interpreter's own picture format does.
Run it yourself
Three steps, and the first one explains why there is not simply a download.
-
Build the story floppy from a source checkout. Frotz is not on the software disk that comes with the release: the interpreter alone is most of the free space on the 360KB disk, and an interpreter with no story on the disk is a menu item that disappoints. The games are not in the project either -- they are other people's work, under other people's copyright. So building the disk fetches them, from a list of games whose authors released them freely, checking each against a recorded checksum.
make zdisk -
Boot os8088 with the story disk as the second floppy, then double-click Disk B on the desktop.
-
Open a story. Open
FROTZ.O88, then choose File › Open Story... and pick a game out ofINFOCOM,CLASSICorMODERN. Double-clicking a story file opens it straight away too.
Double-clicking a story that is inside a folder needs a build newer than v1.0.20260810. In that release it only worked for a story in the root of the disk, and anything in a folder reported itself missing -- File › Open Story is the way in there.
The Infocom titles on the disk are Mini-Zork I, both Sampler disks and Zork: The Undiscovered Underground -- the ones Infocom and Activision gave away deliberately. Zork I to III, The Hitchhiker's Guide and Planetfall are still sold and are not included. If you own copies, they can be put on the disk beside these.
Two of the emulated period machines in the project are set up for it, both with a sound card and a full 640KB of memory, because a story has to fit in there all at once: an IBM XT with an 8088 at 4.77MHz, and a 386DX at 25MHz.