Introduction

This page presents a conversion of the classic ZX81 game Mazogs written by Don Priestley and published by Bug-Byte Software Ltd in 1981. The conversion is not a rewrite of the game but actually uses the original code to deliver an experience as close to the ZX81 version as possible, and builds upon the commented disassembly I produced of the ZX81 game. The conversion requires a Spectrum with at least 48K of RAM. To complete the conversion, a loading screen was added based upon the inlay cover artwork of the ZX81 cassette.


Mazogs Loading Screenshot Mazogs Game Screenshot

The fundamental mechanism behind the conversion is fairly straight forward. The machine code was simply re-assembled to reside exactly 16K higher up in memory and then the BASIC program adjusted so that every USR, PEEK and POKE had 16384 added to its address. In this way the program was completely clear of the Spectrum's display file.

However, the game generates its display to the ZX81's display file memory, which the Spectrum knows nothing about. Therefore, although the game would run happily once relocated, only a blank screen would be displayed by the Spectrum. The solution to this was to patch the machine code so that after the ZX81 display file memory has been updated, a new routine is executed that renders the image that the ZX81 would be displaying into the Spectrum's display file. Fortunately there were only 4 places within the code that needed to be patched.

The ZX81 game monitors the keyboard using the system variable LAST_K, whereas in the Spectrum conversion a patch has been inserted to read the keyboard directly. The ZX81 game uses the FRAMES systems variable to time the generation of the maze and also how long to display a view and the 'This Way' path shown by a prisoner. The Spectrum's FRAMES counter increments every 50th of a second whereas the ZX81's decrements. It was therefore necessary to generate an 'inverted' version of the Spectrum's FRAMES counter that decremented and to check this within the game instead.

Even with these patches in place, the Spectrum conversion ran significantly faster than the ZX81 original and so a delay was introduced after rendering of the ZX81 display into the Spectrum's display file. This delay was adjusted to achieve a game speed approximating that of the ZX81 original.

The unused random pattern routine located at address 18740 in the ZX81 version was also patched so that it would render correctly on the Spectrum. It can be viewed by BREAKing into the program while on one of the menu screens and typing RANDOMIZE USR (18740+16384).


Downloads

Click here to download the Mazogs conversion for the Spectrum in .tzx format.

If you wish to play the game using a cursor joystick interface then the game can be adapted as follows:

A video review of the converted game is available on YouTube.

I've also produced a version of Mazogs to run as a flicker-free game on the ZX80, which can be found here.