A native port of Crash Team Racing (PS1, 1999), built on top of the CTR-ModSDK decompilation project.
ctr_native/
main.c Entrypoint and native platform boundary
platform/ Native-owned audio, input, memcard, CD, and PSX facade glue
build-msvc.bat Windows build (MSVC x86)
build.bat Windows build (MinGW i686)
build.sh Linux build
android/ Android Gradle project and launcher
CMakePresets.json Shared CLion/command-line CMake configurations
README.md This file
README_ANDROID.md Android build and setup guide
game/ Our copies of all decompiled game source (943 files)
game_unity.h Ordered unity include chain for all game source files
include/ Project headers (structs, globals, declarations, platform facade)
externals/
SDL/ SDL3 source (static build)
The recommended native Windows toolchain is MSVC x86:
- Install Visual Studio 2022 or Visual Studio Build Tools 2022.
- Select the Desktop development with C++ workload and a current Windows SDK.
- Ensure CMake 3.20 or newer is on
PATH(standalone or the Visual Studio C++ CMake tools component). - Run
build-msvc.bat, or select thewindows-msvc-x86CMake preset in CLion.
The existing MinGW i686 build remains supported:
- Install MSYS2.
- In an MSYS2 terminal:
If the update asks you to close the terminal, reopen MSYS2 and run the install command.
pacman -Syu pacman -S --needed git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-make - Add
C:\msys64\mingw32\binto your system PATH - Open a new Command Prompt or PowerShell and run
build.bat.
That's it. SDL3 is compiled from vendored source -- no separate install needed.
sudo apt install gcc-multilib
sudo apt install libx11-dev libxext-dev libgl1-mesa-dev libasound2-dev libudev-dev libdbus-1-dev
See README_ANDROID.md. Android currently builds 32-bit
armeabi-v7a and x86 APKs and requires an OpenGL ES 3 capable device.
build-msvc.bat # Windows, MSVC x86 (recommended)
build.bat # Windows, MinGW i686
chmod +x build.sh
./build.sh # Linux
For Android:
cd android
./gradlew assembleDebug
The shared CMake presets can also be used directly or selected as CLion CMake profiles:
cmake --preset windows-msvc-x86
cmake --build --preset windows-msvc-x86-debug
ctest --preset windows-msvc-x86-debug
First build compiles SDL3 from source. This is cached as a static library in the selected build directory.
Output:
- MSVC:
build-msvc-x86/Release/ctr_native.exe - MinGW:
build/ctr_native.exe - Linux:
build/ctr_native - Android:
android/app/build/outputs/apk/debug/app-debug.apk
rmdir /s /q build # Windows: delete cached libraries
build.bat # Windows: rebuild everything
rmdir /s /q build-msvc-x86
build-msvc.bat # Windows MSVC: rebuild everything
rm -rf build/ # Linux: delete cached libraries
./build.sh # Linux: rebuild everything
Android users select their own raw NTSC-U BIN through the in-app setup screen; the app copies it into app-owned storage. See README_ANDROID.md.
If you downloaded a release build, you only need two things for normal play:
- The game executable:
ctr_native.exeon Windowsctr_nativeon Linux
- Your own NTSC-U retail CTR disc image, named (put in directory called
assets):assets/ctr-u.bin
Example:
CTR-Native/
ctr_native.exe
assets/
ctr-u.bin
Then run ctr_native.exe.
The disc image must be the common single-track raw PSX BIN layout: MODE2/2352 sectors, with the data track starting at byte 0. A cooked 2048-byte .iso does not preserve the XA/STR sector data needed for audio and video playback.
For development builds run from build/, put the same assets/ctr-u.bin next to the source tree:
ctr-native/
build/
ctr_native.exe
assets/
ctr-u.bin
You do not need extracted assets for normal play.
Extracted files are still supported for development, modding, and debugging. If present, they override files from ctr-u.bin.
Extracted-asset override structure:
CTR-Native/
ctr_native.exe
assets/
BIGFILE.BIG
SOUNDS/KART.HWL
TEST.STR
XA/
ENG.XNF
ENG/EXTRA/S00.XA ... S05.XA
ENG/GAME/S00.XA ... S20.XA
MUSIC/S00.XA ... S01.XA
The full extracted asset list is:
BIGFILE.BIGSOUNDS/KART.HWLTEST.STRXA/ENG.XNFXA/ENG/EXTRA/S00.XAthroughS05.XAXA/ENG/GAME/S00.XAthroughS20.XAXA/MUSIC/S00.XAthroughS01.XA
Internal builds can record a small bug report folder. See docs/REPLAYS.md.
main.c (entrypoint)
|
+-- platform/native_* (platform shell, audio, input, memcard, CD, renderer, PSX facade glue)
|
+-- game/game_unity.h
|
+-- game/ (all decompiled game source)
|
+-- include/ (headers: structs, globals, declarations)
CTR_NATIVEis defined for native host/platform-specific code- First-party native code targets portable C17 with compiler extensions disabled
- The default build uses 32-bit mode while remaining PSX address-shaped data and host-pointer contracts are audited. GPU primitive links are bridged through 24-bit native tokens; see
docs/MEMORY_MODEL.md.
- Clean up
game/copies strip byte budget hacks and route platform-specific code throughCTR_NATIVE - Keep reducing 32-bit host-pointer assumptions in PSX-shaped data, and keep pruning inherited compatibility code now owned in
include/andplatform/.
- CTR-ModSDK — the decompilation project this is built on
- PsyCross — original PS1 compatibility code from which parts of CTR Native's owned platform layer and PsyQ facade headers are derived
- SDL3 — cross-platform multimedia
- Simon Butt — initial Android port contribution
- Crash Team Racing is a trademark of Sony Computer Entertainment / Naughty Dog