New Z-code interpreter: Krebf

I’m writing a Z-code interpreter in Ruby. It’s (just about) complete enough to be of some use. It can currently play version 1, 2 and 3 games. I mean to make it handle v4, v5, v7 and v8 as well, in the near future.

My motivation for writing it, except that it’s simply fun, is to make it a platform to aid in debugging and profiling of Z-code programs. Thus the name, of course.

To use it, you need to have Ruby installed. The interpreter doesn’t rely on any extra gems (Ruby packages) or other dependencies. Should work fine on Windows, Linux and Mac.

Find it at GitHub - fredrikr/krebf: A Z-code interpreter in Ruby · GitHub

19 Likes

Added restart support, a statusline, and accented character support.

2 Likes

I added MORE prompts, and rewrote the statusline code, as it turned out to be crazy slow on Linux. Now it’s fast.

1 Like

I added support for split-screen. Since the interpreter still doesn’t support v4+ games, this is currently only useful in one game: Seastalker. :slight_smile:

I have now added:

  • streams handling (printing transcript to a file, printing/reading commands to/from a file, printing to memory)
  • the @sound_effect opcode (only capable of playing a beep).

This means z1-z3 support is now complete. Please report any bugs you find, on Github if convenient, or here if not.

I’ll start work on z4+ support.

1 Like

“z1 support” :slight_smile:

Neither super-important or super-hard to do :slight_smile: . As you’re probably aware, you can find a few early versions of Zork 1 & 2 in z1 and z2 format at The Obsessively Complete Infocom Catalog

1 Like

Of course it’s important! We can finally get jigsaw.z1 :wink:

2 Likes

But, seriously: I’m excited about this. A scriptable interpreter is always cool!

2 Likes

Honestly, I appreciate Infocom bumping the version number when they updated the text compression scheme, so we don’t need a bunch of special cases!

…except version 6, which is nothing but special cases.

Actually, I think my least favourite part of the v1+v2 specification, is that if two or more characters in sequence in a dictionary word are from the same row of the alphabet table, a shift lock code should be used to change to that alphabet. Anyway, I don’t think this scenario occurs in any existing story file, and we see relatively few new v1 and v2 story files appear these days…