15ab48343a8e7e939488d0ee29ee4caa36275cc4
Top-Octane
A modern, cross-platform SDL2 + OpenGL 3.3 Core C++20 source port of Bullfrog's 1995 vehicular combat racer Hi-Octane, designed to load essential game assets read-only from data/ while fixing DOS/DOSBox CPU-cycle speed bugs, display scaling/pop-in, gameport controls, and sound/General MIDI crashes.
Key Fixes Over the Original DOS Version
- CPU Cycles & Timing: Fixed
60 Hzdeterministic simulation clock with high-refresh render-state interpolation and OS-friendly VSync yielding (eliminates DOSBox hyper-speed and frame hitching). - Graphics: Native OpenGL 3.3 Core renderer with widescreen Hor+ FOV, HiDPI support, extended draw distance, MSAA, perspective-correct 3D terrain & column geometry (
TEXTU0-0..5,SKY0-0..5,BULLFROG OBJECT DATA), plus an authentic Classic Mode (F2) featuring 4:3320×200/640×480quantization againstPALET0-0.DATand optional scanlines. - Controls: Scancode-based remappable keyboard, hot-plugged
SDL_GameControlleranalog steering/triggers with deadzone/curve calibration and rumble haptics, optional mouse steering, and 2-player local split-screen. - Audio & Music: Low-latency SDL2 float32 stereo mixer with 3D spatial panning/attenuation, Bank 3 & Bank 9 WAV SFX extraction from
SOUND.DAT, and native Miles XMIDI (MUSIC.DAT) playback via OPL3 FM (SAMPLE.OPL), SoundFont (BULLFROG.SBK/.sf2), or custom.wavtracks — completely bypassing the DOSMPU401.MDIcrash.
Prerequisites
- C++20 compiler (
g++orclang++) - POSIX
make SDL2development libraries & headers (pkg-configorsdl2-config)- OpenGL 3.3+ drivers / system headers
- Essential game assets in
./data(default lookup; can also be overridden via--data-dirorHIOCTANE_DATA, with./HiOctanesupported as a legacy fallback). OptionalDATA/INTRO.DATis excluded by default so the game boots cleanly to the Title screen.
Building & Running
Linux / macOS
make -j$(nproc) # builds Release ./top-octane by default (or `make release`)
make test # builds & runs all 5 test suites in the active mode
make smoke # runs `./top-octane --smoke-test 30`
./top-octane
Other Make targets:
make debug: builds./top-octanewith-g -O0(automatically cleans stale Release objects).make install/make uninstall: installs/removestop-octanein$(DESTDIR)$(PREFIX)/bin(defaultPREFIX=/usr/local).make clean: removes built objects, libraries, binaries, and.buildmode.
Windows (MSYS2 / MinGW)
make -j$(nproc)
make test
./top-octane.exe
CLI Options
--data-dir <path>: Path to the read-only assets directory (default:./data; also readsHIOCTANE_DATAenv var).--track <1..6>: Jump directly into a race on Track 1–6.--track-viewer <1..6>: Open interactive 3D track inspection camera.--classic: Launch in 4:3 Classic palette visual mode.--fullscreen: Launch in borderless fullscreen.--music-backend <opl3|sf|custom>: Choose OPL3 FM, SoundFont, or Custom WAV music.--skip-intro: Skip theINTRO.DATFLC movie.--smoke-test <frames>: Render<frames>frames and exit cleanly (for automated verification).
Default Controls
- Player 1 (Keyboard):
W/SorUp/Down(Throttle/Brake),A/DorLeft/Right(Steer),Left Shift(Boost),Space(Minigun),E(Missile),Q(Auto-Pilot),C(Camera View),Esc/P(Pause). - Player 2 (Split-Screen):
Arrow Keys(Steer/Throttle/Brake),Right Shift(Boost),Right Ctrl(Minigun),Enter(Missile). - Gamepad: Left Stick / D-Pad (Steer),
RT/A(Throttle),LT/B(Brake),LB/X(Boost),RB(Minigun),Y(Missile),Start(Pause). - Hotkeys:
F2(Toggle Classic Mode),F4(Switch OPL3 / SoundFont Music),F11orAlt+Enter(Toggle Fullscreen).
User configuration, highscores, clone ghosts, and championship saves are stored in your OS user preferences directory (SDL_GetPrefPath). Original files in data/ are never modified.
Languages
C++
99%
Makefile
1%