The first piece of software I ever purchased was:  Zork I.  I bought it at K-Mart, in the early 1980s, for my Commodore 64.  So, this game has always had, and still has today, a special place in my heart.  I still have it today, and it still works fine.  I have memorized the solutions to the twenty treasures, and enjoy racing myself to see how quickly I can find them all and solve the game—this comes in handy when having to suffer through boring meetings during the workday. 😀


Zork was a product of Infocom, the originator of the "text-based adventure" game, a.k.a. "interactive fiction".  Zork was written in a domain-specific language called the Zork Implementation Language (ZIL), which got compiled to a binary output format called z-code, which then ran in a virtual machine called a Z-machine.  The Z-machine interpreted Zork's z-code, and, thanks to this abstracted architecture, Infocom was able to port Zork and the rest of their text-based adventure games to all the various 8-bit platforms of the 1980s by simply porting the Z-machine interpreter.  The ZIL-based game source code did not have to be modified for every system.  Anyway, there are whole documentaries on Infocom and Zork, and that fascinating story is beyond the scope of this article.

What is the scope of this article you may ask?  Well, in much the same way that people try to get DOOM to run on anything, there is also a race to make Zork run on anything.  So, in support of that noble and worthwhile goal, I humbly present to you this post which explains how to do just that—run Zork from BIOS!

Getting Started

We need two things to run Zork:
  1. a Z-machine implementation, to interpret the z-code
  2. the compiled z-code for Zork

Frotz

Frotz is a portable, open source, Z-Machine interpreter that has been under development for over 25 years.  Thankfully, Github user go2tom42 has ported Frotz to the UEFI Shell!  That project can be found here:

To build Frotz.efi, I followed the instructions on the Github site, and they worked without trouble:
1.  sudo wget -qO - https://raw.githubusercontent.com/go2tom42/Frotz-UEFI/v2.0.0-FROTZ-UEFI-V2.54-on-Ubuntu-22.04-LTS/installme.sh | bash
2.  found the binary at:  edk2/Build/AppPkg/DEBUG_GCC5/X64/AppPkg/Applications/frotz/Frotz/OUTPUT/Frotz.efi

(I did this running Ubuntu 22.04)

I put Frotz.efi on a drive containing the UEFI shell.

Zork z-code

ZIL/z-code files, representing text-based adventure games, can be found all over the Internet.  I recommend the best place to be the Interactive Fiction Database.  Note that while Frotz can run any z-code file, we're focusing here on Zork, so here is the direct link:

Conclusion

So, having put the Frotz.efi and the zork1-r119-s880429.z3 z-code file on the same UEFI Shell image, I booted it and got:


There you have it!  Thanks to go2tom42 for making Frotz run in the UEFI shell, and of course thanks to Tim Anderson, Marc Blank, Bruce Daniels, and Dave Lebling at Infocom for creating the fantastic Zork game!  Have fun playing Zork!




Post a Comment

Be sure to select an account profile (e.g. Google, OpenID, etc.) before typing your comment!