DOOM's E1M1 rendered by Genesis Doom in a Sega Genesis emulator

I've Released Another Ambitious DOOM Port for the Sega Genesis

No enemies, no shooting—just a walk through DOOM's E1M1. I've released the source for my GBADoom-based Sega Genesis port, a walking simulator running within 64KB of RAM.

I previously wrote about getting DOOM running on the Sega Genesis. I've now also released the source for the other, equally ambitious port I briefly mentioned in that post.

This one is based on GBADoom, ported to the Sega Genesis (known as the Mega Drive in Japan) with an AI agent. There are no enemies, and you can't fire a gun. It's a walking simulator that lets you explore E1M1, DOOM's first level.

First, here's the demo video.

▶ A walkthrough of E1M1 all the way to the exit

I recorded this in Genesis Plus GX by automatically replaying ordinary controller inputs. The video runs at normal speed and includes activating the exit switch and the screen that appears after completing the level.

The port I said I'd like to “give a proper burial” someday

The port I released in the previous post was based on Doom64KB, which had been used for a Neo Geo port. This Genesis Doom is the GBADoom-based port I'd been working on before that.

GBADoom is a DOOM port for the Game Boy Advance. Here's the source and a video showing it in action:

Because it relies mainly on integer arithmetic, it looked like a manageable starting point for an embedded system. Bringing it over to the Genesis turned out to be quite a challenge, though.

Just fitting it into RAM was a struggle. I got badly stuck choosing a compiler, and differences in endianness meant repeated rounds of building and testing. This is the port I described in the previous post as “I haven't published that attempt — someday I'd like to give it a proper burial.”

Putting a pixel-rendered image on a screen that only displays tiles

The Genesis has 64KB of main RAM and a Motorola 68000 CPU running at about 7.6MHz.

Its VDP, which handles the display, doesn't simply show an image drawn into a framebuffer. It builds the screen by arranging 8×8-pixel tiles.

For this port, DOOM renders a small 120×64 image. I convert that into Genesis tile data and display it scaled up to 240×128. Rendering alone isn't enough: the image also needs to be converted into the display format and transferred to VRAM.

The tile layout for the game screen is set up at the start. After that, only the tile graphics are updated via DMA, reducing the amount of data transferred each frame.

What I cut to fit into 64KB of RAM

Making the screen smaller doesn't automatically make everything fit. Rendering workspaces and caches take up memory too.

So I removed status bar rendering, reduced temporary buffers and texture caches, and kept game data in ROM wherever possible, reading it from there.

Even so, RAM is packed pretty tightly. Adding a large array is obviously difficult, but even small changes in the memory layout can affect how the program behaves. It's been a challenge.

For the background music, I convert MIDI to VGM and then to XGM, and play it through SGDK's sound driver. The music runs on the Z80, separately from the 68000 that runs the game.

A walking simulator for exploring E1M1

There's no combat, but you can move around E1M1, take in the scenery, and walk to the exit. It's like strolling through a familiar level on the Genesis while listening to the background music.

The frame rate is 0.8 fps at the starting point, reaching about 2 fps near walls where the rendering load is lighter. Still, I got as far as rendering DOOM's world on a Genesis with 64KB of RAM and letting you walk around inside it.

The source is available

Here's the repository:

It combines the GBADoom-derived engine with Genesis-specific display, input, and audio code.

No ROM, WAD, or music data is included. To run it, you'll need to prepare the game data and other assets separately by following the README.

The other ambitious port, which was only a story about my struggles in the previous post, is finally out in the open. If you're curious about how it puts DOOM on screen within the Genesis's constraints, take a look.