Moog One - Doom

What do you do once you get access to a new Linux system, install Doom of course! This turned out to be a bit more complicated due to the LCD being mounted upside down. Perhaps for better viewing angles from the playing position or case fitment. The firmware handles the LCD orientation in a couple ways. For framebuffer, early boot splashes, the spash being displayed is already upside down. On launching the X session in /etc/init.d/S43gui the session is flipped with DISPLAY=:0 xrandr -o inverted.

I went with Chocolate Doom for no particular reason, just needed to cross-compile it for the ARMv7 inside. Instead of setting up a proper cross compiler toolchain environment I used a Raspberry Pi I had sitting around. The CPUs are very similar and is quite a bit easier for a quick build.

A small patch was needed to rotate the screen. The full patch is available here: chocolate-doom-patch.diff.

// Part of patch to src/i_video.c to flip and mirror the screenbuffer.
SDL_LockSurface(screenbuffer);
SDL_Surface *tmp_screenbuffer = SDL_ConvertSurface(screenbuffer, screenbuffer->format, SDL_SWSURFACE);
for (int y = 0; y < screenbuffer->h; y++) {
	for (int x = 0; x < screenbuffer->w; x++) {
		putpixel(screenbuffer, x, y, getpixel(tmp_screenbuffer, screenbuffer->w - x - 1, screenbuffer->h y - 1) );
	}
}
SDL_UnlockSurface(screenbuffer);
SDL_FreeSurface(tmp_screenbuffer);

With the patch complete we can build Chocolate Doom.

apt install build-essential dh-autoreconf libsdl-mixer1.2-dev libsdl1.2-dev libsdl-net1.2-dev
wget https://github.com/chocolate-doom/chocolate-doom/archive/refs/tags/chocolate-doom-2.3.0.tar.gz
wget https://archive.ryanzachry.com/moog-one/chocolate-doom-patch.diff
tar -xzf chocolate-doom-2.3.0.tar.gz
cd chocolate-doom-2.3.0
patch -p1 < ../chocolate-doom-patch.diff
./autogen.sh
make

Now to transfer over the resulting binary and a WAD file. moog-one-doom.zip has the already patched and built Doom along with a shareware WAD. While it is playable there is much more to be done, no sound, needs USB keyboard and the X session is destroyed after quitting. It would be cool if Doom routed the MIDI to the One for the music, I’ll leave that exercise for someone else.