2025-04-12 Notes on Porting a UNIX Classic with Cosmopolitan I made standalone executables of the Zork trilogy, ported from original Infocom UNIX source to Cosmopolitan, are available for Windows/Mac/Linux/bsd for arm/x86 machines. These require no further installation nor external files to play. Here’s how to download and play Zork on the CLI: wget https://github.com/ChristopherDrum/pez/releases/download/v1.0.0/zork1 chmod +x zork1 ./zork1 # This one executable runs on any and all targetted platforms # `zork2` and `zork3` are available, for trilogy completionists # Windows users, add `.exe` to the downloaded file to make Windows happy Want to run an arbitrary .z3 text adventure file? Download the z-machine from here About the project Recently I published v3.0 of Status Line, a project which makes Zork playble on the Pico-8, onto three major operating systems. With that deployed successfully (is there a ‘knock on wood’ emoji?) I turned to porting Infocom’s original UNIX z-machine source code through the use of Cosmopolitan. After about six hours on a lazy Sunday I had it ported to six major operating systems, including Windows. Unlike Status Line which relies on the Pico-8 virtual machine host, this port runs natively on all supported systems. Even better, thanks to Cosmopolitan magic, there is only one distributable to maintain which can conform itself to run on whichever operating system is running it. Here’s the story of how and why I decided to do this project and what I learned along the way. What is a Z-Machine? Over the years I’ve spent a lot of time looking at and thinking about the Infocom z-machine. Briefly put, Infocom text adventures were released as platform-independent game files which ran within platform-specific virtual machines for every system the company supported. The spec for that virtual machine is known as the “z-machine.” I don’t know if they were “the first” to ship a commercial product using a VM on home computers, but they were definitely ...
First seen: 2025-04-14 04:02
Last seen: 2025-04-14 18:05