The Windows version of the first-person shooter game Doom has now been ported to the Raspberry Pi Pico, a device with just 2MB of flash memory.
Doom, a legendary 90s-era game released for MS-DOS, has been ported to Windows, Linux and almost every OS, device and console on Earth. Now, the Pi Pico has joined that list.
Raspberry Pi released the Pico for $4 a pop last January, a microcontroller powered by Raspberry Pi’s RP2040. The Pi Pico ships with 2MB flash memory while the RP2040 supports up to 16MB of memory. The company now sells reels of the RP2040 chips for between $1 to 70c a piece.
The new Doom port for Pico is the work of Graham Sanderson, a principle software engineer at Raspberry Pi, who has been running software efforts behind the RP2040 and the Pico’s software development kit (SDK).
He’s also been working on a port of the PC version of Doom for the Pico and has posted a few videos showing his port in action with full audio on a VGA-connected display.
Detailing his progress on Doom for RP2040 in a blogpost, Sanderson admits the RP2040 isn’t the smallest platform Doom has been ported to, but is arguably the cheapest.
As Raspberry Pi chief Even Upton notes, there was a simpler Game Boy Advance version running on Pico but Sanderson’s port runs the original shareware DOOM1.WAD files – .WAD is a file format for Doom on PC – with the original audio. The Pico port of Doom also supports four-player network games over I2C.
Sanderson managed to cram the executable and a compressed version of the shareware 4MB DOOM1.WAD into the Pico’s 2MB flash memory.
SEE: Employers are desperate for data scientists as demand booms
“Getting the whole shareware game to fit in 2M is hard work. The level data, music and graphics are all compressed in novel/custom manners. All compressed level data and graphics must be random-accessible in flash, as there is no spare RAM to compress even one level worth of anything,” Sanderson notes.
The end result is that the original shareware Doom for PCs can be played from a Pi Pico with 2MB of flash and outputs to a VGA display controller. Meanwhile, Ultimate Doom and Doom II are playable on an RP2040 with 8MB flash memory.
As Upton notes, Doom might seem like a “frivolous application”, but there’s a serious point in that it demonstrates just how powerful RP2040 can be in the hands of an experienced user. “It offers plenty of memory and integer compute performance; flexible I/O, used here to drive a VGA monitor and interface to a USB keyboard; and, critically, the ability to simultaneously drive every element of the chip hard without tripping over yourself,” he said.