Table of Contents

Zeta

Zeta is an 8086 emulator dedicated for running ZZT and Super ZZT written by Adrian “asie” Siekierka from 2018 onward. It was initially developed for the purpose of providing a lightweight, small HTML5-friendly emulator for the Museum of ZZT, but over time gained an additional purpose of working around some of ZZT's quirks. It is available, with source code, under the terms of the MIT license.

Hacks

Idle detection

ZZT, being a 1991-era DOS program, generally runs at 100% CPU time, without means of yielding control to the operating system. This would be unfavorable in a modern environment (laptop, web browser, etc.) As such, Zeta uses the following calls for idle detection:

Obviously, these are tailored for ZZT/Super ZZT's code logic, and may cause erratic delays in forks (or with a very high number of player clones). Currently, the interrupt 0xA5 extensions may be used to disable idle hacks and yield control to the operating system on Zeta.

Audio handling

Zeta does the following hacks in audio-related logic:

Extensions

Interrupt 0xA5

As of beta 27, Zeta has started allocating custom hooks under the INT A5h interrupt call. In order to detect the presence of a compatible version of Zeta, it is recommended to use the following code:

Show code example

To call an INT A5h interrupt, one must additionally set the register CX to one of the following values:

All calls also modify the carry flag - it will be cleared on success, and set on failure.

The following functions are provided by interrupt 0xA5:

AH=0x01, SET IDLE HACK MODE

Available since: Zeta beta 27.

Arguments:

Returns:

Nothing. Note that disabling idle hacks requires you to modify ZZT's source code to insert FORCE IDLE WAIT calls in the correct places! Example implementation.

AH=0x02, FORCE IDLE WAIT

Available since: Zeta beta 27.

Arguments:

Returns:

Nothing. Stalls code execution (without incurring unnecessary CPU usage for emulation) for a period of time not longer than the next frame or PIT tick. Note that the engine does not guarantee the next frame or PIT tick occuring! For PIT ticks in particular, you still want to check TimerTicks.

AH=0x03, DELAY

Available since: Zeta beta 27.

Arguments:

Returns:

Nothing. Stalls code execution (without incurring unnecessary CPU usage for emulation) for a period of time roughly matching DX milliseconds.

AH=0x04, SET KEY REPEAT DELAY

Available since: Zeta beta 30.

Arguments:

Returns:

Nothing. Please note that the repeat delays will be rounded up to the nearest PIT tick.