TechBuzzPro

How to Run Doom on Unusual Hardware: A Beginner's Guide

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to get the classic game Doom running on almost anything with a screen and a processor—from smart fridges and calculators to printers and even a lawnmower. You'll learn the core concepts, the essential tools, and the step-by-step process to port Doom to your own unusual device. No prior programming experience is needed, but basic familiarity with command lines and hardware connections helps.

What You'll Need

  • Doom source code: The original Doom source code was released under the GPL. You'll need a copy of the source for the version you want to port (e.g., the classic Doom, or a source port like Chocolate Doom or PrBoom).
  • A development environment: A computer with a compiler (like GCC or Clang) and the necessary cross-compilation tools if your target hardware uses a different architecture.
  • The target hardware: The device you want to run Doom on. It must have some form of display (even a tiny LCD), a way to accept input (buttons, keyboard, or a serial connection), and enough memory to hold the game's data (at least a few hundred kilobytes).
  • Doom game data (WAD file): The shareware version of Doom (doom1.wad) is freely available and sufficient for testing. You'll need to extract it from the original shareware installer or find it in a legal archive.
  • Basic tools: A USB-to-serial adapter, jumper wires, a soldering iron (if your device requires hardwiring), and a multimeter for checking connections.

Step-by-Step

  1. Choose your target device wisely. Not every device is a good candidate. Look for something with a display that can show at least a 320x200 resolution (even if scaled down), a way to read button presses, and a microcontroller or CPU that can run at a reasonable speed (at least 20 MHz). Popular choices include graphing calculators, old PDAs, smartwatches, and IoT development boards.
  2. Get the Doom source code. Download the source for a lightweight port. Chocolate Doom is a good starting point because it aims for accuracy and has fewer dependencies. If your device is very limited, consider the original Linux Doom source (from id Software's FTP) or a minimal port like "Doom for calculators" that already exists for some platforms.
  3. Set up a cross-compilation environment. If your target device uses a different CPU (e.g., ARM, MIPS, or a custom microcontroller), you'll need a cross-compiler. For example, to compile for an ARM-based device from a PC, install the arm-none-eabi-gcc toolchain. For a calculator, you might use the manufacturer's SDK.
  4. Study the source code structure. Doom's source is split into modules: i_video.c (video output), i_sound.c (sound), i_input.c (keyboard/mouse), and i_main.c (main loop). You'll need to replace these platform-specific files with your own implementations that talk to your hardware.
  5. Write a minimal video driver. The video driver must be able to set a video mode (or directly write to a framebuffer) and draw pixels. For a low-resolution display, you can scale down the 320x200 framebuffer. Many ports have a "scale" option; you can also write a simple nearest-neighbor scaler.
  6. Implement input handling. Map your device's buttons to Doom's controls: up/down/left/right for movement, and fire/use/weapon selection. If your device has a keyboard, that's easier. For a custom button matrix, you'll need to read GPIO pins and translate them to Doom's event system.
  7. Add a timer. Doom needs a reliable timer for game speed. Use the device's built-in timer or a real-time clock. The game expects a tick every 1/35th of a second (35 Hz).
  8. Compile and link. Run make or your build system. You'll likely encounter errors—missing headers, unsupported functions, or memory issues. Fix them iteratively. Start by compiling just the core game logic (without sound) to simplify.
  9. Transfer the binary and WAD file. Copy the compiled executable and the doom1.wad file to your device. For a calculator, you might use a USB cable and the manufacturer's transfer tool. For a development board, you can flash it via serial or SD card.
  10. Run and debug. Power on the device and see what happens. It might show a black screen, a glitchy image, or a crash. Use a serial console (if available) to print debug messages. Common issues include wrong memory addresses, missing endianness handling, and timing problems.

Common Mistakes

  • Ignoring endianness: Many embedded devices are little-endian, but some (like older PowerPC) are big-endian. Doom's WAD file is little-endian, so you may need to swap bytes when reading.
  • Assuming enough memory: Doom needs about 4 MB of RAM for the game data and rendering. If your device has less, you'll need to load the WAD from external storage or use a compressed format.
  • Forgetting the timer: If the timer is too fast or too slow, the game will run at the wrong speed. Test with a known frame rate.
  • Not scaling the display correctly: If your display is smaller than 320x200, you must scale down or crop. Cropping can make the game unplayable because you can't see enemies coming.
  • Using the wrong keyboard layout: If your device has a keyboard, the key codes may not match Doom's expectations. You'll need to map them manually.

Tips

  • Start with a simple port: Look for existing ports for similar hardware. For example, if you're porting to a graphing calculator, see how the TI-84 Plus CE port works—it uses a scaled-down resolution and a custom input handler.
  • Use a serial console for debugging: A UART connection to your PC can print debug output, which is invaluable when the screen is blank.
  • Optimize for speed: If the game runs slowly, reduce the screen resolution, disable sound, or use assembly optimizations for critical routines.
  • Test with the shareware WAD first: It's smaller and free, so you can iterate faster.
  • Keep a backup of your working source: Use version control (like Git) to track changes, so you can revert if you break something.

Troubleshooting

  • Black screen on boot: Check your video driver initialization. Make sure the display is properly configured and that you're writing to the correct memory address. Try drawing a test pattern (like a solid color) before running Doom.
  • Game runs too fast or too slow: Adjust the timer frequency. Doom expects 35 ticks per second. If your timer is off, the game speed will be off.
  • Controls don't respond: Verify that your input driver is generating events. Print the key codes to the serial console to see if they match what Doom expects.
  • Out of memory errors: Reduce the screen resolution (e.g., 160x100) and disable sound. Also, ensure you're not loading unnecessary assets.
  • Garbled graphics: This often indicates an endianness issue or incorrect pixel format. Check that your framebuffer format matches what Doom expects (8-bit paletted).
  • Game crashes when starting a new level: The WAD file might be corrupted or not fully loaded. Verify the file size and checksum.

Frequently Asked Questions

Can I run Doom on a smart light bulb?

If the bulb has a microcontroller with a display (unlikely), yes. Most smart bulbs don't have a screen, so you'd need to hack one with an external display, which is more of a custom hardware project.

Do I need to know C programming?

Yes, a basic understanding of C is essential because Doom's source is in C. You'll need to modify and compile it.

Is it legal to port Doom?

The Doom source code is under the GPL, so you can use it freely. However, the game data (WAD files) are copyrighted. The shareware version is freely distributable, but the full versions require a license.

How long does it take to port Doom?

For a beginner, it could take several weeks to months, depending on the complexity of the hardware and your experience. For a simple microcontroller with a pre-existing port, it might be a weekend project.

What is the most unusual hardware Doom has been run on?

People have run Doom on printers, calculators, smart fridges, and even a lawnmower. The most unusual are often just for fun, using a small screen and a custom controller.

Can I run Doom on a device without a screen?

You could output to a remote screen via serial or network, but that's not really running on the device—it's just using it as a server. For a true port, you need a local display.