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.

Hacked phone runs Zork, gets lamp

A few months ago, [Ulysses] had a project in mind that would run Zork on a TDD. Although it was a bit of a struggle getting the project ready in time for the Bay Area Maker’s Faire, the accompanying build blog tells us it was more than worth the effort.

After hooking up the guts of the phone to an Arduino Pro, A modem was modified so the acoustically coupled TDD could be interfaced. Although the TDD display is only one line, [Ulysses] is transmitting the text at only 45.5 baud, So even the slowest reader could keep up with the story. For running the actual code, initial attempts at using an Arduino Pro, and then Arduino Mega proved unsuccessful because of the limitations of sram in these AVRs. After discarding the idea of running Zork on an Arduino, the project was finished with a single board FitPC computer mounted inside the phone.

The code of the project runs Zork on a port of the Infocom Z-code Interpreter Program, or ZIP. A lot of interactive text adventures were put out in the Z-code format, so we’re guessing it would be trivial to have this project run Leather Goddesses of Phobos, or the amazing Hitchhiker’s Guide to the Galaxy. It’s a very nice project, and we could easily see ourselves sitting down with this project, a two liter bottle of Shasta, and an all-Rush mix tape on a Saturday night.

Zork on the Microtouch

[Rossum] just finished porting Zork over to the Microtouch. This hardware, which he originally designed, is now available for purchase through Adafruit. It’s a tiny 320×240 TFT touchscreen, driven by an AVR ATmega32u4 microcontroller. The device draws power from a lithium battery, and also boast a USB connection and a MicroSD slot.

The hack here is getting Zork to run with the limited resources available on the device. [Rossum] needed to emulate the Z80 processor, but didn’t want to use extra hardware in the way that [Sprite_TM] did when he emulated a Z80 using an AVR. Instead, this is based on a stripped-down implementation of Frotz. The final code is too big to fit on the chip along side of the bootloader. This means you’ll need to use an ISP programmer in order to flash this example to the chip. We’re pretty sure that AVRdude can program the ATmega32u4, so pretty much any ISP (including an Arduino) can be used to do the programming.

Typewriter as I/O; lets you play Zork

Okay, for many the fact that this typewriter plays Zork on paper instead of a CRT is the fascinating part of this hack. But we love the implementation that makes the keys of the device an input and output.

The electric typewriter has been fitted with a solenoid for each key (wow, that’s a lot of work). In the image above you can see they are housed on plywood platforms behind the typewriter and connect using a piece of mono-filament fishing line. This flexible connection means the solenoids have no adverse effect when you want to do the typing instead of the Arduino which drives the solenoids. [Johnathan M. Guberman] took advantage of this, adding a resistor for each key. When depressed the key completes a circuit with the resistor, acting as the input. In this way, you can play Zork with a piece of paper as the monitor, typing for the input, and watching the typewriter magically pound out responses. See it happen after the break.

[Read more...]

Z80 emulated on PIC hardware

[Jaromir Sukuba] built a very portable, low power consumption Z80 emulator using a PIC microcontroller. Looking through his build photos we love the clean and resilient construction which includes a breakout board for the PIC 32MX795F512H that interfaces with the main board via pin headers and sockets. He’s using a home-built keyboard and a 4×40 character display but there is also the option to communicate with the device over an RS232 connection. Oh, and yes it plays Zork, which seems to be the benchmark whether you are emulating a Z80 with AVR hardware, or if you built one from transistor-transistor logic.

Emulating a Z80 computer with an AVR chip

[Sprite_tm] dusted off his assembly skills and managed to emulate a Z80 computer using an AVR ATmega88. He’s using an SD card in place of the floppy and a 128 KB DRAM chip to handle the memory for the emulated machine. An FT232 board gives him terminal access which he uses for input and display. As you can see, the hardware is much simpler than building the original would have been. He makes up for this with complicated firmware. In the end, the emulated core occupies about 2 KB of programming space after he followed the Z80 Propeller project’s idea of dividing the instructions into different modules and using a lookup table to access them.