3D MONSTER MAZE =============== Introduction This game presents a conversion of the classic ZX81 game 3D Monster Maze written by Malcolm Evans and orginally published by J K Greye Software Ltd in 1981 and subsequently by New Generation Software Ltd. 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 sold by New Generation Software. 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 2 places within the code that needed to be patched. Even with the display file patch in place, the Spectrum conversion ran significantly faster than the ZX81 original and so a delay had to be introduced to achieve a speed approximating that of the ZX81 original. The main game loop returns to BASIC in order to read the keyboard and after this it performs a delay using a FOR loop that sets the speed of the game. By defining a suitable scaling factor and applying it to all FOR loops using within the BASIC program to create a delay, the game was made to run at a speed close to that of the ZX81 original. In the ZX81 version, the maze is generated while in FAST mode, i.e. during the 'mists of time'. To simulate this on the Spectrum, the screen attributes and border are set to BLACK while the maze is being generated and then restored to white afterwards.