No description
  • C 85.7%
  • Shell 13.2%
  • Python 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-28 19:47:14 +02:00
config Add patches and build scripts 2026-09-27 12:52:59 +02:00
launcher Add patches and build scripts 2026-09-27 12:52:59 +02:00
patches Add software MUS music synthesizer (SFX-only before) 2026-09-28 19:46:57 +02:00
prboom-patch Add software MUS music synthesizer (SFX-only before) 2026-09-28 19:46:57 +02:00
scripts Add software MUS music synthesizer (SFX-only before) 2026-09-28 19:46:57 +02:00
sdl-patch Add patches and build scripts 2026-09-27 12:52:59 +02:00
.gitignore Add patches and build scripts 2026-09-27 12:52:59 +02:00
banner.png add banner 2026-09-27 13:36:06 +02:00
README.md Merge branch 'main' of ssh://git.tuxworld.nl:2675/jonas/tomtom-doom 2026-09-28 19:47:14 +02:00

Doom on the TomTom ONE IQ Routes

Run PrBoom 2.5.0 on a TomTom ONE IQ Routes GPS device (running OpenTom), with working video, audio, and a custom touchscreen control overlay driven directly by tslib.

This device has no Linux VT/console subsystem and no ALSA.

Everything in this repo is self-contained and downloads its own dependencies. You do not need any pre-existing OpenTom build tree.

Quick start

git clone https://git.tuxworld.nl/jonas/tomtom-doom
cd tomtom-doom
./scripts/build-all.sh

This downloads the ARM toolchain, tslib, SDL, and PrBoom sources, applies the required patches, and builds everything under build/ and toolchain/ inside the repo - nothing is installed system-wide.

You must separately obtain doom1.wad (the free Doom shareware IWAD - search "doom1.wad shareware download") and place it at config/doom1.wad before deploying.

Then, with the TomTom connected and lsblk showing its device:

./scripts/06-deploy.sh /dev/sdX1

Unplug and boot the TomTom.

What's in this repo

launcher/
  doom-launcher.c        Custom launcher replacing PNDNavigator.
                          Creates /dev/fb0 if missing, writes a
                          320x240 prboom.cfg, sets tslib/SDL
                          environment variables, and execs PrBoom.

sdl-patch/
  SDL_fbvideo.c           Patched SDL 1.2.15 fbcon driver. Applied
                          as a drop-in replacement during the build.

prboom-patch/
  i_video.c               Patched PrBoom 2.5.0 SDL video driver:
                          direct tslib touch input + a hand-drawn
                          overlay (D-pad, Fire, Use, Menu, Enter).
                          Applied as a drop-in replacement during
                          the build.

patches/
  tslib-old-kernel-compat.h   Defines EVIOCGPROP and related
                          constants missing from this toolchain's
                          ancient kernel headers, injected via
                          -include so tslib's own source is never
                          touched.

config/
  prboom.cfg              Forces 320x240 resolution (this device's
                          physical framebuffer size).
  doom1.wad               NOT included - you must provide this
                          yourself (see Quick start).

scripts/
  env.sh                  Sets up all paths, relative to the repo.
                          Sourced by every other script.
  00-fetch-toolchain.sh   Downloads + fixes the ARM GCC 3.3.4 /
                          glibc 2.3.2 cross toolchain.
  01-fetch-sources.sh     Downloads tslib 1.23, SDL 1.2.15, and
                          PrBoom 2.5.0 source archives.
  02-build-tslib.sh       Builds tslib (static lib + shared plugins).
  03-build-sdl.sh         Patches + builds SDL.
  04-build-prboom.sh      Patches + builds PrBoom, links against
                          tslib and the patched SDL.
  05-build-launcher.sh    Builds the launcher binary.
  06-deploy.sh            Copies everything onto a mounted TomTom.
  build-all.sh            Runs 00 through 05 in order.

Requirements to run build-all.sh

  • Linux x86_64 host (Debian/Ubuntu tested)
  • wget, tar, make, autoconf/automake/libtool (for tslib's autogen.sh)
  • An existing OpenTom installation already on the TomTom's internal storage, including opentom/lib/ (base OpenTom libc etc.) and opentom/share/doom/ (for the IWAD). This project only replaces the launcher, PrBoom binary, SDL library, and touch config - it does not install OpenTom itself.

Key technical findings (why the patches exist)

  • No /dev/fb0 node exists by default. The kernel driver (s3c24xx-lcd) is present and registered (/proc/fb, /sys/class/graphics/fb0), but the device node was never created. The launcher creates it itself via mknod, reading the major:minor from /sys/class/graphics/fb0/dev.

  • No VT/console subsystem. /dev/tty0, /dev/console, etc. exist as device nodes but return ENXIO/ENODEV on open - there is no kernel VT driver behind them. SDL's fbcon driver normally treats a failed console open as fatal ("Unable to open a console terminal"). The patch makes this non-fatal: PrBoom continues in a keyboard-less mode, which is fine since this project uses tslib for input, not the keyboard.

  • The framebuffer driver rejects mode changes. It only ever reports and accepts 320x240 @ 16bpp (RGB565). PrBoom by default requests an 8-bit paletted framebuffer at 640x480. The patch makes FBIOPUT_VSCREENINFO failures fall back to reading back whatever mode is already active instead of failing outright. config/prboom.cfg additionally forces screen_width=320 / screen_height=240 so PrBoom doesn't even try 640x480.

  • No ALSA. There is no /proc/asound, no /dev/snd - only a plain OSS-style /dev/dsp. PrBoom's SDL backend uses OSS fine by default; no patch was needed here.

  • Touchscreen raw range is 0-1023, not 0-4095. Measured directly via ioctl(fd, EVIOCGABS(ABS_X), ...): both axes report a 10-bit range, not the commonly-assumed 12-bit range.

  • Touchscreen axes are mirrored relative to the screen. A 5-point on-screen crosshair calibration test showed a high raw value corresponds to a low screen coordinate on both axes. TouchRead() in i_video.c maps this with measured extremes X: [92..953], Y: [70..925].

  • i_video.o lives inside SDL/libsdldoom.a. Recompiling i_video.c alone updates the .o on disk but not the copy already packed into the archive. 04-build-prboom.sh explicitly runs ar r + ranlib on the archive before the final link.

  • libgcc_s.so.1 in this toolchain requires GLIBC_2.4, which the device's glibc 2.3.2 does not provide. Both SDL and PrBoom are linked with -static-libgcc to avoid this entirely.

  • PrBoom's configure needs --disable-sdltest (it tries to compile and run a test SDL program, which cannot work when cross-compiling) and --disable-gl (no OpenGL on this target).

  • tslib's input-raw.c references EVIOCGPROP, which does not exist in this toolchain's kernel headers. Rather than editing tslib's source (fragile - a prior attempt at removing the reference broke an initializer), patches/tslib-old-kernel-compat.h is injected via -include during configure, defining the missing macro so the code compiles unchanged. At runtime the ioctl just fails harmlessly, which tslib already handles gracefully.

Known limitations

  • Menu navigation and in-game controls share the same physical button layout; the same button sends a different key depending on gamestate (see the key_level / key_menu fields per button in i_video.c).
  • No support for rebinding controls from the overlay itself - the button-to-key mapping is compiled in.

Music

PrBoom normally plays music through SDL_mixer + TiMidity, which needs hundreds of MB of instrument patches and far more CPU than this ~200 MHz, FPU-less ARM9 has. Without SDL_mixer, PrBoom compiles its music functions as empty stubs, so you only hear sound effects.

This project therefore ships its own small software synthesizer for Doom's MUS format (prboom-patch/tt_music.c):

  • Parses the MUS lump directly; no MIDI conversion.
  • 14 voices, integer-only math in the audio path (no FPU on this CPU).
  • Timbres chosen per General MIDI instrument family; channel 15 is percussion (kick, toms, snare, hats, cymbals from sine sweeps and noise).
  • Mixed on top of the SFX inside the SDL audio callback, so no second audio device is needed. Music volume follows Doom's in-game music volume.
  • Only MUS lumps are supported (all Doom / Doom II IWADs use MUS). MIDI-format lumps from custom WADs are skipped.
  • It is an approximation, not an OPL/AdLib emulation: it sounds like a chip synth, not like the original DMX music.

How it is wired in (scripts/build-music.sh):

  1. patches/apply-music-patch.py makes I_UpdateSound non-static in i_sound.c and points the SDL audio callback at TT_AudioCallback, which calls the original SFX mixer first and mixes the music on top.
  2. i_sound.c is recompiled with its empty music stubs renamed to TT_stub_* (via -DI_PlaySong=TT_stub_PlaySong, etc.). This is needed because I_InitSound() inside i_sound.c would otherwise keep calling the stubs. The real functions in tt_music.c initialise themselves the first time a song is registered.
  3. i_sound.o and tt_music.o are packed into SDL/libsdldoom.a, and scripts/relink-prboom.sh links the final binary.

If there is no music, check prboom-stderr.log on the device for lines starting with tt_music:.