- C 85.7%
- Shell 13.2%
- Python 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| config | ||
| launcher | ||
| patches | ||
| prboom-patch | ||
| scripts | ||
| sdl-patch | ||
| .gitignore | ||
| banner.png | ||
| README.md | ||
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'sautogen.sh)- An existing OpenTom installation already on the TomTom's internal
storage, including
opentom/lib/(base OpenTom libc etc.) andopentom/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/fb0node 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 viamknod, reading the major:minor from/sys/class/graphics/fb0/dev. -
No VT/console subsystem.
/dev/tty0,/dev/console, etc. exist as device nodes but returnENXIO/ENODEVon 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_VSCREENINFOfailures fall back to reading back whatever mode is already active instead of failing outright.config/prboom.cfgadditionally forcesscreen_width=320/screen_height=240so 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()ini_video.cmaps this with measured extremesX: [92..953],Y: [70..925]. -
i_video.olives insideSDL/libsdldoom.a. Recompilingi_video.calone updates the.oon disk but not the copy already packed into the archive.04-build-prboom.shexplicitly runsar r+ranlibon the archive before the final link. -
libgcc_s.so.1in this toolchain requiresGLIBC_2.4, which the device's glibc 2.3.2 does not provide. Both SDL and PrBoom are linked with-static-libgccto avoid this entirely. -
PrBoom's
configureneeds--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.creferencesEVIOCGPROP, 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.his injected via-includeduring 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 thekey_level/key_menufields per button ini_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):
patches/apply-music-patch.pymakesI_UpdateSoundnon-static ini_sound.cand points the SDL audio callback atTT_AudioCallback, which calls the original SFX mixer first and mixes the music on top.i_sound.cis recompiled with its empty music stubs renamed toTT_stub_*(via-DI_PlaySong=TT_stub_PlaySong, etc.). This is needed becauseI_InitSound()insidei_sound.cwould otherwise keep calling the stubs. The real functions intt_music.cinitialise themselves the first time a song is registered.i_sound.oandtt_music.oare packed intoSDL/libsdldoom.a, andscripts/relink-prboom.shlinks the final binary.
If there is no music, check prboom-stderr.log on the device for lines
starting with tt_music:.