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” →