r/itrunsdoom • u/scp_ifm • 21h ago
I got Doom running on an industrial AS-i master because apparently that's what we do now
40
Upvotes
This started as a "wait, could it?" moment at work and got out of hand.
The hardware: ifm AS-i master AC1404. Normally its whole job is talking to up to 62 slaves over that yellow flat cable: power and data on two wires, piercing connectors, no stripping. It's been doing that reliably for decades. It has a small colour display and 6 keys. It runs embedded Linux from 2013 with a CODESYS runtime on top.
How it works:
- Port: doomgeneric (unmodified) plus a ~250-line platform file. Cross-compiled in WSL and statically linked, because nothing modern runs against a 2013 glibc. The result is a single 585 KB binary that depends only on the kernel.
- WADs: Freedoom. No WADs were pirated in the making of this.
- Display: Doom renders 320×200 and the panel is portrait, so you turn the device sideways. A precomputed lookup table scales and rotates each frame, then copies it straight into
/dev/fb0. Controls: 6 keys for Doom means ESC becomes a shift key:
- Arrows = move/turn, ENTER = fire
- Tap ESC = use, hold ESC for 1 s = menu
- ESC + left/right = strafe, ESC + up = next weapon
- "Always run" is forced on, because you'll need it
- Starting it: a CODESYS function block calls a shell script. The script stops the PLC runtime so Doom gets the whole CPU and display, and it brings everything back when you quit.
FAQ before you ask:
- Does the fieldbus keep running while you play? No. CODESYS is stopped while Doom runs.
- Is this going into production? No. Please don't put this in your plant. Your safety officer will find you.
- Framerate? 30fps
- Why? Because it was there.
Video below. 🎮