HeadlinesBriefing favicon HeadlinesBriefing.com

SDL Gains DOS Support via DJGPP Integration

Hacker News •
×

SDL 2.24 now includes experimental DJGPP support, enabling retro gaming on DOS platforms through technical refinements. The update addresses audio stability by moving mixing out of interrupt handlers, implementing double-buffered page-flipping for VBE modes, and adding banked framebuffer access for VESA 1.2+ displays. Key fixes include resolving Sound Blaster compatibility issues through improved DMA handling and introducing a 22050Hz sample rate for period-correct audio playback.

The integration tackles platform-specific challenges like DPMI memory locking, extended scancode support, and PCIe device emulation. Notable changes involve excluding GTK dependencies in DOS builds and adding i386-pc-msdosdjgpp-gcc as a fallback compiler. Audio improvements feature silence detection for stale DMA buffers and polling-based joystick axis handling at 60Hz, reducing BIOS timing loop overhead.

Backported from SDL 1.2's interrupt-driven audio model, the solution uses callback counters instead of hardware interrupts, maintaining compatibility with modern emulators like DosBox-X. The update preserves Quake 1's memory efficiency principles while adding modern stability features like vsync in single-buffered modes. DMA buffer halving now prevents stutter during file loading, and SB version detection enables automatic 8/16-bit audio mode selection.

This milestone preserves DOS gaming heritage while demonstrating SDL's adaptability. By maintaining Quake's minimalist approach alongside modern engineering practices, the project proves retro compatibility isn't mutually exclusive with contemporary toolchain requirements. The implementation currently lacks event hooks but provides foundational support for full DOS platform maturation.