Skip to content
Adrian Siekierka edited this page Oct 9, 2020 · 2 revisions

OpenZoo/zoo is a repository with the following goals:

  • providing a Linux-based, more proper build system for ZZT ("base" branch),
  • providing various feature branches tracking functionality ("feature/" branches),
  • providing the mainline branches for the author's own ZZT forks ("project/" branches).

ZZT forks

There are currently two ZZT forks maintained as part of the OpenZoo project.

ChocolateZoo

The goal of ChocolateZoo is to provide an enhanced, drop-in, fully* compatible (excluding weird arbitrary code execution shenanigans) replacement for ZZT 3.2, usable with essentially all ZZT 3.2-compatible game worlds.

Current major, user-visible changes include:

  • Minor optimizations across many areas of the codebase,
  • Extended (EMS/XMS) memory support - no more fiddling with DOS to fit your worlds into memory!

ChocomintZoo

The goal of ChocomintZoo is to make the engine more consistent and capable. The boundary here is not world compatibility (though we're not going to go out of our way to break it), but world format compatibility - this allows usage of the wide ecosystem of external ZZT tools and editors. At this time, this mostly involves:

  • bugfixes which make the behaviour more consistent (see features/bugfixes-invasive),
  • lifting arbitrary limitations (board size, board count, maximum stat count) to the maximum allowed by the world format.

In addition, it also includes all of the changes in ChocolateZoo.

Potential other forks

Some additional forks have been considered, but either haven't yet been started or don't see a strong enough use-case.

  • VanillaZoo - ZZT 3.2 with optimizations only.
  • ChocolateZoo/pc98 - port for the NEC PC-98 platform; a vanilla ZZT 3.2 port already exists, if limited; it'd be a matter of porting it over to this GitHub.

New build system

The new build system relies on launching DOSBox in the background to build ZZT. In addition, it replaces LZEXE with the more effective UPX (in 8086 mode) for binary compression.

To use it:

  1. Put a Turbo Pascal 5.5 installation in the VENDOR directory. (If VENDOR/TP/TPC.EXE is a valid file, it's installed correctly.)
  2. Run ./build.sh.
  3. The output ZIP file(s) should be available in OUTPUT/.

In addition, some configuration files are available:

  • build.properties - a property file, in the "key=value" format. Every instance of %key% in the code will be replaced with value before compiling.
  • build.releases - each line defines a call to ./make.sh, which can take the following parameters:
    • -d DEFINE will define the "DEFINE" conditional in Turbo Pascal,
    • -e ZZT.EXE will cause the output executable to be called ZZT.EXE,
    • -o zzt.zip will cause the output to be put in zzt.zip,
    • -p build.properties will use build.properties as a property file.

Feature branches

feature/bugfixes-invasive

This branch contains bugfixes which affect game state functionally. This includes behaviour changes, but also crash fixes. As of writing, the following changes are included:

  • Fixed conveyors swapping stats in certain edge case scenarios. (asie)
  • Fixed crashes based on an element recursively pushing itself. (GreaseMonkey)
  • Fixed crashes when using #become, #go idle and/or /dir in a scroll. (GreaseMonkey)
  • Fixed #put on the bottom-most board row. (asie)
  • Fixed crash when trying to render cycle 0 transporters. (asie)
  • Fixed some edge-case handling in centipedes. (Tim Sweeney - backported from Super ZZT)

feature/bugfixes-nongame

This branch contains bugfixes which do not affect the game state. This can include fixes to the editor, user interface, etc. As of writing, the following changes are included:

  • Fixed I/O error windows not containing the correct error code, always displaying 0. (asie)

feature/bugfixes-visual

This branch contains bugfixes which only affect the game state visually and not in terms of behaviour. As of writing, the following changes are included:

  • Fixed conveyors not displaying one of the rotated items in an edge case. (asie)

feature/cpu-microoptimizations

This branch contains small CPU optimizations across the codebase. Importantly, they do not affect the layout of data in memory - just the code and/or stack.

feature/error-checking

This branch focuses on making ZZT's I/O operations (world loading and board opening in particular) more resilient against memory corruption and crashes. As of writing, the following changes are included:

  • Preventing boards above the maximum board size limit from being loaded. (asie)
  • Preventing worlds with more boards than the board count limit from being loaded. (asie)

feature/extended-memory

Based on Mr_Alert's work, this branch adds EMS and XMS memory allocation support to ZZT, removing problems caused by the conventional memory limit. It also makes the game crash, instead of pointing to corrupted memory, when an allocation fails (say, if only conventional memory is available and it runs out).

feature/memory-optimizations

Memory optimizations which do not affect the general memory layout of the data segment. Obviously, those will be rather limited. As of writing, the following changes are included:

  • Deallocating the board data buffer while displaying the list of worlds. This mitigates, but not resolves, edge case crashes with a large loaded world and attempting to open the World menu to load another world.

feature/memory-optimizations-invasive

The fun ones. As of writing, the following changes are included:

  • Pre-calculating the sound and drum data table. This speeds up loading, reduces memory usage and removes the requirement of floating-point calculation, saving about 6-7KB of conventional memory total.
  • Using an LFSR instead of a transition table to change between boards. While a bit slower on the CPU side, this saves about 7-7.5KB of conventional memory.

feature/new-video-code

New video drawing code!

  • Smaller and tighter ASM logic.
  • Better and more optimized CGA snow avoidance.
  • Not attempting CGA snow avoidance on non-CGA cards - leading to an even larger speed-up on those platforms.

feature/remove-printing

This branch saves about 1KB by removing printing functionality.

feature/remove-shareware

This branch removes the shareware/registered distinction, as well as the code to show "nag/pop-up" messages.

feature/toggleable-editor

This branch modifies the build system to create two binaries: ZZT.EXE, with the editor, and ZZT_NOED.EXE, without the editor (saving about 15KB of binary size and conventional memory).