Zork And The Z-Machine: Bringing The Mainframe To 8-bit Home Computers

Computer games have been around about as long as computers have. And though it may be hard to believe, Zork, a text-based adventure game, was the Fortnite of its time. But Zork is more than that. For portability and size reasons, Zork itself is written in Zork Implementation Language (ZIL), makes heavy use of the brand-new concept of object-oriented programming, and runs on a virtual machine. All this back in 1979. They used every trick in the book to pack as much of the Underground Empire into computers that had only 32 kB of RAM. But more even more than a technological tour de force, Zork is an unmissable milestone in the history of computer gaming. But it didn’t spring up out of nowhere.

DEC PDP-10 Flip Chip module
DEC PDP-10 Flip Chip module

The computer revolution had just taken a fierce hold during the second World War, and showed no sign of subsiding during the 1950s and 1960s. More affordable computer systems were becoming available for purchase by businesses as well as universities. MIT’s Laboratory for Computer Science (LCS) was fortunate to have ties to ARPA, which gave MIT’s LCS and AI labs (formerly part of Project MAC) access to considerable computing resources, mostly in the form of DEC PDP systems.

The result: students at the MIT Dynamic Modeling Group (part of LCS) having access to a PDP-10 KA10 mainframe — heavy iron at the time. Though this PDP-10 was the original 1968 model with discrete transistor Flip Chip modules and wire-wrapping, it had been heavily modified, adding virtual memory and paging support to expand the original 1,152 kB of core memory. Running the MIT-developed Incompatible Timesharing System (ITS) OS, it was a highly capable multi-user system.

Naturally, it got mostly used for playing games.
Continue reading “Zork And The Z-Machine: Bringing The Mainframe To 8-bit Home Computers”

Hackaday Links: April 21, 2019

A Russian company has developed a drone with a very interesting control scheme. It’s a VTOL fixed wing, that takes off like a bicopter, transitions to use wings for lift, flies around for half an hour or so, and then lands on its tail. This is a big ‘un; the reported weight is 50 pounds. Although the available footage really doesn’t give any sense of scale, we would estimate the wingspan as somewhere between four and five feet. Fixed-wing VTOLs are close to the holy grail of current drone science — wings actually generate lift, and VTOL means Uber can deliver McDonalds to your driveway.

What happens when you give an idiot a USB killer? $60,000 in damages. A former student at the College of St. Rose killed 59 computers with a USB killer, basically a charge pump that dumps a hundred or so volts back into a USB port, destroying the computer. Yes, you can just buy USB killers on the Internet, and yes you can film yourself zapping computers and posting the videos on social media. Both are dumb ideas.

This week was huge for the preservation of our digital culture. The source for the original Infocom games, such as Zork and Hitchhiker’s Guide to the Galaxy have been archived and released. This is a rather interesting development, as these games were written in Zork Implementation Lanugage (ZIL), a language that is used by no one and there’s almost zero documentation. Yes, we have the source, but not a compiler. It’s Lisp-ish, and there are people working to make new games in this language. Also this week is the release of the source for Leisure Suit Larry. Hackaday readers will be familiar with Leisure Suit Larry as the protagonist is a 38-year-old loser who lives in his mother’s basement. This game goes off the rails when the protagonist decides to leave the basement, but it was written a long time ago, and I guess Al Lowe didn’t foresee the Internet or something. Tip of the very fancy hat to @textfiles here.

You in Jersey? The Vintage Computer Festival East is May 3-5th, and it’s bound to be a grand time. Keynotes are by Steve Bellovin, co-inventor of USENET, Ken Thompson (!), co-inventor of UNIX, and Joe Decuir, co-inventor of the Atari VCS, Atari 800, and the Commodore Amiga. There’s also a Software Store (new this year), which we can only hope is like walking into Babbage’s. Protip: while you’re there, go up to Asbury Park and visit the Silverball Museum. It’s a whole lot of pinball.

For easier production and assembly of circuit boards, you should only place your components on one side. Doing so means you don’t have to flip the board and run it through the pick and place again, and you don’t have to worry about glue. This is a single-sided circuit board. There’s only one side. It’s a Mobius PCB, the flex-circuit version of a handmade circuit board made with a conductive pen.

The Zork Virtual Machine Implemented In Hardware

ZorkHitchhiker’s Guide to the Galaxy, and all the other Infocom text adventures are much more clever than the appear at first glance. They actually run on a virtual machine, with all the code for the game files squirreled away in the Z-machine format. This is great if you’re writing a game for a dozen platforms; once you have an interpreter running on one system, the entire library of games can be shipped out the door.

While the Z-machine has been ported to all the retrocomputers you can imagine and a few different brands of microcontrollers, no one has yet implemented the Z-machine in hardware. There’s a reason for this: it’s crazy. Nevertheless, [Charlie] managed to implement the Z-machine in an FPGA, using only a few extra commands for driving a display.

zork2The circuit is constructed with a $10 eBay special FPGA, the Cyclone II EP2C5. Other than that, it’s just some Flash, some RAM, a display, and a whole lot of wire. The standard Z-machine spec is followed, version 3 specifically, meaning this text adventure on a chip can run nearly every Infocom game ever written. The most popular ones, at least.

This isn’t [Charlie]’s first time in the ring with the Infocom Z-machine. He ported the Z-machine to a freakin’ pen a few years ago.

You can check out [Charlie]’s video demo below. Because there was a bit of extra space in the FPGA, [Charlie] managed to put a Mandelbrot implementation and Space Invaders in as an easter egg.

Continue reading “The Zork Virtual Machine Implemented In Hardware”

The Zorkduino


Zork, the famous Infocom text-based adventure game, is actually quite the technical achievement in software engineering. It’s an amazingly large world to explore, albeit in text form only, running on an interpreter that allows paging, loading, and saving the complete state. All this, built to run on computers with meager amounts of RAM in the late 70s. You might think it would be easy to play Zork on an Arduino, but as [rossum] found out, that’s easier said than done (alternate blog link)

While most computers that were capable of running Zork had at least 8k of RAM, if not more, the ATMega328 in the Arduino only has 2k of RAM. Those fancy home computers of yore also had built-in video, a keyboard, and most of the time, a disk drive. The Arduino has none of that.

[Rossum] faced this challenge head on, capitalizing on the onboard hardware of the Arduino. Video is generated by using SPI mode on a UART at top speed – 8 MHz. This just shifts out pixels from the video buffer on an SD card. The keyboard is handled like any other PS/2 keyboard project on the Arduino, and audio is generated by toggling a pin at 1000Hz for a keypress, and 3600Hz for SD card access.

The finished product includes a bunch of other Infocom games on the SD card, including Leather Goddesses of Phobos, and the ability to run Hitchhiker’s Guide to the Galaxy, the game regarded by many as being better than the book. Video below.

Continue reading “The Zorkduino”

Playing Zork On The Arduino

If you’re looking for something to do on a boring Sunday afternoon, how about dusting off your Arduino and playing a text adventure? [Louis] wrote in to tell us about his project called AZIP, an app that will let you play classic 1980s text adventures on your Arduino.

The famous Infocom text adventure games such as Zork and Hitchhiker’s Guide to the Galaxy (reputed to be better than the book, by the way) all ran on a virtual machine called a ZMachine. We’ve seen a few unsuccessful attempts to run a ZMachine on an Arduino, but these builds usually end up going with a Linux-based single board computer. As far as we’re aware, [Louis]’ build is the first time classic text adventures have been available on the Arduino.

[Louis] based his build on the popular Jzip ZMachine. The required hardware is fairly minimal – just an Arduino with an SD card. Right now the limitations of Flash and RAM on the Arduino means [Louis] needed to remove the game save and restore functions, but with a little clever coding and continued development those functions can be restored. Very cool indeed.

Easy To Build Z80 Single Board Computer

[Alexis] sent in a single board computer he’s been working on. The project goal of his build was making it easily reproducible. From looking at the schematics, it’s one of the simplest fully-functional computers we’ve seen. The build runs CP/M 2.2 off of two 3.5 inch floppies. This opens up a lot of options as to what software is already available. Although it operates over a serial terminal, [Alexis] pretty much duplicated an Osborne I, only at double the speed.

[Alexis] got a little e-fame from his earlier 8088 homebrew computer built from very early 8088’s rescued from an electronics junk shop. These 8088 computers made the blog rounds by playing Still Alive with a SID chip from a Commodore 64 and a YM2151 FM synth chip.

For now, I guess we’ll have to settle for a video of [Alexis]’ Z80 computer running CP/M. Check out a video after the break of his computer running the greatest Infocom adventure, Hitchhiker’s Guide to the Galaxy.

Continue reading “Easy To Build Z80 Single Board Computer”