All that Infocom interpreter code

Tuesday, November 21, 2023

Comments: 13   (latest 11 hours later)

Tagged: infocom, if, interactive fiction, zcode, interpreters, z-machine, source, assembly

Jason Scott posted the source code for all the Infocom games in 2019. This was pretty awesome. Everybody who is interested in that stuff cheered, and now it's part of the common knowledge of Infocom. If you're researching the history of those games, or want to study their design, you can dig in.

Not just research, either. Some fans have grabbed the Infocom source and run with it. For example, "less-cruel" mods of Zork or Planetfall without the lamp/food time limits. Or bug fixes for Mini-Zork 2. Or this recent fan construction of the Hitchhiker's sequel. (Can't call it a "reconstruction" when the original was so sketchy; this Milliways is mostly original work.)

So the game source was big news. Infocom's interpreter source, however, remained obscure. This was the game-playing software for each platform: the Apple 2 interpreter, the Commodore 64 interpreter, and so on. A particular Infocom game release ("Zork 3 for the C64", say) was a floppy containing the C64 interpreter and the Zork-3 game file. Boot the floppy, the interpreter starts up; it loads the game data and the game begins.

These interpreters were well-studied by IF enthusiasts in the early 1990s. That's how we got the first open-source IF interpreters and the modern Z-machine specification. Functionally, we know how they work.

But we never had their source code. You might ask, who cares? It would have been pretty opaque assembly code anyhow. But it's a layer of insight into the developers' minds. Comments, variable names, documentation.

We got a first glimpse of this in 2018 when Brian Moriarty donated the interpreter source for the TRS-80 Color Computer. This assembly code wound up at the CoCo Archive.

(Confusingly, Infocom referred to their interpreters as ZIP, the "Zork Interpreter Program". These days if you say ZIP you're talking about a compression tool. But if you dig into that CoCo package, the file coco.zip is the compiled ZIP program! Don't try to unzip it.)

Anyhow, as far as I knew, no other platform's source was available...

...Until a couple of weeks ago, when someone mentioned in a forum thread that they had all the old interpreter source lying around. Had for years.


Long story short, here it is.

(Yes, the CoCo source matches what was posted in 2018.)

Part of the long story involved checking over all the files to make sure there were no personal emails or other material that would be impolite to release. As I was doing that, I took notes. The README therefore contains info about most of the files. I don't guarantee the accuracy of that stuff; I took a lot of guesses. Corrections welcome.

As a followup, David Fillmore posted the IBM PC interpreter source, which he had lying around. (Mostly C, a little assembly.) That wasn't in the original source dump.


What's interesting in these files?

There's changelogs and release dates for different versions of some of the interpreters. I'm sure this will be good for something.

There's a bunch of internal documentation about creating disks for the various platforms. Remember that in the 1980s, floppy disks were pretty incompatible between platforms. To write a C64 disk, you had to get the game data and interpreter onto a C64 which could then write it to disk. But how did you do that? No Wifi, no Ethernet port... Infocom's solution was to run a serial cable from their DEC-20 (where all the games were developed) to the C64 (or wherever). The serial transfer program is called "TFTP" in most of these folders. Do strings like com1:9600,n,8 turn you on? You might be a serial port!

There's also a few implementations of a program called "DIP", or sometimes "GRIP". (This seems to have stood for "Display Interpreter Program" or "GRaphical Interpreter Program".) This was like ZIP, but definitely a different format -- meant for graphical games rather than text games.

Aha, you say, DIP must have been used for Infocom's graphical games like Zork Zero or Journey. Nope! Those adventures used a modified ZIP which Infocom called YZIP. (These days we say "Z-machine version 6".)

No, DIP was used for exactly one Infocom release... the digital board game Fooblitzky. Which sold like a lead balloon. I never played it. The Infocom fans of 1990 never decompiled it. So we never got an open-source DIP, or really any information about DIP at all.

Now we do! But I don't think anybody's champing at the bit to make Fooblitzky web-playable. Oh well.

(The source code to Fooblitzky has not yet turned up. I suppose Infocom would have called that language "DIL"? But we have the game file, or at least I think we do. A file called foo.dat was preserved along with the Unix DIL source, presumably for testing.) (No idea whether it's the full game or just a testing stub.)


You'll notice that I posted this stuff on GitHub last week. I mentioned it on the IF forum. And then I... sort of didn't announce it anywhere else.

The truth is, I didn't want to make a big fuss. You remember my post about trying to get the Infocom IP open-sourced? That's still in progress. (I made contact with some Activision/Microsoft folks, but big companies move very slowly. Still working on it -- nothing to announce -- watch this space please.)

A lawyer would say, "Don't keep releasing source code while you're negotiating with the original rights-holder". That would be good legal advice. I, er, ignored the good-advice part of my brain there.

I mean, Activision/Microsoft doesn't have any financial interest in these old interpreters. They're not part of any modern Infocom port. They don't represent beloved artistic works like the games. They're just infrastructure for 80s hardware.

At any rate, I did make them publicly visible on GitHub and the IF forum, and people noticed pretty quick. Slashdot and HackerNews picked up the story. So it's out there; fine; it was me what did it.

Enjoy, anyhow.

Yes, I plan to update my Obsessively Complete Infocom Catalog page to include this stuff. Eventually! The files have existed for a long time, and they're safe on GitHub now.

(You know, I only just now noticed that the correct abbreviation for Obsessively Complete Infocom Catalog is "ocicat". Now I will call it "ocicat" forever because ocicats are adorable.)


Comments from Mastodon