Zoom - A Z-Machine ----// 8888 \\---- by Andrew Hunter Zoom was originally designed as an experiment into writing fast bytecode interpreters, just over 3 years ago (first checkin into the CVS repository was on 19/11/2000). Last time I timed it, it could run up to around 2x faster than frotz, depending on what code was being executed. It's changed a lot since then, as the emphasis is now on designing a good user interface for the interpreter. As I changed my main machine from a Linux PC to a PowerMac about a year ago, and for another reason that will be revealed later in the year, the recent development focus has been on producing a Cocoa interface. Send any bug reports to andrew@logicalshift.co.uk, and anything else to andrew@logicalshift.co.uk. Zoom's homepage can be located at http://www.logicalshift.co.uk/unix/zoom/ You can get the latest version of the source code at any time using git: git clone http://code.logicalshift.co.uk/zoom/zoom.git git submodule init git submodule update Versions ======== This is version 1.1.5 of Zoom. As the components have gained an increasing tendency to change at different rates, I've given them separate versions: Zoom interpreter core: 1.1.5 X11 interface: 1.1.5 Windows interface: 0.9.99beta5 Carbon interface: 1.0.1 Cocoa interface: 2.1.5 ZoomPlugins: 1.1.5 Spotlight importer: 1.5 QuickLook plugin: 1.1.5 CocoaGlk version: 1.0.8 Glulxe version: 0.4.7 Note that Zoom's display system underwent a fairly major change between 1.0.0 and 1.0.1 due to the addition of version 6 support. This means that the Windows version of Zoom will not compile any longer. The 2.0 version of the Cocoa interface refers to the version number displayed in the About box for the Macintosh version of Zoom. Compiling Zoom ============== (See later for Cocoa) To get a full-featured interpreter under X windows or Carbon, you'll want to have at least libpng installed. For X, having an X server with Xrender and Xft is a good idea. T1Lib is optional, but appears to provide improved rendering quality over Xft (which seems to have great difficulties with hinting). With all the libraries installed, ./configure && make should be all that's required to build Zoom for either X or Mac OS X (Carbon). Please report any build problems to the bugs address listed above: Zoom should work on a reasonably wide variety of systems. You can also build the Carbon version of Zoom by opening the Zoom.pbproj file in Project Builder. The Cocoa version of Zoom has to be built with XCode, using the ZoomCocoa.xcode file. Building with project builder may cause problems with yacc generating corrupt files, producing many spurious errors (XCode does not appear to have these problems). If this occurs, delete the relevant files from the build/Zoom.build/DerivedSources directory. You may want to try the --enable-new-terp option to configure: this enables an experimental new interpreter design. This gives gcc's optimiser a much easier time of things (improving compile times considerably). This style of interpreter produces a slight (almost insignificant) performance hit. I've experienced problems with gcc 3's optimiser: specifically, it reduces the speed of some instructions by a factor of up to 6 (0OPs, usually, for some reason - see the results of NopMark in zmark). No idea why at all - this effect is most marked with the new interpreter style. Note that compiling the interpreter can be a great workout for your system; on my Mac OS X machine, it needs nearly 1Gb of memory to compile successfully with gcc 3.3. Earlier versions of gcc require much less memory; I have successfully compiled under x86 linux on a machine with 32Mb of memory and gcc 2.95; the PPC version of gcc seems to require much more memory for optimisation than the standard version, too. Regardless, at least 256Mb of memory is recommended for those that wish to compile Zoom. Compiling Zoom (Cocoa) ====================== Before compiling, you will need to have a version of the expat library unpacked into the directory containing the Zoom source directory. Use a symbolic link, or rename this directory 'expat'. Currently, the Zoom binaries link against expat 1.95.8: later versions may also work. (Zoom is statically linked against expat as it was an optional install on versions of OS X prior to 10.3) You will also need the babel utility and the Sparkle library in the directory containing the Zoom source code. Finally, you will need the dependencies in the depend directory: this means CocoaGlk at the moment. The easiest way to get these is to use git: in the depends directory type this: git clone http://code.logicalshift.co.uk/zoom/cocoaglk.git CocoaGlk If you want to use the versions that correspond to a specific release, use git checkout with the version number. For example, git checkout v1.1.5. Note that CocoaGlk requires you to download versions of the git and glulxe interpreters to compile it. Rather than use the configure/automake process for this, I have elected to use Xcode: to compile the new version of Zoom, load the ZoomCocoa.xcode project into Xcode and hit build. Note that Xcode seems to have a hard time running Yacc; if the build fails with many weird errors, you will have to manually delete the relevant DerivedSources (hidden in build/ZoomCocoa.build/ZoomServer.build). There also seems to be an occasional problem with precompiled headers that will produce similar problems (errors in Carbon headers this time), but simply restarting the build process will fix this - you are much more likely to see problems with building the Yacc sources. Using Zoom (X-Windows) ====================== Running Zoom is fairly simple - zoom should do the trick, where is a Z-Code file (modern files created by Inform tend to have a .z5 or .z8 filename, original Infocom files tend to have a .dat or .zip filename - note that the .zip stands for 'Z-Code Interpreter', not PKZip as you might think). Assuming you haven't tinkered with zmachine.h, Zoom will support Z-Code versions 3, 4, 5, 6, 7 and 8. As of version 1.0.1beta1, version 6 is fully supported, as is the Standard v1.1draft6. Unicode support is also much improved from this release. Zoom needs a configuration file called '.zoomrc' in your home directory. This file tells Zoom about the colours and fonts it should use, and also identifies game titles. It consists of many entries of the form 'game "mygame" 12.345678 { options }', where 'mygame' is the text that appears in the title bar, and { options } is the options for this game (in curly brackets). You can omit the options altogether if you want the options to be the same as the default. There is also exactly one default block, which has the form 'default "%s (%i.%.6s)" { options }'. The default block must define the interpreter number and revision, at least 4 fonts, and the default set of colours: # Standard settings - applies to all interpreters # (Note, font 4 must always be fixed-pitch) default "%s (%i.%.6s)" { interpreter 1 revision Z font 1 "-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*" roman font 2 "-*-helvetica-bold-r-*-*-14-*-*-*-*-*-*-*" bold font 3 "-*-helvetica-medium-o-*-*-14-*-*-*-*-*-*-*" italic font 4 "-*-courier-medium-r-*-*-14-*-*-*-*-*-*-*" fixed font 5 "-*-courier-bold-r-*-*-14-*-*-*-*-*-*-*" fixed-bold font 6 "-*-courier-medium-o-*-*-14-*-*-*-*-*-*-*" fixed-italic font 7 "-*-courier-bold-o-*-*-14-*-*-*-*-*-*-*" fixed-bold-italic font 8 "-*-helvetica-bold-o-*-*-14-*-*-*-*-*-*-*" bold-italic font 9 "font3" symbolic colours (0,0,0), (255,0,0), (0,255,0), (255,255,0), (0,0,255), (255,0,255), (0,255,255), (255,255,204), # These are the colours provided by DOS interpreters (187, 187, 187), (136, 136, 136), (68, 68, 68) size 80, 30 gamedir "/usr/local/share/games/zcode" savedir "/home/me/zcode/save" } This illustrates most of the available options. Unless you have a particular reason for setting the interpreter number and revision, the values given should do a reasonable job (version 6 games, and Beyond Zork benefit from setting the interpreter number). Fonts are defined using statements of the form: font ""