Romhack Thursday: Doom on a Commodore 64, kinda-sorta

On Romhack Thursdays, we bring you interesting finds from the world of game modifications.

Look at that title and marvel a bit. Doom on a C64! What an idea. How could it even be possible? What an age we live in. It is a time of wonders. Children are our future.

Of course there’s more to it than that. There is a whole class of “retro” game that amounts to implementing the actual game on separate hardware, and using the supposed host platform as a glorified display and input device. That’s what’s going on in this case. Doom is really being run on a Raspberry Pi in a plug-in cartridge on a processor that’s underpowered by modern standards but far outpaces that of even Doom’s base configuration, and is thousands of times more powerful than the Commodore 64 to which it pipes its output.

But there’s still some technical interest in the means. The device that runs it is a “RAD Expansion Unit,” a DIY device that emulates a C64 RAM expansion, and apparently can even take over from the 6510 CPU and drive the system’s hardware directly. It works by writing to the VIC-II video and SID sound chips itself.

There was still a lot of coding work required to make this possible. A C64 has somewhat decent sound hardware, but the VIC-II chip has severe limitations on what it can display. The Raspberry Pi has to take the game’s display and port it, in real-time, to a graphics chip that can only display up to four colors (out of only 16) in each character cell, and that’s by sacrificing half of its horizontal resolution. Doing that on the fly itself is a noteworthy hack.

Could it be possible to run DOOM on a C64 without such assistance? At native resolution, ha ha ha: no. The memory limitations are too grievous, so at the very least you’ll need a RAM expansion.

I’ve mused at times on whether it might be possible if one uses the character screen as a kind of super-low-resolution graphics mode, each 8×8 character block representing either a 2×2 pixel grid (so, a resolution of 80×50) or a single pixel (40×25). Even at such a resolution 60 fps is probably out of the question, for it takes a lot of cycles to change every tile every frame, but maybe at 30 or 20? 15, 12, 10? (60 is divisible by a lot of numbers.) I will leave that question to people who are more current with C64 assembly coding.

Here is a demonstration video:

Doom on C64 – A playable tech demo for the RAD Expansion Unit for Commodore 64/128 (Youtube, 19 minutes) – Github repository