*** This is Zig, the Z-machine in Glulx, release 1.0 *** (c) 2002, Jon Zeppieri Please see the file COPYING for license. (Briefly: it's the BSD license.) 0. Overview Zig is an implementation of the Z-machine, the virtual machine designed by Infocom[1] to run their games. Zig is written in the Inform language, which, for the most part has been used to write programs that run *on* the Z-machine. As far as I know, Zig is the first Z-machine to be implemented in Inform[2]. Specifically, it is written in Glulx Inform[3], which is to say, the "dialect" of the language that can be compiled to the glulx virtual machine. Thus, Zig is a virtual machine (the Z-machine) that runs on a virtual machine (the glulx VM). (Does that make it slow? Yes, I'm afraid it does. On modern hardware, however, most games run acceptably fast, but some do not. I've noticed that v8 games, in particular seem slow, and I'm not sure what the cause of this is. v8 games are, of course, larger than the rest, but that fact, by itself, shouldn't have an appreciable effect on speed. At any rate, if I ever have time to work on Zig again, much of that will be spent optimizing it.) 1. What is supported; what is not Specifically, Zig supports versions 1-5 and 7-8 of the Z-machine, although versions 2 and 7 have not been tested. v6 is not supported and almost certainly never will be. Zig is almost compliant with version 1.0 of the Z-machine specification. Since Zig is a glulx program, its I/O capabilities are strictly those of Glk, and Glk is not quite powerful enough to model the Z-machine's I/O properly.[4] Specifically, Zig does not support: * color * full unicode (only latin-1) * terminating characters * sound (this would require a rather small change to Glk) * font 3 * font 2 (as if it were possible to support this...) On the other hand, Zig does support: mouse input, timed input, quetzal save and restore, undo, transcripts, command scripts, and so forth. 2. Running the executable Zig is a glulx program, so you need a glulx interpreter to run it. You can obtain one from [http://www.ifarchive.org/indexes/if-archiveXprogrammingXglulx.html]. I'm afraid Zig lacks a decent user interface at the moment. When you launch it, it will immediately prompt you to load the z-code program you want to run. If you fail to select a file, it will exit. If you select a file that is not a valid z-code program, it will lose its mind. (I spent a little bit of time trying to work around this, but I failed. It certainly a soluble problem, though.) If you do select a valid z-code file, it will be run. Very simple. 3. Building the source A makefile is included with the source, but it is not magical. For one thing, it is meant for UNIX systems (MacOS X will do nicely, of course). For another, it requires (1) that cpp (the C pre-processor) be in your path and (2) that the environmental variable INFORM be set to the location of your Glulx Inform compiler (or just "inform" if it is in your path). So, in bash, you would type: export INFORM=/foo/bar/wherever/your/compiler/is/inform or, in a C-shell: setenv INFORM /foo/bar/wherever/your/compiler/is/inform Then you simply type "make" (sans quotation marks, of course), and it should build the zig.ulx file. You can also "make clean" to get rid of the executable and pre-processed files. (The way the build process works is very simple. The files with a ".ipp" extension are run through cpp and they are translated into ".inf" files. These are then compiled by inform into zig.ulx.) 4. A brief apology The source is rather nasty, I know. Sorry about that. 5. Credits The designers of the Z-machine, Graham Nelson (for Inform), and Andrew Plotkin (for Glulx Inform and Glulx itself) all deserve credit, as does Ervin Robertson, whose Nitfol interpreter was often helpful as a reference. I also want to thank the people who have written me with bug reports. (These people are named in the CHANGES file.) 6. Bugs Please report all bugs to me (or fix them and send me a patch). Enjoy. ---------- [1] Infocom is now defunct (or, rather, part of Activision. See [http://web.mit.edu/6.933/www/Fall2000/infocom/] and [http://www.csd.uwo.ca/Infocom/] for details. [2] http://www.eblong.com/zarf/glulx/index.html [3] http://www.inform-fiction.org/ [4] This is certainly not to say that Glk is *less* powerful than the Z-machine's I/O system. In fact, it is clearly more powerful. However, it cannot express a few details required by the Z-machine spec. For the most part, these are not very important.