init commit
This commit is contained in:
commit
15ab48343a
187 files changed
+12644
No files matched your search
@@ -0,0 +1,221 @@
|
||||
.POSIX:
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o
|
||||
|
||||
TARGET = top-octane
|
||||
CXX = c++
|
||||
AR = ar
|
||||
ARFLAGS = rcs
|
||||
RM = rm -f
|
||||
INSTALL = install
|
||||
PREFIX = /usr/local
|
||||
BINDIR = $(PREFIX)/bin
|
||||
DESTDIR =
|
||||
DATA_DIR = ./data
|
||||
|
||||
STDFLAGS = -std=c++20 -Isrc
|
||||
WARNFLAGS = -Wall -Wextra -Wpedantic -Wno-missing-field-initializers
|
||||
RELEASE_FLAGS = -O2 -DNDEBUG
|
||||
DEBUG_FLAGS = -g -O0
|
||||
OPTFLAGS = $(RELEASE_FLAGS)
|
||||
CXXFLAGS = $(STDFLAGS) $(WARNFLAGS) $(OPTFLAGS)
|
||||
LDFLAGS =
|
||||
TEST_DEFS = -DHIOCTANE_DEFAULT_DATA_DIR=\"$(DATA_DIR)\"
|
||||
|
||||
SDL2_CFLAGS = $$(pkg-config --cflags sdl2 2>/dev/null || sdl2-config --cflags)
|
||||
SDL2_LIBS = $$(pkg-config --libs sdl2 2>/dev/null || sdl2-config --libs)
|
||||
GL_CFLAGS = $$(case "$$(uname -s)" in Darwin) echo "-DGL_SILENCE_DEPRECATION";; esac)
|
||||
GL_LIBS = $$(case "$$(uname -s)" in Darwin) echo "-framework OpenGL";; MINGW*|MSYS*|CYGWIN*) echo "-lopengl32";; *) pkg-config --libs gl 2>/dev/null || echo "-lGL";; esac)
|
||||
|
||||
BASE_OBJS = \
|
||||
src/core/vfs.o \
|
||||
src/core/config.o \
|
||||
src/assets/rnc.o \
|
||||
src/assets/palette.o \
|
||||
src/assets/textures.o \
|
||||
src/assets/level.o \
|
||||
src/assets/model.o \
|
||||
src/assets/sprites.o \
|
||||
src/assets/flic.o \
|
||||
src/assets/sound_bank.o \
|
||||
src/assets/music_bank.o
|
||||
|
||||
RENDER_OBJS = \
|
||||
src/render/gl_api.o \
|
||||
src/render/shader.o \
|
||||
src/render/world_geometry.o \
|
||||
src/render/world_renderer.o
|
||||
|
||||
INPUT_OBJS = \
|
||||
src/input/input_manager.o
|
||||
|
||||
SIM_OBJS = \
|
||||
src/sim/physics.o \
|
||||
src/sim/race_sim.o \
|
||||
src/sim/combat.o \
|
||||
src/sim/ai_driver.o \
|
||||
src/game/game_modes.o
|
||||
|
||||
AUDIO_OBJS = \
|
||||
src/audio/opl3_synth.o \
|
||||
src/audio/sf_synth.o \
|
||||
src/audio/xmidi_player.o \
|
||||
src/audio/audio_engine.o
|
||||
|
||||
APP_OBJS = \
|
||||
src/main.o \
|
||||
src/game/game_app.o \
|
||||
src/render/ui_renderer.o
|
||||
|
||||
ALL_OBJS = $(BASE_OBJS) $(RENDER_OBJS) $(INPUT_OBJS) $(SIM_OBJS) $(AUDIO_OBJS) $(APP_OBJS)
|
||||
|
||||
ALL_LIBS = \
|
||||
libtop_octane_base.a \
|
||||
libtop_octane_render.a \
|
||||
libtop_octane_input.a \
|
||||
libtop_octane_sim.a \
|
||||
libtop_octane_audio.a
|
||||
|
||||
TEST_BINS = \
|
||||
top-octane-tests \
|
||||
top-octane-render-tests \
|
||||
top-octane-physics-tests \
|
||||
top-octane-gameplay-tests \
|
||||
top-octane-audio-tests
|
||||
|
||||
CORE_HDRS = \
|
||||
src/core/clock.hpp \
|
||||
src/core/config.hpp \
|
||||
src/core/log.hpp \
|
||||
src/core/math.hpp \
|
||||
src/core/vfs.hpp
|
||||
|
||||
ASSET_HDRS = \
|
||||
src/assets/flic.hpp \
|
||||
src/assets/level.hpp \
|
||||
src/assets/model.hpp \
|
||||
src/assets/music_bank.hpp \
|
||||
src/assets/palette.hpp \
|
||||
src/assets/rnc.hpp \
|
||||
src/assets/sound_bank.hpp \
|
||||
src/assets/sprites.hpp \
|
||||
src/assets/textures.hpp
|
||||
|
||||
RENDER_HDRS = \
|
||||
src/render/gl_api.hpp \
|
||||
src/render/shader.hpp \
|
||||
src/render/ui_renderer.hpp \
|
||||
src/render/world_geometry.hpp \
|
||||
src/render/world_renderer.hpp
|
||||
|
||||
INPUT_HDRS = \
|
||||
src/input/input_manager.hpp
|
||||
|
||||
SIM_HDRS = \
|
||||
src/sim/ai_driver.hpp \
|
||||
src/sim/combat.hpp \
|
||||
src/sim/physics.hpp \
|
||||
src/sim/race_sim.hpp \
|
||||
src/sim/vehicle_defs.hpp \
|
||||
src/game/game_modes.hpp
|
||||
|
||||
AUDIO_HDRS = \
|
||||
src/audio/audio_engine.hpp \
|
||||
src/audio/opl3_synth.hpp \
|
||||
src/audio/sf_synth.hpp \
|
||||
src/audio/xmidi_player.hpp
|
||||
|
||||
GAME_HDRS = \
|
||||
src/game/game_app.hpp \
|
||||
src/game/localization.hpp
|
||||
|
||||
# Default target: Release build (-O2 -DNDEBUG)
|
||||
release:
|
||||
@cur=""; if [ -f .buildmode ]; then cur=`cat .buildmode`; fi; \
|
||||
if [ "$$cur" != "release" ]; then \
|
||||
$(RM) $(ALL_OBJS) $(ALL_LIBS) $(TARGET) $(TEST_BINS); \
|
||||
printf 'release\n' > .buildmode; \
|
||||
fi
|
||||
$(MAKE) OPTFLAGS="$(RELEASE_FLAGS)" $(TARGET)
|
||||
|
||||
all: release
|
||||
|
||||
debug:
|
||||
@cur=""; if [ -f .buildmode ]; then cur=`cat .buildmode`; fi; \
|
||||
if [ "$$cur" != "debug" ]; then \
|
||||
$(RM) $(ALL_OBJS) $(ALL_LIBS) $(TARGET) $(TEST_BINS); \
|
||||
printf 'debug\n' > .buildmode; \
|
||||
fi
|
||||
$(MAKE) OPTFLAGS="$(DEBUG_FLAGS)" $(TARGET)
|
||||
|
||||
test:
|
||||
@cur="release"; if [ -f .buildmode ]; then cur=`cat .buildmode`; fi; \
|
||||
if [ "$$cur" = "debug" ]; then \
|
||||
$(MAKE) OPTFLAGS="$(DEBUG_FLAGS)" run-tests; \
|
||||
else \
|
||||
if [ ! -f .buildmode ]; then printf 'release\n' > .buildmode; fi; \
|
||||
$(MAKE) OPTFLAGS="$(RELEASE_FLAGS)" run-tests; \
|
||||
fi
|
||||
|
||||
run-tests: $(TEST_BINS)
|
||||
./top-octane-tests
|
||||
./top-octane-render-tests
|
||||
./top-octane-physics-tests
|
||||
./top-octane-gameplay-tests
|
||||
./top-octane-audio-tests
|
||||
|
||||
smoke: release
|
||||
./$(TARGET) --smoke-test 30
|
||||
|
||||
install: release
|
||||
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
||||
$(INSTALL) -m 755 $(TARGET) "$(DESTDIR)$(BINDIR)/$(TARGET)"
|
||||
|
||||
uninstall:
|
||||
$(RM) "$(DESTDIR)$(BINDIR)/$(TARGET)"
|
||||
|
||||
clean:
|
||||
$(RM) $(ALL_OBJS) $(ALL_LIBS) $(TARGET) $(TEST_BINS) .buildmode
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) $(SDL2_CFLAGS) $(GL_CFLAGS) -c -o $@ $<
|
||||
|
||||
libtop_octane_base.a: $(BASE_OBJS)
|
||||
$(RM) $@ && $(AR) $(ARFLAGS) $@ $(BASE_OBJS)
|
||||
|
||||
libtop_octane_render.a: $(RENDER_OBJS)
|
||||
$(RM) $@ && $(AR) $(ARFLAGS) $@ $(RENDER_OBJS)
|
||||
|
||||
libtop_octane_input.a: $(INPUT_OBJS)
|
||||
$(RM) $@ && $(AR) $(ARFLAGS) $@ $(INPUT_OBJS)
|
||||
|
||||
libtop_octane_sim.a: $(SIM_OBJS)
|
||||
$(RM) $@ && $(AR) $(ARFLAGS) $@ $(SIM_OBJS)
|
||||
|
||||
libtop_octane_audio.a: $(AUDIO_OBJS)
|
||||
$(RM) $@ && $(AR) $(ARFLAGS) $@ $(AUDIO_OBJS)
|
||||
|
||||
$(TARGET): $(APP_OBJS) $(ALL_LIBS)
|
||||
$(CXX) $(CXXFLAGS) -o $@ $(APP_OBJS) libtop_octane_render.a libtop_octane_sim.a libtop_octane_audio.a libtop_octane_input.a libtop_octane_base.a $(GL_LIBS) $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
top-octane-tests: tests/test_assets.cpp libtop_octane_base.a $(CORE_HDRS) $(ASSET_HDRS)
|
||||
$(CXX) $(CXXFLAGS) $(TEST_DEFS) $(SDL2_CFLAGS) -o $@ tests/test_assets.cpp libtop_octane_base.a $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
top-octane-render-tests: tests/test_render_geom.cpp libtop_octane_render.a libtop_octane_base.a $(CORE_HDRS) $(ASSET_HDRS) $(RENDER_HDRS)
|
||||
$(CXX) $(CXXFLAGS) $(TEST_DEFS) $(SDL2_CFLAGS) $(GL_CFLAGS) -o $@ tests/test_render_geom.cpp libtop_octane_render.a libtop_octane_base.a $(GL_LIBS) $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
top-octane-physics-tests: tests/test_physics.cpp libtop_octane_sim.a libtop_octane_input.a libtop_octane_base.a $(CORE_HDRS) $(ASSET_HDRS) $(INPUT_HDRS) $(SIM_HDRS)
|
||||
$(CXX) $(CXXFLAGS) $(TEST_DEFS) $(SDL2_CFLAGS) -o $@ tests/test_physics.cpp libtop_octane_sim.a libtop_octane_input.a libtop_octane_base.a $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
top-octane-gameplay-tests: tests/test_gameplay.cpp libtop_octane_sim.a libtop_octane_input.a libtop_octane_base.a $(CORE_HDRS) $(ASSET_HDRS) $(INPUT_HDRS) $(SIM_HDRS)
|
||||
$(CXX) $(CXXFLAGS) $(TEST_DEFS) $(SDL2_CFLAGS) -o $@ tests/test_gameplay.cpp libtop_octane_sim.a libtop_octane_input.a libtop_octane_base.a $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
top-octane-audio-tests: tests/test_audio.cpp libtop_octane_audio.a libtop_octane_base.a $(CORE_HDRS) $(ASSET_HDRS) $(AUDIO_HDRS)
|
||||
$(CXX) $(CXXFLAGS) $(TEST_DEFS) $(SDL2_CFLAGS) -o $@ tests/test_audio.cpp libtop_octane_audio.a libtop_octane_base.a $(SDL2_LIBS) $(LDFLAGS)
|
||||
|
||||
$(BASE_OBJS): $(CORE_HDRS) $(ASSET_HDRS)
|
||||
$(RENDER_OBJS): $(CORE_HDRS) $(ASSET_HDRS) $(RENDER_HDRS)
|
||||
$(INPUT_OBJS): $(CORE_HDRS) $(INPUT_HDRS)
|
||||
$(SIM_OBJS): $(CORE_HDRS) $(ASSET_HDRS) $(INPUT_HDRS) $(SIM_HDRS)
|
||||
$(AUDIO_OBJS): $(CORE_HDRS) $(ASSET_HDRS) $(AUDIO_HDRS)
|
||||
$(APP_OBJS): $(CORE_HDRS) $(ASSET_HDRS) $(RENDER_HDRS) $(INPUT_HDRS) $(SIM_HDRS) $(AUDIO_HDRS) $(GAME_HDRS)
|
||||
@@ -0,0 +1,56 @@
|
||||
# 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 Hz` deterministic 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:3 `320×200`/`640×480` quantization against `PALET0-0.DAT` and optional scanlines.
|
||||
- **Controls:** Scancode-based remappable keyboard, hot-plugged `SDL_GameController` analog 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 `.wav` tracks — completely bypassing the DOS `MPU401.MDI` crash.
|
||||
|
||||
## Prerequisites
|
||||
- C++20 compiler (`g++` or `clang++`)
|
||||
- POSIX `make`
|
||||
- `SDL2` development libraries & headers (`pkg-config` or `sdl2-config`)
|
||||
- OpenGL 3.3+ drivers / system headers
|
||||
- Essential game assets in `./data` (default lookup; can also be overridden via `--data-dir` or `HIOCTANE_DATA`, with `./HiOctane` supported as a legacy fallback). Optional `DATA/INTRO.DAT` is excluded by default so the game boots cleanly to the Title screen.
|
||||
|
||||
## Building & Running
|
||||
|
||||
### Linux / macOS
|
||||
```bash
|
||||
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-octane` with `-g -O0` (automatically cleans stale Release objects).
|
||||
- `make install` / `make uninstall`: installs/removes `top-octane` in `$(DESTDIR)$(PREFIX)/bin` (default `PREFIX=/usr/local`).
|
||||
- `make clean`: removes built objects, libraries, binaries, and `.buildmode`.
|
||||
|
||||
### Windows (MSYS2 / MinGW)
|
||||
```bash
|
||||
make -j$(nproc)
|
||||
make test
|
||||
./top-octane.exe
|
||||
```
|
||||
|
||||
## CLI Options
|
||||
- `--data-dir <path>`: Path to the read-only assets directory (default: `./data`; also reads `HIOCTANE_DATA` env 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 the `INTRO.DAT` FLC movie.
|
||||
- `--smoke-test <frames>`: Render `<frames>` frames and exit cleanly (for automated verification).
|
||||
|
||||
## Default Controls
|
||||
- **Player 1 (Keyboard):** `W/S` or `Up/Down` (Throttle/Brake), `A/D` or `Left/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), `F11` or `Alt+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.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
??><>;9;778557257/5204-.4()4"#6778'
|
||||
␍
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
␍␍
|
||||
␍␍␍␍! ! !#!$% %&!&'#)*$*,&,-'./)/0*12+24,34-46.57.68/7:.8907928:6::0=<+94&;/";*<$=>?& !&'")%'&"%%%&('(*(,,'0.)11+13/323344275/54035,28*17).6&-5&*5#)3!'2&1#0 /.,)%␍"
|
||||
␍
|
||||
␍
|
||||
% )"-%/&4*7-8.;0?7(#( )$.$.$"/)%1,(30*53-480/3/(0.#,/)/&/$/"/)"'! !"$!&"!))$*.+-1/-/++,,'*+&$4#3 211!"+ !! ␍!
|
||||
(+%/'4+5-8/>71-"7,)9*%:("<$= >>?;653+87)96#08:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 187 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user