SDL Now Supports DOS

· coding systems devtools · Source ↗

TLDR

  • SDL3 gains DOS platform support via DJGPP, implementing VESA display, Sound Blaster audio, DMA handling, and VBE double-buffering across a multi-contributor PR.

Key Takeaways

  • Display uses VESA/VBE interfaces with double-buffered page-flipping; banked framebuffer fallback covers VBE 1.2+ modes that lack LFB.
  • Sound Blaster backend auto-detects SB version: SB16 gets 16-bit stereo, pre-SB16 falls back to 8-bit mono at 22050 Hz.
  • Audio mixing moved from IRQ handler to main loop; borrows an SDL 1.2 MacOS Classic trick to defer callbacks locked during interrupt.
  • DJGPP’s __unix__ definition incorrectly triggered SDL_PLATFORM_UNIX, causing GTK link errors; fixed with explicit DOS exclusions in CMake and SDL.c.
  • Joystick axis polling throttled to ~60 Hz to cut BIOS timing loop cost; extended scancodes and Pause key handling also added.

Hacker News Comment Review

  • The self-referential irony that DosBox, used to test and screenshot this PR, is itself built on SDL, landed as the sharpest observation in the thread.
  • Skepticism about real-world DOS use in 2026 coexisted with genuine interest in pushing SDL further down the stack; UEFI emerged as the natural next bare-metal target.

Notable Comments

  • @ronsor: frames UEFI as the logical next port: “all our games can run in a pre-OS environment.”

Original | Discuss on HN