Tuesday, February 13, 2024

Safi's "3D Engine DEMO" (2020) - Doom on ZX81?

Legendary first person shooter game "Doom" requires a little more horsepower than the Sinclair ZX81 has to offer. But then, a VIC-20 can do it, so why shouldn't the ZX81?

Spoiler: So far, "3D Monster Maze" (1981) is still the most realistic first person "shooter" game for the little ZX81. 

But there are some efforts to push the boundaries - one of which is this 3D engine demo by Sandor Safar from 2020, found on his YouTube channel "Safi's ZX-81".

It looks a bit crude, there are no walls, no enemies, no objects to interact with, you can't shoot, not even turn, and there are no maps or levels. But it works! We can move around smoothly in a 3D rendered 2D playfield! :-) The demo is written in BASIC, and compiled to machine code - giving it the speed required for fast graphics.

LISTing "3D Engine DEMO" gives a couple of clues: The BASIC code has been compiled with ZXGT

Obviously, this is just a technical demonstration, far from a "usable" game - but it's still impressive, and, well, who knows, maybe one day we'll play some sort of actual Doom on the ZX81? Also this demo is a great example of how BASIC programmers can create fast programs by using a machine code compiler such as ZXGT or MCODER2.

You can download the .p file and try it on your own ZX81, see video description / link below.

LISTing the "3D Engine DEMO", we can see that the BASIC code is still there, with some information added in the REM statements: It's been compiled with ZXGT (MCODER), and the machine code program starts at address 18823.

To run the (extremely slow) BASIC version, type RUN.
To run the (amazingly fast) machine code version, type RAND USR 18823.

 

No comments:

Post a Comment