Advent 2026: Accelerating Hard Drivin'
I haven’t done 24 of these, but for the next few weeks of Advent, I’ll pull out one Spectrum adventure I’ve had in the past couple of months, hopefully finishing in the final week with a complete “new” game. But first, let’s start with improving one of the most technically ambitious Spectrum arcade conversions ever made: Hard Drivin’.
Hard Drivin’ was a filled-3D driving game made by Atari and released in 1989. The idea of converting such a game (which used two graphics processors, a DSP, and a 68010 CPU) to the poor Spectrum’s Z80 seemed insane…and yet Domark managed to put out a reasonable-looking conversion although it was saddled with an appalling frame-rate.
From this:
To this:
A few years later, Argonaut (the team behind Starfox/Starwing on the SNES and Starglider on the 8/16-bits) released a conversion of the game’s sequel, Race Drivin’, on the Nintendo Gameboy. And it is fast:
Okay, maybe fast is in the eye of the beholder, but it runs at a decent clip of 10fps, which is pretty impressive for the Gameboy’s slender computing power. But I had a thought: the Gameboy’s CPU is essentially a Z801, and the Spectrum definitely has a Z80. Would it be possible to look at what wizardry Argonaut did and bring that back to the Spectrum version?
I broke out skoolkit and Claude…and quickly came across a bit of a difference. The Spectrum version uses a hand-rolled division routine for vertex projection, whereas Argonaut used a set of tables and end up with a method where vertex projection becomes two table lookups and a subtraction - much faster! This pinged old memories of doing OpenGL graphics work back in the 90s at universities and how tables can be your friend in a low-resource situation. So what we needed to do was rip out the software divide and find some space for those tables in the Speccy code. This ended up being a little more complicated; there wasn’t a lot of available space in the 48k rubber-keyed wonder, so Claude and I just made our version 128K only and slotted the tables into the machine’s Bank 4 memory. One quick benchmark later and we could see that the original code takes 2,660 cycles for vertex projection, and the table-based code takes 1,630, giving us a rough 40% speed increase for that routine.
We don’t quite see all of that speedup in gameplay; the projection code is only about 37% of the total time needed to draw a frame. But! Here’s a little play-through of the game’s stunt course with the original on the left and my changes on the right. We almost get to 5fps! The game feels a little more playable than it did back in the day, and steers less like a 1200ft boat sliding through quicksand…
Here’s the TAP file if you’d like to take it for a spin.
Next week: we look at a different universe where Ocean kept some better records on their projects…
-
It’s a little complicated. It’s not a Z80, but acts enough like one that you can mostly pretend it is… ↩︎