Building the game

Prebuilt Linux and macOS packages

Players download Burnout2-x86_64.AppImage (Linux and Steam Deck) or
Burnout2-macOS-AppleSilicon.dmg / Burnout2-macOS-Intel.dmg. They contain the
prebuilt game, the bundled SDL3, DXVK Native or DXMT libraries, the non-system
libraries the game links (libpng and libjpeg on Linux; Homebrew's OpenSSL,
libpng, libjpeg-turbo and, on Apple Silicon, MPFR/GMP on macOS), resources and
license notices, with no game data. Nothing is compiled or downloaded on the
player's computer.

Packaged games keep settings, saves, mods, logs and captures outside the
read-only package: $XDG_DATA_HOME/burnout2-recompilation (normally
~/.local/share/burnout2-recompilation) when b2 runs from an AppImage mount, and
~/Library/Application Support/Burnout 2 Recompilation when b2 runs from
Contents/MacOS of an .app. Source builds and Windows keep using the folder
beside the executable. On first launch, selecting the disc image in Game files
extracts and verifies data/local/default.xbe from it, sets the executable
location and generates the disabled Test Mod. The same setup runs without a
window, for validation:

  b2 --prepare-game-files DISC.iso

It also records the xbe/disc locations in data/local/settings.cfg and prints
two JSON reports. Through an AppImage, pass --appimage-extract-and-run first
when FUSE is unavailable.

The AppImage requires glibc 2.38 and libstdc++ from GCC 13 or newer, as built
on Ubuntu 24.04. It uses the pinned static type2 AppImage runtime (20251108),
so players need no libfuse2. The macOS app is ad-hoc signed, not notarized;
its LSMinimumSystemVersion is the newest minimum among the bundled binaries
(Homebrew bottles built on macOS 15 require macOS 15).

Packaging, after Build.sh built the game on that system:

  bash cmake/package-linux.sh [BUILD_DIRECTORY] [OUTPUT_DIRECTORY]   (Ubuntu 24.04, squashfs-tools)
  bash cmake/package-macos.sh [BUILD_DIRECTORY] [OUTPUT_DIRECTORY]   (per Mac architecture)

Both write a .sha256 file beside the package and list bundled libraries and
their sources in licenses/bundled-libraries.txt inside it. The Native Linux
and macOS builds workflow builds, packages and checks all three on each
v* tag (or manual run) using the encrypted CI game inputs, and uploads the
packages as workflow artifacts for the release.

Linux/macOS source builds

Extract Installation.zip into a permanent folder. On Linux, open Install.desktop
(Allow Launching/Run as Program if your desktop asks), or run bash Install.sh.
On macOS, double-click Install.command. Setup asks before installing tools,
opens a native disc picker, uses Build.sh to verify/extract and compile the game,
and adds an application shortcut. Build progress stays visible in the terminal;
Control-C cancels it. Build output is saved in build/setup/install-PLATFORM.log.
The source folder stays the installation location, as with Windows setup.

Automatic Linux package setup supports Ubuntu 24.04+/Debian 13+ through apt,
Fedora through dnf and Arch through pacman. It installs only missing packages,
including FFmpeg and the disc picker. When a launcher starts setup without a
terminal, it asks for the password through the desktop's polkit dialog, or a
zenity/kdialog prompt for sudo when pkexec is unavailable. An older system
CMake is supplemented by the hash-verified official CMake 4.4.4 binary under
build/deps/cmake-linux.
It does not change the system's default compiler or CMake installation.
Other distributions can use the manual build steps below.

Mac setup requires Xcode 16.3+ and its first-launch setup to be complete.
Xcode 16.3 requires macOS 15.2+; newer Xcode versions may require newer macOS.
The compiled game still targets macOS 14+. Setup bootstraps Homebrew from a
hash-verified official installer, installs native dependencies and downloads
Apple's Metal toolchain if needed. Run it natively, without Rosetta.
Application shortcuts are created in the Linux application menu or in
~/Applications/Burnout 2 Recompilation.app on macOS; they use Play.sh and keep
the game with its original native libraries and saved data in the build folder.
Mac setup and launchers select the native Homebrew prefix for Intel or Apple
Silicon; launching from Finder also finds FFmpeg for custom music imports.

Rerun setup in the same folder to update, preserving saves, settings and music.
bash Install.sh --shortcuts-only recreates a deleted application shortcut.
After moving the installation folder, rerun full setup to rebuild and refresh
the saved game paths and native library locations.
bash Install.sh --dependencies-only installs just the build prerequisites.
CI=true disables dialogs; an XISO argument supports unattended full setup.
These options do not start the game. CI uses the same dependency setup on both
Mac architectures and checks the generated application's metadata and launcher.

Steam Deck / SteamOS

In Desktop Mode, extract Installation.zip to a permanent folder in your home
directory or on a Linux-formatted microSD card, then open Install.desktop.
SteamOS automatically uses the Steam Deck setup. To select it on another Linux
system, run bash Install.sh --steamdeck '/path/to/Burnout 2.xiso.iso'.

Setup installs the Freedesktop 25.08 runtime, SDK and LLVM 20 extension through
Flatpak --user. It never runs sudo, pacman or steamos-readonly. Build tools,
headers and libraries stay in your user account; SteamOS remains read-only.
The first setup downloads several GB and builds with two compiler jobs to limit
memory use. Keep enough free storage for the SDK, source build and your disc.
The original executable and audio effects are verified by the same native builder.
No Python, Wine or Proton is used. An AppImage is not required: the shared
Flatpak runtime supplies the game libraries and Mesa/Vulkan drivers.

Launch Burnout 2 from the application menu, or run bash Play.sh --steamdeck.
For Gaming Mode, in Desktop Mode choose Steam > Games > Add a Non-Steam Game,
then select Burnout 2: Point of Impact from the applications list. Leave the
compatibility-tool override disabled. The existing gamepad controls and settings
navigation work through SDL3 and Steam Input. First-install defaults select
fullscreen, 1x resolution, widescreen and the display's refresh rate.

The same --steamdeck runtime works on other Linux handhelds. Its launcher keeps
Steam's selected X11 display and shares the host network namespace so Gaming Mode
can also connect through abstract X11 sockets, including on Anatase. The earlier
X11 socket permission alone did not cover that connection. After updating the
source files, Play.sh uses the corrected launcher without rebuilding the game.
User confirmation (2026-10-30): Gaming Mode startup works on Xbox Ally X with
Anatase Linux: https://github.com/timftw21/burnout2-recompilation/issues/23#issuecomment-6534229563

The native game, settings, saves and music stay in build/steamdeck/Release,
separate from ordinary Linux builds. Rerunning setup preserves them. Play.sh
detects this installation and launches it inside the runtime; launch through
that script instead of starting b2 outside its runtime. Keep the source folder
and disc in place. Move a folder only after closing the game, then rerun setup.
Install.sh --steamdeck --dependencies-only prepares just the user build tools;
--shortcuts-only recreates the application shortcut. Runtime updates use
flatpak update --user. Hardware gameplay, audible balance and performance still
require validation on a physical Steam Deck; offline checks are not an FPS claim.

Local validation (2026-10-26): the full native game built with the user-installed
25.08 SDK and LLVM 20 under WSL2. Running through the separate playback runtime
passed 52 CPU groups, 77 audio cases, 54 spatial cases and 155 audio bindings,
67 effects checks, 57 input cases, 2061 storage cases and the hidden settings
window. Rendering used llvmpipe with zero runtime HLSL compilations. These checks
booted no game and opened no playback device.
Repeated setup preserved settings, storage and unchanged extracted-file
timestamps. The application shortcut and automatic Play.sh launcher also passed.

Linux x86-64

Use a glibc-based distribution, Clang 19 or newer, LLD, Ninja, Git, CMake 4.2
or newer and a Vulkan 1.4 driver compatible with DXVK 3.1.1 (RADV 25.0+,
Nvidia 575.51.02+, or ANV/NVK 25.1+). On Ubuntu 24.04
the native dependencies are:

sudo apt install build-essential clang-19 lld-19 ninja-build git curl pkg-config patch libssl-dev libfontconfig-dev libpng-dev libjpeg-dev libasound2-dev libpulse-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libxtst-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libegl1-mesa-dev libgl-dev libdecor-0-dev libudev-dev libvulkan-dev glslang-tools spirv-headers flex bison libjson-perl

Install CMake 4.2+ separately if the distribution provides an older version.
Ensure clang, clang++ and ld.lld select the installed LLVM toolchain on PATH.
Run this from the extracted source directory:

bash Build.sh '/path/to/Burnout 2 - Point of Impact (USA).xiso.iso'

The builder fetches pinned SDL3 and DXVK Native, builds vkd3d-shader 2.1 with
the included shader bitcast fix, verifies the original executable, and compiles
the native game. Unchanged builds reuse the local compiler.
DXVK Native 3.1.1 is built with upstream swapchain resize fix 3dbf33cb, which
corrects blurred Wayland presentation. The cached Muon 0.7.0 build tool is
bootstrapped from C; the display-name table generator uses Perl. Python and
Wine are not used. FFmpeg is optional and needed only to import custom music.
Launch build/linux/Release/b2. The settings window uses native SDL file dialogs;
install an XDG desktop portal on Wayland if the desktop does not provide one.
Settings use the desktop sans-serif fonts through Fontconfig, with a scalable
built-in font when no suitable system font is available.
Settings, saves, logs and imported music live beside the Linux executable.
Rebuilding refreshes game paths and preserves the other settings and saves.
Keep the source/build directories together; rebuild after moving them.

After dependency setup through Build.sh, developer builds use cmake --preset linux, then
cmake --build --preset linux-release (or linux-debug). Set B2_XBE and B2_EFFECTS
to verified extracted files to include the game. Without B2_XBE only b2-tool is
built. The native diagnostics have the same options as on Windows; use b2 and
b2-tool without the .exe suffix. CPU and effects reports are generated under
build/linux/generated/Release. No gameplay benchmark is implied by a native build.

Linux currently reports WARP, the D3D11
debug layer and hardware memory watches as unsupported. Native resolution,
higher internal resolutions and the shared D3D11 antialiasing paths use Vulkan.
For software offscreen rendering, select a software Vulkan ICD through its
standard loader environment; --warp remains Windows-only.

Linux validation (2026-10-21)

Ubuntu 24.04 under WSL2, Clang 19 and CMake 4.3.3 passed the native CPU, audio,
effects, input, storage and custom-music diagnostics. All 248 rendering cases
passed on llvmpipe. Hidden SDL3 window checks passed settings persistence,
resizing, widescreen and ultrawide presentation, with zero HLSL compilations.
Saves and music passed on ext4, including case-insensitive Xbox filename lookup.
Repeat setup preserved settings, saves and unchanged extracted-file timestamps;
an unchanged rebuild had no work to do. Crash reports retained guest context
from the owning thread. An authorized 29.978-second Airport Terminal 3 gameplay
benchmark also completed at 360 Hz selected, 1x, widescreen, interpolation and
V-sync off. Its 7.804 FPS used llvmpipe CPU rendering under WSL2; native Linux
GPU performance and audible playback remain unverified.

macOS Intel and Apple Silicon (bring-up)

Targets macOS 14+ and a Metal 3 GPU. Build on macOS 15.2+ with Xcode 16.3+ and its Metal/C++23
toolchain, CMake 4.2+, Ninja, Git and the libraries below.
Use the native shell on each architecture. Intel and Apple Silicon are separate
native builds; Rosetta and Wine are not used. Older Intel GPUs that cannot
provide DXMT's D3D11 feature level are unsupported.

With Xcode selected, install the native build dependencies using Homebrew:

brew install cmake ninja make pkgconf openssl@3 libpng jpeg-turbo spirv-headers vulkan-headers vulkan-loader bison flex perl
if [ "$(uname -m)" = arm64 ]; then brew install mpfr gmp; fi
export PATH="$(brew --prefix perl)/bin:$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$PATH"
cpan -T JSON
bash Build.sh '/path/to/Burnout 2 - Point of Impact (USA).xiso.iso'

Start build/macos/Release/b2. Keep the source/build folder: the native dynamic
libraries, extracted inputs, settings and saves remain there. Build.sh selects
Xcode's compiler and Homebrew's library paths, downloads the hash-verified official LLVM
15.0.7 library package required by DXMT, and builds the pinned dependencies
directly with CMake and GNU Make 4.3+ from Homebrew. It uses the release archive's
generated configuration files without requiring Autotools. It never calls Python
or Meson. The native HLSL
compiler is used only during the build. Vulkan headers and the loader are build
dependencies of that compiler's upstream configuration. The game runs D3D11 through native DXMT
and Metal, with an SDL-owned Metal view. FFmpeg is optional for music imports.

Intel retains native x87/SSE instruction helpers in Mach-O assembly. Apple
Silicon compiles each game instruction directly to native C++ functions, with
SoftFloat for the Xbox's 80-bit and IEEE arithmetic and MPFR for transcendental
functions. No guest instruction decoder, interpreter or JIT is used at runtime.
Unimplemented ARM instructions are reported during lowering. The existing
unresolved indirect game targets remain separate from host service bindings.
Intel hardware instruction-reference checks are explicitly unavailable on ARM;
the remaining diagnostics still exercise original game routines and services.
Unaligned atomic memory operations are explicitly unsupported on ARM.

No local Mac was available during this bring-up. CI builds the full native
game and runs offline diagnostics on both architectures. The Apple Silicon
runner also exercises offscreen Metal rendering. The Intel runner's virtual
GPU lacks the Apple7/Mac2 family support required by DXMT. Its CPU, audio,
effects and file checks still run; GPU checks explicitly report unavailable.
./build/macos/Release/b2-tool inspect-metal reports the device and GPU families.
Compatible hardware automatically enables the offscreen draw and the storage
suite's resident-texture cases. Audible playback, gameplay and performance
still require validation on both Mac architectures. Windows-only D3D12
WARP, D3D11 debug layers and hardware
memory watches remain unavailable. x87 transcendental results need comparison
on game scenes; MPFR does not reproduce the Pentium's internal approximations.

The Native macOS build workflow compiles b2 and b2-tool on both
macos-15-intel and macos-15 (Apple Silicon), without publishing game files.
It runs when build inputs change and can also be started manually.
Both full Release jobs passed on 2026-10-21:
https://github.com/timftw21/burnout2-recompilation/actions/runs/39714403670
These checks do not boot the game or establish gameplay performance.
The macos-game Actions environment holds compressed private inputs in encrypted
secrets B2_CI_INPUTS_00 through B2_CI_INPUTS_58. No game inputs, generated source
or executables are committed, cached or uploaded as artifacts. Only trusted
pushes and manual runs receive these secrets. To replace them from verified
local inputs, with Node.js and an authenticated GitHub CLI:

node cmake/ci-game-inputs.mjs pack data/local build/ci-game-inputs.env
gh secret set --env macos-game --env-file build/ci-game-inputs.env

Delete the ignored .env file after uploading it. The workflow stages bounded
groups of secrets to avoid Actions' template limit, restores the inputs, verifies
the supported executable and deletes private inputs and build output afterward.
bash Build.sh --game-inputs builds from the same extracted files locally without
needing the disc image or changing settings and saves.
Build.sh --tools-only provides a source-only build locally and does not change
game settings or saves. On ARM,
this also compiles the portable arithmetic core without needing a game image.

Windows x64 setup

Players download Burnout2-Setup.exe from the release page. It needs no build
tools, downloads or administrator rights. Setup verifies default.xbe on the
selected XISO against knowledge/supported_target.json before changing anything,
then installs the prebuilt b2.exe, b2-tool.exe, application-local Visual C++
runtime libraries and license notices from its embedded, SHA-256-listed cabinet.
It extracts and verifies data/local/default.xbe, optionally copies the image to
data/local/game.iso, writes the xbe/disc locations into data/local/settings.cfg
while keeping other preferences, generates the disabled Test Mod from the disc
with the installed b2-tool, and adds Start-menu, optional desktop and Installed
apps entries for the current user. The default folder is
%LOCALAPPDATA%\Programs\Burnout 2 Recompilation. Setup uses the static C++
runtime and Windows' cabinet services. Work is staged in the selected folder
and committed only after verification; a running game blocks replacement.

A new installation folder must be empty or contain only data and mods copied
from an earlier build. Reinstalling into the recorded folder updates the game
and keeps saves, settings, achievements, imported music and mods. Uninstall
removes only recorded program files, the extracted executable and a copied
image; saves, settings, mods and the original image are kept.

Validation without the desktop:

  Burnout2-Setup.exe --silent-install DISC.iso FOLDER [--reference-disc] [--no-register]
  Burnout2-Setup.exe --preview OUTPUT.bmp [--dpi 96..384]
  Burnout2-Setup.exe --preview-progress OUTPUT.bmp
  FOLDER\Uninstall.exe --uninstall FOLDER --silent

--silent-install prints a JSON result to standard output and errors to standard
error. --reference-disc keeps the image in place; --no-register skips shortcuts
and the Installed apps entry. Previews save a BMP and a JSON description.

Release packaging (developers)

After building the game once from a source checkout, run:

  powershell -NoProfile -ExecutionPolicy Bypass -File cmake\package.ps1

It rebuilds b2 and b2-tool when needed, stages CMake's Runtime component,
compresses it with makecab, builds b2-setup with that payload and writes
Burnout2-Setup.exe, its .sha256 file and the Linux/macOS Installation.zip to
build/release. -SkipBuild packages the existing binaries. The Runtime component
is an explicit whitelist; media, saves, settings, generated sources and debug
files are never included. Push the v* tag, then download the Linux and macOS
packages from that tag's Native Linux and macOS builds run:

  gh run download RUN_ID --dir build/release

Publish Burnout2-Setup.exe, Burnout2-x86_64.AppImage,
Burnout2-macOS-AppleSilicon.dmg, Burnout2-macOS-Intel.dmg, their .sha256 files
and Installation.zip (Linux/macOS sources) as the release assets.

Windows x64 source build

Clone the repository, double-click Install.cmd in the source folder, select the
supported US Xbox XISO disc image and wait for setup. Click Launch game when it
finishes. Build.cmd remains an alias for the same builder.

The source builder reuses compatible installed tools and automatically downloads missing
CMake, MinGit, Ninja and LLVM into build/deps/windows. Downloads come from the
official projects, use fixed versions and SHA-256 checks, and remain cached for
retries. The tool directories are added only to setup's process PATH.
Microsoft C++ Build Tools 2026 and Windows SDK 10.0.26100 are installed when
missing, through Microsoft's signed installer and the normal Windows permission
prompt. An existing Visual Studio 2026 installation is supplemented if needed;
the full editor is not required. If Microsoft requests a restart, restart Windows
and rerun Install.cmd. First setup requires internet access and several GB of
free storage. There is no prerequisite package manager or manual PATH setup.

The builder uses the native b2-tool to extract and verify the game executable
and read the effects image. It prepares data/local, configures and builds Release,
and updates game-file locations beside b2.exe after a successful build.
Other settings and saves are preserved. Use an Xbox XISO image;
full-disc dumps require conversion first. One build runs per source folder.
The installer shows each installation stage and a progress bar driven by
completed build tasks. Downloads display their size and progress. Configuration
and linking wait for the tool's actual completion; the bar never advances on a
timer. Open build log shows details from build/setup/build.log. Closing the
window cancels the build and stops only workers started by the builder. During
Microsoft tool installation, use Microsoft's own Cancel button; setup waits for
that installer to finish its work or rollback without killing system services.

The first build downloads pinned dependencies and compiles the game ahead of
time. Later builds reuse unchanged outputs. Keep the source and build folders
to avoid starting over. Private game files, logs and output remain ignored.

Installation validation (2026-10-10)

Issue #13 was reproduced in a fresh Visual Studio build: MASM cannot create the
nested generated object directory. Generated assembly now uses a unique object
name directly in the existing intermediate directory. Relative assembly inputs
also avoid MASM's legacy encoding of non-English folder names. SDL's precompiled
header uses its include search path, avoiding an ANSI-encoded absolute filename.
A full Installation.zip setup passed through Windows PowerShell 5.1 with spaces,
Japanese and accented characters in the source and disc paths, using CMake 4.3.3,
MSVC 19.51 and Windows SDK 10.0.26100.0. All 52 installed CPU checks passed.
Repeat setup passed with downloads blocked, refreshed disc locations and preserved
other settings and saves. Invalid images preserved existing files. Separate checks
covered old CMake versions on PATH, duplicate builds, moved/valid build caches,
cancellation logs and worker cleanup, and failed/absolute-path archive creation.

Build throughput validation (2026-10-11)

On a Ryzen 5 5600X with 32 GiB RAM, generated game C++ compilation fell from
7m18s to 1m58s and a cold optimized link from 9m44s to 4m00s. A small source edit
compiled and linked in 17s. These measure build time, not game frame rate.
The LLVM/Ninja installation passed fresh and repeated Windows PowerShell 5.1
setup with Japanese and accented source/disc paths. Cached setup worked without
downloads, preserved settings and saves, and reused the executable. All 52 CPU
checks passed from the installed game with an absolute non-English input path.
The game declares UTF-8 startup encoding so those command-line paths stay intact.
See research/build-time.txt for measurements and native validation.

Asset mods

Installing texture packs

Open Mods in settings and click Install texture pack.... Select the downloaded
pack folder containing mod.cfg. If the download is a ZIP, extract it first.
The installer checks the images, copies the pack into the mods folder beside the
game, and enables it automatically. Start or restart the game to use it.
There is no need to edit settings or copy files into the disc image. Installing
an updated copy with the same pack id replaces the installed version after its
images pass checks; a failed update preserves the previous version. Installation
runs in the background, including while playing; the current session keeps its
already loaded images until restart.

Packs appear alongside game file mods with the same Enabled checkboxes and
up/down priority arrows. The lower enabled pack wins when images overlap.
Disable a pack and restart to restore the original textures. Check mods validates
enabled images and their memory use and lists both image and disc-file conflicts.
It is available before starting the game. Pack textures take priority over Clean
HUD. Settings and enabled order save automatically. Open folder also allows
manual installation/removal; Refresh updates the list after manual changes.

Texture packs must be made for this recomp and the supported US game. Packs for
other games or emulators need conversion. Initial image support is PNG, including
transparency and higher resolutions, up to 4096x4096 and 64 MiB per PNG. At most
2048 winning images and 512 MiB of prepared pixels, including smaller mip levels,
can be enabled at once. Each pack's PNG files also have a 512 MiB storage limit.
All winning images are prepared and uploaded once before
play. The renderer reuses them without pack file reads, image decoding or new
replacement uploads during play. Unmatched textures retain their original pixels.
Rendered surfaces, cubemaps and volume textures are not replaced by PNG packs.
DDS, archive installation without extraction and hot reload are unsupported.
Packs may bundle a startup.lua script using the manifest fields below; the
installer copies and checks it before enabling the pack.

Creating a texture pack

Export an original Xbox texture dictionary into an editable pack:

& .\build\windows\Release\b2-tool.exe extract 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' Frontend/global.dic data/local/global.dic
& .\build\windows\Release\b2-tool.exe export-texture-pack data/local/global.dic build/checks/my-texture-pack 'My texture pack'

Use a fresh output directory with an existing parent. This creates mod.cfg,
textures/*.png and index.json, which maps original texture names to image ids.
Edit or upscale the PNGs while keeping their filenames. Delete unchanged PNGs
to keep the pack small and allow other packs to replace those textures. Exported
images contain your private game assets; they are not included in releases.
Pack authors are responsible for permissions for any images they distribute.

To start with an empty template instead:

& .\build\windows\Release\b2-tool.exe create-texture-pack build/checks/my-texture-pack 'My texture pack'

A texture pack's mod.cfg has the usual name/description/version/author fields,
plus type=texture-pack and id=my-texture-pack. format=1 and the supported target
are required, as for file mods below. id uses the same lowercase folder-id rules;
it stays the same across updates. The installer accepts any downloaded folder
name and uses the manifest id for the installed folder. Manual installs must
name their folder after that id. Keep PNGs directly in textures, with their
exported 40-character ids; names are matched without ASCII case sensitivity.
Only mod.cfg, replacement images and any declared startup.lua are installed; author notes/index.json stay
with the downloaded copy.

Ids hash a versioned original layout and its complete pixel/mip payload, before
Clean HUD or pack replacement. Opt-in F8 texture records also include texture_id,
allowing authors to identify textures in a captured scene. Identical original
content/layout shares a replacement regardless of where the game loads it.
Game file mods run first; an image pack must match the bytes supplied by those
mods if they change the same texture. The native exporter and runtime use the
same id function. No executable offsets or original-file patches are needed.

Install a prepared pack from the command line:

& .\build\windows\Release\b2-tool.exe install-texture-pack build/checks/my-texture-pack build/windows/Release/mods

Command-line installation validates and copies the pack; enable it in settings.
The focused offline diagnostic exercises visible higher-resolution replacements,
transparency, filtering, original fallback, shared GPU resources, restart release,
Unicode download paths, successful/failed updates and malformed-image rejection:

& .\build\windows\Release\b2-tool.exe check-texture-packs build/checks/texture-packs --warp

Use a fresh directory. It saves PNGs and texture-packs-check.json without booting
the game. Component timings do not establish gameplay FPS.

Lua scripts and gameplay events

Mods load a sandboxed Lua script once when a game session starts. Scripts can
register handlers for the supported gameplay events below. Only those mods keep
a Lua state during play; original Xbox code still runs ahead of time.
Scripts do not edit the disc, saves, executable or persistent user preferences.
Enable script mods in Mods, in the same order as file mods and texture packs.
Changes to a script apply on the next start/restart. Check mods validates startup
code and event registration without starting the game or applying proposed
settings. Gameplay handlers run only when their events occur.

Create an editable script-only mod:

& .\build\windows\Release\b2-tool.exe create-script-mod build/windows/Release/mods/my-script 'My script'

This creates mod.cfg and startup.lua. The manifest has format=1, the supported
target and the usual name/description/version/author fields, plus:

type=script
script=startup.lua
script_api=1

File mods and texture packs can also add script=startup.lua and script_api=1
while keeping their existing type and content folders. startup.lua lives next
to mod.cfg; other entry filenames and API versions are currently unsupported.

The initial API is:

b2.api_version                 -- 1
b2.target                      -- supported target id
b2.camera_fov_unit            -- "percent"
b2.get_camera_fov()            -- current percentage, 50-150; 100 means Original
b2.set_camera_fov(125)         -- 125% of the original angle; 100 for Original
b2.log("My script loaded")     -- structured log and Diagnostics message
b2.show_message("Welcome!")    -- five-second on-screen message after first frame
b2.on("race_finish", function(event)
    b2.show_message("Finished in position " .. event.position .. ".")
end)

Register one function per event during startup. Unknown events, duplicate
registrations and registration from inside a handler are rejected. Local Lua
variables and handler closures persist between events, separately for each mod.
There is no per-frame/update callback, hot reload or arbitrary game-memory API.

Supported events and their payload fields (event.name is always included):

race_finish       player (1 or 2), position (1 means first), mode (original id)
crash_result      zone (1-30), medal (0=none, 1=bronze, 2=silver, 3=gold)
starting_boost    player (1 or 2)
burnout           player (1 or 2), chain (current completed Burnout count)
time_attack_lap   track (original id), seconds (completed lap time)

Race finishes cover the verified race modes 1, 2, 5, 6, 10 and 11; Time Attack
has its own lap event. Demo playback is excluded. Player events include human
drivers only and retain split-screen player identity. Events work independently
of whether achievements are enabled or already unlocked. They observe results
and do not replace or cancel the original game logic.

Native observations use the race-finished flag transition at 0x84260 and the
verified achievement sites at 0x1275D, 0x60AC0, 0x797B9 and 0x188A0 in the
supported executable. The finish transition reports once per race, including
when the original racer storage is reused. Observers only queue copied
scalar values. Lua runs at a completed frame boundary, after native game work;
source files are never read or compiled in the event hooks.

Scripts can use Lua arithmetic, functions, loops and tables, math, and the base
functions assert, error, ipairs, next, pairs, select, tonumber, tostring and type.
Each mod gets its own environment. File/OS/network APIs, package loading,
debugging, string-library helpers, coroutines, protected calls and dynamic code
loading are not exposed. Only Lua text source is accepted, never binary chunks.

Each source is limited to 64 KiB and each Lua heap to 4 MiB, with 64 MiB shared
across all live mod states. Startup work has a
100000-instruction budget and a 100 ms timeout checked at instruction hooks and
completion. Each gameplay callback has 10000 instructions and a 1 ms limit,
checked at instruction hooks and completion. Dispatch checks a 2 ms frame budget
and allows up to eight calls, deferring remaining handlers in order. Native events use a
64-entry queue; overflow drops new events and reports it in Diagnostics.
Each call can produce 16 printable UTF-8 messages of up to 256
bytes, with 128 total startup messages and 128 pending on-screen notices. On-screen messages queue;
ordinary log messages appear in Diagnostics and the structured startup report.
Startup failures stop the session with the mod id and error, applying no partial
startup output. A gameplay failure discards that callback's settings/messages
and disables only that mod's scripts until restart; other mods keep running.
The error appears in Diagnostics and a brief on-screen notice.

The last enabled script setting the same option wins. Check mods and startup
JSON report the conflicting providers. Scripted FOV is visible in Graphics for
that session. Changing the camera control overrides it immediately; a later
handler can set it again. Restarting resets Lua state and reruns scripts. Saved
user preferences stay separate from script settings. All FOV APIs now use
percentages; scripts written for the earlier degree prototype must be updated.

Test Mod now includes startup.lua, which calls b2.show_message to display
"Test Mod scripting is working." It also registers race_finish and shows
"Test Mod: finished in position N." after a race. Its recolored logos remain
unchanged. Setup adds the script or upgrades the previous unedited startup
example, preserving custom scripts and enabled selections. After updating a
developer build, install/update it with:

& .\build\windows\Release\b2-tool.exe install-modding-test 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/windows/Release/mods

Inspect real enabled scripts or run the focused sandbox diagnostic without
booting the game (use a fresh diagnostic output directory):

& .\build\windows\Release\b2-tool.exe inspect-scripts 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/windows/Release/mods modding-test
& .\build\windows\Release\b2-tool.exe check-scripting build/checks/scripting

Lua 5.4.9 is pinned and built as a small static library; no separate Lua program
or Python is required. Its license is included in THIRD_PARTY_NOTICES.txt.

Game file mods

Mods replace files from the original disc without changing the disc or saves.
Open Mods in settings, then Open folder. Each mod has its own folder beside
the game executable, under mods. Refresh after installing or editing a mod.
Use the Enabled checkboxes to choose mods. Expand a mod's name for its details.
Short descriptions below the names explain what each mod changes.
Enabled mods appear first; when several are enabled, use the up/down arrows to
set their order. The lower enabled mod is used when files overlap. Check mods reports
conflicts and checks file paths against your verified US disc. Changes apply on
game start/restart. No mods are enabled by default. Missing or invalid enabled
mods stop startup with an explanation; disable or repair them to continue.

Fresh disc-based setup on Windows, Linux, macOS and Steam Deck also installs
Test Mod, disabled by default. It recolors the Burnout 2 logos with magenta
and cyan checks. Enable it in Mods and start/restart the game to try it. Setup
generates it from your verified original disc; no original game assets are
included in Installation.zip or Burnout2-Setup.exe. Repeated setup preserves the installed mod and
your enabled-mod selections. Older unmodified copies named Modding test are
renamed to Test Mod during setup; their folder id remains modding-test.
Developer builds using --game-inputs have no disc
and skip this optional mod. To install it manually beside a completed build:

& .\build\windows\Release\b2-tool.exe install-modding-test 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/windows/Release/mods

Create a mod after opening the mods folder (or creating it manually):

& .\build\windows\Release\b2-tool.exe create-mod build/windows/Release/mods/my-mod 'My mod'

This creates mod.cfg and an empty files folder. mod.cfg uses these fields:

format=1
target=burnout-2-poi-usa-v3-b5207c40
name=My mod
description=Briefly explain what this mod changes.
version=1.0
author=Your name

format and target are required; name, description, version and author are optional.
Descriptions are one line of up to 256 UTF-8 bytes; the interface wraps them to
fit. Older mods without a description still load. Each key may appear once.
Lines beginning with # are comments. Keep folder ids to 1-64
lowercase letters, digits, underscores or hyphens.

The files folder mirrors paths inside the disc. For example, a replacement for
trackpss/forward/fwyl.pss goes in mods/my-mod/files/trackpss/forward/fwyl.pss.
Use b2-tool list ISO [DIRECTORY] to find original paths and b2-tool extract ISO
DISC_PATH OUTPUT to copy individual assets for editing. Existing inspect-textures
and render-dictionary commands can inspect original Xbox texture dictionaries.
Game file mods must retain formats the game understands; use a texture pack for
loose PNGs. Arbitrary audio files and scripts are not converted by the file mod loader. Custom music uses the
separate Audio settings import. Assets packaged together must be replaced as a
complete file. Validation checks the mount, not the behavior of edited assets.

Only existing disc files can be replaced. Matching ignores ASCII case and treats
both slash styles alike. The index is prepared once per session; reads use the
same native synchronous/asynchronous file services as the original disc. File
sizes, partial reads, directory listings and extended scenery use replacements.
Files stay read-only. Changes to a mod on disk require a restart. Saves, settings
and the original executable remain separate. Mod discovery is bounded to 128
folders, 16384 asset entries, 16 directory levels and Xbox-compatible names/sizes; links,
junctions, ambiguous paths and duplicate filenames ignoring case are rejected.

Replacing .xbe executables or data/b2distfx.bin requires rebuilding the native
game and is rejected by this loader. Unlisted gameplay events, native plugin DLLs,
executable patches, new disc files and hot reload are unsupported. The original
verified executable and compiled CPU/shader/sound programs stay in use. Mods take
priority over the built-in imported-track file mounts; replacements for those
files must also be compatible with that imported track.

Inspect an ordered set of mods without booting the game:

& .\build\windows\Release\b2-tool.exe inspect-mods 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/windows/Release/mods my-mod another-mod

The JSON report lists enabled ids, the winning provider and size of each file,
and conflicts. Failures return a nonzero exit code. Session logs record the same
mount report, and opt-in frame captures include mods.json when mods are active.
Enabled ids save as repeated mod= lines in settings.cfg, in load order. Back up
the mods folder with your saves/settings when moving the installation. Rebuilding
preserves mods; personal mod files are excluded from source control and releases.
Linux/macOS use the same layout beside b2 and the same commands without .exe.

The focused native diagnostic exercises ordering, validation, original directory
entries, file sizes, read-only handles, synchronous/asynchronous reads and EOF
without booting, opening an audio device or running a gameplay benchmark:

& .\build\windows\Release\b2.exe --check-mods data/local/default.xbe 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/checks/mods

Choose a fresh output directory. It retains small fixture mods and mods-check.json.

Developer commands and native diagnostics

Windows x64, Visual Studio 2026 C++ tools, Windows SDK, LLVM 22.1+, CMake 4.2+
and Git are required. The builder loads the x64 SDK environment automatically.
For the commands below, first open Developer PowerShell for VS 2026, select its
x64 tool environment, and ensure clang-cl, lld-link, llvm-lib, Ninja and CMake
4.2+ are on PATH. Ninja is included with Visual Studio's CMake tools.
Use C++23. Zydis is pinned and linked only into b2-tool, never the game executable.
Run PowerShell commands from the repository root. Private media and generated
outputs remain ignored. No Python is required.

Updating Windows source builds between releases:
Close the game and builder. Back up data/user and data/local/settings.cfg beside
b2.exe, plus data/local/custom-music if you imported music. Pull the latest
source, keeping build and data folders. Run Install.cmd again and select
your XISO. Setup prepares missing tools, refreshes game-file locations and preserves other settings,
saves and imported music. To move to Burnout2-Setup.exe instead, copy data and
mods from build/windows/Release into an empty folder and install there.
With V-sync enabled, display rates are limited by the
monitor's refresh rate; lower selected rates keep their cap.

Release uses clang-cl, Ninja and parallel ThinLTO with a 3 GiB linker cache per
executable. The generated CPU shards share a precompiled header and emit direct
fallthrough for consecutive instructions. Real branches and diagnostic checkpoints
remain explicit. Unchanged builds reuse compilation and link output. When upgrading
an existing Visual Studio build, Build.cmd refreshes CMake's configuration while
preserving game files, settings and saves.
For a manual upgrade from the Visual Studio generator, run
cmake --preset windows --fresh once before the commands below.

cmake --preset windows
cmake --build --preset release
& .\build\windows\Release\b2-tool.exe extract 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' default.xbe data/local/default.xbe
& .\build\windows\Release\b2-tool.exe extract 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' data/b2distfx.bin data/local/b2distfx.bin
cmake --preset windows -DB2_XBE="$PWD/data/local/default.xbe"
cmake --build --preset release

Skip extraction for existing files: extraction refuses overwrites. Enabling
B2_XBE also requires the effects image; B2_EFFECTS can override its local path.
The target is verified against knowledge/supported_target.json.
Debug uses: cmake --build --preset debug

Static CPU generation

B2_XBE enables ahead-of-time generation from entry, main, verified startup roots
and original constructor tables. Discovery follows direct calls, bounded switches
and installed static callbacks with a 16 KiB decoder cache. Limits: 65536 functions,
4096 instructions per function, 2097152 instructions total, 256 MiB source, 512
stable compilation shards. Unchanged shards keep their timestamps. There is no
runtime decoder, JIT or interpreter fallback.

Coverage reports:
build/windows/generated/Release/native_cpu.cpp.json
build/windows/generated/Debug/native_cpu.cpp.json

The report distinguishes compiled and proven closed functions, unresolved calls,
instruction failures, required services and native platform bindings. Partial
builds emit translatable functions with explicit boundaries for missing targets;
they do not establish complete coverage or boot. Native platform bindings preserve
visible behavior and calling conventions, and are reported separately.
The current batch translates over 35500 discovered functions without unsupported
instructions. Mutable indirect calls still need verified targets; this is not a
claim that every gameplay path or hardware service is covered.

Use b2-tool --help for bounded data reads, decoding, analysis and batch generation.
Seeds accept one address or entry per line, and table START END for verified
file-backed function-pointer tables. # starts a comment. A custom batch:
& .\build\windows\Release\b2-tool.exe batch data/local/default.xbe build/windows/generated/cpu-seeds.txt 65536 4096 build/native.cpp --allow-partial --report build/native.json

Incomplete batches exit 3. Without --allow-partial they publish only the report.
--replace permits replacing generated outputs. Wrong executables exit 2.

CPU, loader and original startup

& .\build\windows\Release\b2.exe --check-cpu data/local/default.xbe
& .\build\windows\Release\b2.exe --check-prediction data/local/default.xbe build/checks/prediction
& .\build\windows\Release\b2.exe --check-prediction data/local/default.xbe 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/checks/prediction-race
& .\build\windows\Release\b2.exe --check-audio
& .\build\windows\Release\b2.exe --check-audio data/local/b2distfx.bin build/checks/audio-capture
& .\build\windows\Release\b2.exe --check-spatial data/local/default.xbe
& .\build\windows\Release\b2.exe --check-spatial data/local/default.xbe build/checks/audio-bindings
& .\build\windows\Release\b2.exe --check-music data/local/default.xbe 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/checks/music
& .\build\windows\Release\b2.exe --check-custom-music data/local/default.xbe build/checks/custom-music-check
& .\build\windows\Release\b2.exe --check-effects data/local/b2distfx.bin
& .\build\windows\Release\b2.exe --bench-cpu
& .\build\windows\Release\b2-tool.exe check-image data/local/default.xbe
& .\build\windows\Release\b2.exe --check-boot data/local/default.xbe 1000000 --disc 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso'

Prediction checks require a fresh output directory and write report.json without
booting, rendering, audio playback or network access. Without ISO they verify two
isolated original physics bodies and bounded restore/replay. With ISO they load
original road, traffic, two human cars and sound resources, using two virtual
controllers and the original race update. Reports identify initialization failures
and the remaining restoration/prediction work. Exit 3 means the online feasibility
gate is incomplete, even when its component checks pass. See research/online-state.txt;
these checks do not establish online racing or game FPS.

CPU checks use native instruction references, original helpers, memory overlap
and alignment, floating state, TLS and fixed dispatch. Direct native calls retain
guest floating state; host services suspend it. Helper benchmarks are not FPS.
Consecutive x87 calculations compile into native instruction blocks, preserving
the original precision, order and floating exception state. Blocks stop at
branches and control operations; diagnostics and invalid memory retain the
individual compiled instructions. The CPU matrix check compares results and
state against unfused original code across rounding modes and overlapping
inputs. --bench-cpu reports both versions' timings and matching checksums.
Image checks also replay the original Crash-mode UI queue for empty, full and
partial bars, checking the compiled callback, vertices, colours and return stack
without booting. The user confirmed that Crash mode loads after the missing
callback was compiled; complete mode coverage remains unverified.
CPU checks also verify the restored Xbox reciprocal-square-root approximation,
including the original vector-normalization routine. Its small lookup table is
compiled into the executable and does not depend on the host CPU's estimate.
The user confirmed that the How to Play lesson demonstration now plays.
Audio checks exercise the shared PCM/Xbox ADPCM decoder and mixer without a game
or sound device. Native SDL3 playback supports buffers, loops, gain, frequency and
output routing. All five original DSP programs compile ahead of time into native
C++ functions (1754 instructions), with real delay-buffer transfers and shared
SDL3 processing. Sixty-five offline effects checks and sixty-five audio checks pass,
including all 32 mix bins, headroom and replacement of the native effects image.
Play and write positions follow the original codec-block lead and loop wrapping;
play-region changes reset the loop region and normalize zero lengths.
Music checks open twelve included soundtrack files through the original compiled WMA
file decoder, feed its packets through the native sound stream and mix two seconds
per track without booting or opening a sound device. They export WAV files and a
JSON report, with bounded reads, timeouts and an execution budget. Each track also
uses the original XACT asynchronous envelope-stop adapter and verifies packet
completion before releasing the native stream.
Public effect-data updates, reads and commits use the native DSP state. Deferred
updates wait for commit; they do not enter private MCPX hardware paths or overwrite
the game's sample memory. Seven additional effect cases cover those operations.
3D geometry, distance curves, cones and Doppler use the original compiled SDK
calculators, including environmental direct/room attenuation and low-pass
coefficients. Native room sends feed the original reverb program. Native stereo
placement consumes their angles and keeps total stereo power constant.
FXIN voices return processed samples through
their own volume, 3D placement and room sends; both DSP mix-buffer windows share
one backing buffer. HRTF filtering, environmental listener changes,
stream packets and scene audio parity remain
incomplete. Source and listener
settings support immediate application and explicit deferred commits.
The optional audio-check output verifies capture/replay against uninterrupted
playback, including saved DSP history and a partially consumed output block.
The optional spatial-check output compares all six native listener setters with
the original SDK's software-only setters and checks immediate/deferred commits.
Both require fresh output directories and open no audio device.
The binding check passes 74 cases, including six original listener setters; the
capture roundtrip brings the optional audio check to 67 cases. Correct listener bindings
keep position, velocity, distance, rolloff and Doppler separate across all SFX.
Use --inspect-effects XBE IMAGE OUTPUT_DIRECTORY to decode bounded Xbox effects
images through the original SDK's compiled routines without booting. It exports
each DSP program and its descriptor for research and checks the native image
decoder against the original SDK. --check-effects executes the compiled programs
without booting or opening a sound device.

The loader handles preload flags, zeroed storage, section references and lazy
loads. Boot diagnostics execute original entry and thread routines through the
static table. Reports include the stopping address, registers, stack, recent
execution, thread states and service calls. Native fibers retain compiled call
stacks; function/loop checkpoints allow time slices even during busy waits.
Reports also include reserved/committed memory blocks
and the last failed allocation request
(size, alignment, requested address, lowest and highest address).
Headless boot accepts at most 200000000 diagnostic checkpoints and retains a
30-second wall-clock limit. Larger checkpoint budgets let original busy waits
receive real timed callbacks and asynchronous disc completion.
The executable reaches original main and completes original graphics setup against a real D3D11
device. Original command buffers reach native draws, framebuffer flips and GPU
fences. Live execution reaches the original Single Player menu after its no-save
acknowledgements, loads the first driving lesson and renders its car, road,
traffic and HUD. Scripted acceleration advances the original car. A complete
race remains unverified. Add --frame OUTPUT.png
to save the actual submitted image; diagnostic file operations are also reported.
Use --memory ADDRESS:BYTES to include a bounded RAM slice in the report. Each slice
contains at most 4096 bytes; at most four slices are accepted. Addresses and sizes
can use decimal or 0x-prefixed hexadecimal notation.
Use --break ADDRESS[:HIT] to stop at an original native function or loop checkpoint.
HIT defaults to 1. Breakpoints and memory snapshots remain diagnostic-only.

& .\build\windows\Release\b2.exe --check-replays data/local/default.xbe 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' build/checks/replays

Use a fresh output directory. This isolated check loads all 18 recorded menu and
lesson demonstrations through the original file manager and replay loader. It
compares headers, frame counts and complete input payloads with the disc files
without booting, opening a window or using a graphics or audio device. It also
replays the real asynchronous FWYL.PSS read that damaged a loading semaphore,
checking the full payload across the original fixed track-buffer boundary.

Mounting an ISO verifies its default.xbe matches the compiled target. Disc files
are read-only. Native saves and cache use data/user/UDATA, TDATA and CACHE beside
b2.exe, independently of the working directory. The original save menus and
profile format use native SHA-1/HMAC and a persistent native console identity in
data/user/storage.key. Back up the whole data/user folder to retain both saves
and their identity. Original save metadata uses the target's Windows-1252/UTF-16
conversion services. Logging records the actual storage root at game startup.
The cache binding creates Z: and a private title directory. Requested cache
formatting affects only that title's cache. Storage rejects traversal and reparse
points; saves remain persistent.

To import a US Xbox profile, open Game files > Import Xbox Save and select the
file named Profile 1, Profile 2 or Profile 3 in the extracted Xbox save folder.
The importer verifies the profile checksum and signs a copy for this installation.
It keeps the Xbox slot number when available, otherwise it uses a free slot.
Open Load/Save in the game and choose the reported slot.

& .\build\windows\Release\b2.exe --check-storage data/local/default.xbe build/checks/storage

Use a fresh output directory. This isolated check runs the original process-heap,
title mount, save-directory and player-profile signing routines without booting.
It writes and reopens a full profile across fresh runtimes, checks signatures
against Windows CNG, then overwrites through the game's asynchronous write path
and reopens again. It also checks copied SHA contexts, padding boundaries and
Xbox HMAC key truncation. It also checks the original shared semaphore wait
while the process heap grows and frees mixed small and large allocations.
The title's fixed physical buffer claims run through the original SDK too;
ordinary heap growth must preserve those buffers and the loading semaphore.
The same check closes pending-I/O handles before completion, waits on retained
file dispatchers, and exercises more than 64 lifetime workers without retaining
their ended fibers/stacks. Handles and explicit object references keep terminated
thread dispatchers valid. It checks Xbox ACPI/CPU clock domains and new-thread
floating-point defaults through the original SDK calling conventions.
Fixtures stay in the requested output directory.
The isolated --check-memory-watch diagnostic checks hardware write detection and
removal without booting. Its optional --crash argument deliberately terminates
that diagnostic to validate the native crash report; it is not a gameplay check.
For a manual corruption investigation, --watch-semaphores accepts up to four
guest handle numbers and opens the normal app. It watches the immutable type byte
after object creation, skips legitimate initialization and removes watches before
memory is released. Overlapping file reads are checked separately because Windows
may complete them outside the guest thread. These watches are opt-in and are not
saved in settings. Native crash logs include registers in RAX, RCX, RDX, RBX, RSP,
RBP, RSI, RDI, R8..R15 order, four debug addresses and up to 16 stack words.
The user confirmed creating a profile, saving, restarting and loading it in-game
on 2026-10-09.

Offline D3D11 rendering

& .\build\windows\Release\b2-tool.exe check-render build/checks/render --debug
& .\build\windows\Release\b2-tool.exe check-render build/checks/render-warp --warp --debug
& .\build\windows\Release\b2.exe --check-visibility data/local/default.xbe build/checks/visibility
& .\build\windows\Release\b2.exe --check-visibility data/local/default.xbe build/checks/visibility-warp --warp

Use fresh output directories. Runs save PNGs and structured adapter, failure and
GPU timing reports. Visibility checks list unavailable MSAA modes separately in
unsupported_configurations; all supported configurations retain their assertions.
Software Vulkan validation needs Mesa 25.3 or newer: older llvmpipe versions
have incorrect MSAA scissor boundaries. Mesa 26.2.5 passes these rendering checks.
The renderer supports all ten NV097 primitives, indexed draws,
depth, stencil, culling, scissor, polygon offset, blending, alpha tests, four texture
stages, register combiners and fog.
Points retain their original size or distance attenuation. Point sprites use a
built geometry shader to expand each flake and generate its texture coordinates.
Depth, clipping, resolution scaling and MSAA remain active; line and triangle
draws bypass that shader.
The build translates the original vertex programs and compiles the renderer,
fixed-transform and GUI shaders into the
executable. The game has no shader compiler dependency. Shader constants and
render state change normally during play; no HLSL is compiled during drawing.
Successful shader generation is stamped so unchanged source files do not cause
the build to repeat shader compilation on subsequent incremental builds.
Launch programs execute on the GPU in offline checks. The game rejects any
vertex program missing from its compiled bank. Texture uploads support mip chains, cubemaps,
3D volumes, Morton layouts, RGB565, ARGB/XRGB and native DXT1/3/5. Projected
2D/3D sampling, pass-through, clipping and dependent AR/GB sampling are supported.
Vertex uploads can retain original interleaved streams, packed colors/normals,
shorts, bytes, float2H and current attributes instead of expanding every vertex.
Offscreen targets, including RGB565/Z16, can be copied and sampled on the GPU.
Texture bindings reuse matching rendered surfaces instead of stale RAM images.
GPU-produced cubemaps reuse six copied faces and refresh after producer writes.
XRGB bindings supply opaque alpha before alpha kill, including rendered textures.
Full packed color clears preserve the same GPU image across linear/swizzled
layout changes without a depth allocation; nonuniform reinterpretation is
explicitly unsupported. Texture sampling respects separate minification/magnification,
detail bias, mip-level limits and anisotropy. Samplers share a bounded cache
independently of blend/depth/raster state. Unused settings share native sampler
descriptors, and queued draws retain their samplers when older entries are recycled.
Surface clips retain their framebuffer storage; growth preserves color, depth
and stencil on the GPU.
Prepare resources before submission. Readback is an explicit offline operation.
The native tool retains its shader compiler for standalone component diagnostics.
For shader-bank research, use b2-tool compile-shaders XBE OUTPUT.cpp --replace.

The component suite passed 183 cases on RTX 5060 Ti and WARP with no D3D11
warnings, including relocated vertex programs, unused instruction slots and
mapped alpha output, linear surface coordinates, XRGB/ARGB alpha kill and
GPU cubemap face updates, shadow clear aliases, distant texture sampling,
scaled UI alignment and repeated framebuffer copies/fades at 1x through 4x.
Framebuffer fading handles both texture modulation and the game's texture-RGB /
vertex-alpha blend. Animated-text checks use the captured blend with zero stored
alpha at 60/144/360 Hz, 1x/3x resolution and single-sample/4x MSAA rendering.
Components do not establish scene parity or game FPS. Remaining graphics
work includes fixed lighting, other dependent texture modes and scene verification.
Fixed transforms support all seven skin modes, transformed/normalized normals,
texture matrices, object/eye/normal/reflection/sphere texture generation and five
fog sources. Matrix aliases share the original vertex-program constant bank.
Original GPU packet submission is supported. GPU fences and timing queries avoid
allocating queries or
waiting for timing samples during normal rendering.
Visibility queries return original pixel coverage through the SDK's report
memory, with ordered asynchronous completion. Higher internal resolutions and
MSAA retain the original pixel count. Unrestricted guest allocations search from
higher addresses so graphics buffers, heaps, pools and stacks leave space for
devices with limited DMA ranges. Explicit addresses and allocation bounds remain
honored.
The visibility diagnostic runs the original SDK without booting the game.

& .\build\windows\Release\b2-tool.exe render-texture INPUT.bin 0x0F 256 128 OUTPUT.png
& .\build\windows\Release\b2-tool.exe inspect-textures data/local/global.dic
& .\build\windows\Release\b2-tool.exe render-dictionary data/local/global.dic build/checks/global-textures
& .\build\windows\Release\b2-tool.exe compare-images ACTUAL.png REFERENCE.png DIFFERENCE.png 3

The native RenderWare reader rendered all 120 global.dic and 80 frontend.dic
textures. Compare aligned original Xbox video screenshots; record source,
timestamp and viewpoint. Asset rendering alone is not frame parity.

SDL3 input supports compatible Xbox, PlayStation, Nintendo and other recognized
gamepads, plus custom keyboard controls. The Controls page selects the
keyboard or one of four controller player slots. Each controller action accepts
a button, trigger or stick direction; analog inputs keep their original range.
Clear removes a binding, and Restore controller defaults resets only that player.
Mappings save automatically and apply during play. Profiles follow player slots
across reconnects and use SDL's standard controls; face-button names follow the
connected controller. Settings navigation keeps its standard controls.
To assign a control, select its action, release the controls, then press the new
button, pull the trigger or move the stick. Small stick drift is ignored while
listening. Esc, Cancel binding or waiting ten seconds cancels. Captured controls
are withheld from gameplay and settings navigation until released. Disconnecting
the selected controller cancels capture and preserves its saved bindings.
Offline virtual-controller checks cover remapping, analog ranges, cleared
bindings, independent players, capture, disconnection and rumble. Hidden settings
checks verify capture, cancellation and saving without booting the game.
The executable opens an SDL3 window without creating a terminal. Command-line
diagnostics retain redirected output and can attach to the caller's terminal.
Persistent Dear ImGui settings use a sidebar for Game files, General, Audio,
Graphics, Enhancements, Controls and Diagnostics. The charcoal/orange interface
uses Windows UI fonts, custom vector icons, scrollable option panels and pinned
game buttons. Fonts are loaded from Windows, not redistributed. Keyboard and
gamepad navigation are enabled, and descriptions appear in hover tooltips.
Diagnostics contains capture/performance controls and the latest 64 startup,
capture and error messages, newest first.
Esc toggles settings; F1 remains an alias.
General selects the presentation limit, defaulting to 60 Hz independently of the
monitor, and has a frame-rate counter toggle. Each completed game frame is
presented once. Absolute SDL3 deadlines avoid catch-up bursts after stalls or
rate changes; the guest video callback stays at 60 Hz. V-sync can still limit
presentation to the physical display. Frame generation has been removed.
Gameplay uses the original fixed simulation steps. Vehicle and camera poses
are smoothed between those steps for drawing at the selected display rate.
Menu and HUD movement, sizing and fades also use intermediate visual values;
the original text blur keeps its duration and follows the same display timing.
Loading animations follow elapsed time, including during blocking loads.
Track animations, screen fades and boost blur retain their original timing at
higher refresh rates, including pause and slow motion.
Audio controls master volume and mute through SDL3's output gain. Mute on focus
loss optionally silences the output while another window has focus and restores
the selected volume on return; playback keeps its place. Browse a music
folder and choose Import music to make its songs available in the original
Music Selection menu. Each import replaces the collection with up to 500 files
from that folder, without scanning subfolders. Folder and filenames provide
the collection and song names. MP3, WAV, WMA, FLAC, M4A and AAC are supported
through Windows Media Foundation; missing media components need the Media Feature
Pack. The originals are read only, and cancellation preserves the previous cache.
Import runs outside gameplay, with progress and cancellation; importing during
play ends the session and restarts from the beginning after success. The Custom
music checkbox applies when starting or restarting. Converted WMA files and the
original-format catalogue are stored in data/local/custom-music beside b2.exe.
The compiled Xbox code discovers and plays them through read-only native storage.
Windows media libraries are delay-loaded and only needed for importing.

Command-line import uses the same implementation:
& .\build\windows\Release\b2.exe --import-music 'C:\Music\Driving' build/windows/Release/data/local/custom-music

--check-custom-music requires a fresh output directory. It generates seven short
tones and verifies import, Unicode names, catalogue group boundaries, cancelled
replacement and playback through the original compiled soundtrack APIs and WMA
decoder. It decodes the complete first song and compares the result with its
catalogue duration, retaining only packet statistics. An optional final
CACHE_DIRECTORY argument checks an existing imported library read-only instead
of generating fixtures. Import preserves recording levels; built-in and imported
music share the native volume and headroom controls. The user confirmed in-game
selection and playback; all further in-game checking remains manual.

Graphics has Widescreen (16:9), V-sync, fullscreen and internal resolution (1x-4x).
V-sync defaults off for new installations. At the monitor's refresh rate it
follows the display queue; lower selected rates retain their cap. Existing saved
preferences retain their selected value.
Widescreen reports the original video-settings bit to the compiled game and
fits its anamorphic framebuffer to 16:9 at presentation. HUD widgets retain their
4:3 proportions and original edge/centre anchors. The correction includes text,
gauges and their animated parts, and accounts for existing native split-screen
scaling. Native camera calculations remain unchanged. The logical framebuffer
stays 640x480; internal scaling is unchanged. The option saves
automatically and applies during play. It defaults off.
Resolution scales colour/depth/feedback targets and raster/scissor rectangles;
guest coordinates, texture addresses and gameplay are unchanged. Vertex mapping
keeps the host half-pixel origin independent of scale. Changes during play resize
the existing targets, preserving their colour, depth, stencil and feedback.
Diagnostic readback storage is allocated only
on request. The render-target budget accounts for scale and stays bounded.
Enhancements follows Graphics and offers antialiasing Off/FXAA Low/Medium/High/MSAA 2x/4x/8x
and anisotropic filtering Original/Off (1x)/2x/4x/8x/16x. Both save automatically
and apply during play. Defaults preserve the original single-sample
rendering and per-texture anisotropy, including the game's captured 2x road filter.
Ambient occlusion offers Off/GTAO Low/Medium/High and a strength control. It
defaults Off; the initial strength is 35%. It adds contact shading using the
original perspective camera and a depth snapshot, without changing original
colour/depth/feedback targets. Supported HUD layers are composed afterward.
The added image feeds FXAA. Shaders compile during
the build, and AO resources are allocated only while enabled. Settings apply
during play. Original baked shading remains; lower strength keeps
the added effect subtle. Screen-space AO cannot account for hidden geometry.
FXAA runs once on each completed internal-resolution image,
without changing original colour, depth or feedback targets. The settings and
counter overlay remain sharp because they are drawn afterward. In-game HUD/text
are part of the game image and may soften. One additional RGBA8 target is included
in the resource budget only while FXAA is enabled; shaders compile during
the build. Forced anisotropy preserves point sampling, address modes and signed
LOD bias/limits. MSAA renders colour and depth with the selected sample count,
then resolves to ordinary textures for feedback, reflections and display.
Growing targets copies individual colour/depth/stencil samples
with built shaders; D3D11 forbids partial multisample copies. MSAA levels require
support across the game's RGBA8/RGB565 and D16/D24S8 formats. Unsupported levels
are disabled, and a saved unsupported choice resets to Off with a Log message.
The target budget includes multisample colour/depth and resolved images. See
research/enhancements.txt for evidence and native validation.
Draw distance replaces the separate LOD and render-distance overrides. Choose
Original (1x), 2x or 4x in Enhancements; Original is the default. Camera far
clipping, scenery fade and traffic opacity scale together. Enhanced modes keep
traffic bodies and movable/loose parts at full mesh detail instead of blending
between lower-detail models. Loose-part ground shadows extend their original
cutoff by the same multiplier. Additional track sections are drawn beyond the original visibility
list, using original material records compatible with the active distant models.
Viewing directions are derived from the original mesh visibility records to
avoid exposing unfinished terrain backs. Scenery already represented by an
incompatible distant model keeps that model; extension depends on the track
and viewpoint. Reflection views and depth/culling states remain original.
Extended modes preload world data into separate 64 MiB rendering storage and
prepare the extra visibility lists during loading; Original does neither. Each scene
camera retains its original range across camera switches, so scaling never
compounds. Traffic bodies and wheels extend together to 500 units at 2x and
750 units at 4x, bounded by the original traffic pool. Their fade shares the
same range. Traffic spawning and physics remain original. Original (1x) retains
the game's three mesh-detail levels.
Changes apply during play. Enabling extra scenery may briefly pause to prepare
the current track; steady rendering adds no file reads or allocations.
Returning to 1x restores the original camera distance. Existing enabled override settings migrate to 2x; an explicit
draw_distance=1, 2 or 4 takes precedence. Only the new setting is saved.
Intro skip finishes the original logo sequence at the PRESS START title screen
after required loading, preserving its normal controls and attract timeout.
The FPS overlay measures display and original-game frames separately over half
a second and is drawn at window resolution.
Controls allows a key per action, clearing bindings and restoring defaults.
Esc cancels an active key change; Esc/F1/F8/F9 remain reserved for the interface.
Settings, including scancodes and game-file paths, save automatically in
data/local/settings.cfg after editing. Closing settings or the app also saves
pending edits. Continuous slider/text edits do not write on every frame.
The Achievements tab appears above Mods and lists locked and unlocked achievements.
The ten achievements cover Crash Zone medals, Driving 101 golds, race wins,
Championship/Pursuit completion, starting boosts, Burnout x15, and a 40-second
Crystal Summit Peak lap in Time Attack. Crash + Burn keeps the original test
achievement's saved unlock. Bronze-or-better repeat Crash Zone results qualify.
Aggregate goals count medals and completions already in the loaded game profile,
and are checked when you next complete the relevant event. Championship finishes
at Custom Series Qualifier; Custom Series finishes at Heart Attack Grand Prix.
Each achievement uses the project icon; locked achievements appear at half opacity.
Unlocking shows a five-second notification with a 250 ms fade-in, a 350 ms fade-out
and the supplied achievement sound. The sound follows master volume, mute and
focus muting. Reset achievements asks for confirmation before clearing achievement
progress and notifications so you can earn them again. The dialog dims settings
and defaults to Cancel; Escape also cancels. Disable achievements stops
new unlocks and notifications while keeping progress; Enable achievements resumes
tracking future results. The enabled/disabled choice also persists across launches.
Progress is shared across game profiles in this installation and saves separately
in data/local/achievements.cfg
beside settings.cfg. Back up this file with your saves. Saves run in the background;
closing the app finishes pending writes. Existing medals do not unlock retroactively.
Graphics / Display offers 4:3, 16:9 and 21:9 aspect ratios. Camera FOV adjusts
driving and replay views from 50% to 150% of the original vertical angle.
100% and Reset restore the original view. Higher values show more of the scene;
lower values zoom in. Camera zoom effects are preserved, with effective angles
clamped to 1-170 degrees. It applies during play and saves as camera_fov=100.
The old degree preference is ignored and defaults to 100%.
FOV adjustments preserve HUD size, physics and replay timing.
Full and split-screen views keep their chosen aspect ratio. Only perspective
scene cameras are adjusted; orthographic menus keep their original view.
The camera's drawing scope updates its view/frustum and restores the
simulation lens afterwards; ambient occlusion receives the rendered lens.
Native CPU and hidden-window diagnostics cover the setting without booting;
gameplay appearance and performance still need a manual check.
Enhancements /
Miscellaneous includes Motion blur, enabled by default, and Fast load, disabled
by default. Fast load removes loading fades and display pacing while the original
asset loaders finish; it does not bypass file-completion checks or change gameplay
timing. These settings apply during play; existing widescreen settings
migrate to 16:9.
Graphics also offers optional HDR output on Windows, disabled by default. Enable
HDR for the display in Windows first. The game uses a floating-point scRGB
swapchain and expands highlights from the original SDR image; it cannot recover
lighting detail already clipped by the original game. Paper white sets normal
image and interface brightness (200 nits by default). Peak brightness uses the
display's reported limit, with a 1000-nit fallback, or a manual calibrated value.
Paper white is capped at the peak so normal brightness cannot exceed that limit.
The existing HUD separation keeps supported overlays at paper white. HDR uses
one presentation pass and the existing overlay layers; original framebuffer
values, feedback and blending remain unchanged. MSAA, FXAA and AO are supported.
Settings apply during play. Moving to an SDR display or disabling Windows HDR
returns to SDR while retaining the HDR preference. Native Linux/macOS HDR output
is not yet supported. PNG captures remain SDR; window captures convert scRGB at
paper white and clip highlights that cannot be represented in an SDR PNG.
Native diagnostics verify highlight brightness, black levels, HUD separation,
live changes and resource release without booting. Actual HDR display appearance
requires a manual check on an HDR monitor; offline checks do not establish it.
The output follows Microsoft's FP16/scRGB guidance:
https://learn.microsoft.com/windows/win32/direct3darticles/high-dynamic-range
Clean HUD, enabled by default in Enhancements / Miscellaneous, redraws the
original A-Z/a-z lettering, digits, punctuation and symbols, including mathematical
signs, copyright/trademark marks and font arrows, white menu arrows, rounded menu
boxes, laurel wreaths, Xbox button icons,
speedometers, tachometers and boost gauges. All 16 original dashboard variants
retain their markings, redlines, needles and translucent backgrounds; boost
keeps its original animated flames. Clean HUD also prevents faded-out Crash
bonus numbers from reappearing when their opacity goes below zero.
Gauge numbers have complete, smooth black outlines, including stroke ends.
The boost bars and flame mask follow the same inner edge as the redrawn frame.
Turning it off restores the original textures and opacity behavior during play.
Only matching atlas candidates are reuploaded when this setting changes.
Exact source-atlas hashes select the
traced outlines at upload; layout, colors and game-drawn shadows remain.
Preparation uses cached rows and integer interpolation, with BC3 storage for the
white font. Filtered copies down to the original atlas sizes keep both edges of
text outlines smooth when reduced to screen size. Each Xbox button retains its
own colors and highlights; START and BACK use the same shade. The five enhanced
atlases for one dashboard, including filtered levels, total 37.1875 MiB. Each
additional dashboard variant uses 10.625 MiB when uploaded. Existing texture caching avoids
rebuilding on each draw; disabled Clean HUD skips all recognition/preparation.
See research/ui-loading-moon.txt for source evidence and the moon-glow investigation.
The cursor hides after two seconds without mouse input while the window has
keyboard and mouse focus. Mouse movement, buttons and scrolling restore it;
holding a mouse button keeps it visible. Settings preserve normal cursor shapes
while it is visible.
The game buttons share a centered row. Exit game saves pending setting changes
and closes the app through the same path as closing the window.
Restart game ends the current session
through the native scheduler's cancellation path, releases its audio, pending
reads and guest stacks, and starts a fresh session in the same window.
Saved game-file paths, mods and imported music apply when the new session starts.
Display and enhancement changes apply between completed frames without restarting.
Skip intro affects any remaining splash screens, or the next launch if the intro
has already finished. Changing game-file paths no longer requires closing the app.

Hidden window diagnostics check saved/invalid bindings and settings, the counter,
all settings pages, Esc, scaled targets, 60/120 Hz pacing, original frames at
120/144 Hz, antialiasing and performance capture. They export images and timing
without booting. These measurements do not establish gameplay FPS or visual parity.
Live logs report game FPS separately from presented FPS.
F8, or Capture frame in Diagnostics, records the next complete GPU frame under
build/captures. It exports target images and streaming draws.jsonl records with
the original registers, shader tokens, constants, vertex layouts and complete
vertex/index buffers, plus clear events with their layout, color, channels and
rectangle.
Ordinary texture records include dimensions, formats and the current guest texture
bytes in separate .bin files. Game captures also export the compiled native shader
bank as .dxbc files. These binary files share a 64 MiB bound. settings.cfg records
the selected settings, and the GPU header identifies the graphics adapter.
window.json records the desktop/session, SDL video driver and version, fonts,
window/pixel dimensions and display scaling at the capture request.
window.png saves the displayed window. F8 also works before starting a game,
allowing startup settings/display problems to be captured without gameplay.
game-state.json records replay state, relevant memory and recent file operations
at the capture request; the GPU image records the next complete frame.
audio.bin saves sample banks, voice controls, routing and DSP history at the
request. Shared banks are copied once, bounded to 64 MiB plus 16 MiB DSP scratch.
audio-game-state.json records listener/source parameters and audio failures.
F8 also enables a bounded 10-second playback-event trace; the next capture saves
up to 8192 events and reports truncation, including volume, frequency, effect
writes and effect commits. Effect writes retain the first 64 parameter bytes
and report larger payload truncation.
The next capture also saves audio-live.wav (up to ten seconds of the actual mix)
and audio-live.json with callback timing, requests and device buffer information.
These recordings precede master volume. Capture once to arm recording, then again
after two seconds of the problem to retain the update history. Normal play
leaves this tracing disabled.
The game-state capture includes original music state; audio-game-state.json lists
packet streams, submitted/completed packets and playback status.
Inspect a captured audio.bin without booting or opening an audio device:

& .\build\windows\Release\b2.exe --inspect-audio CAPTURE/audio.bin data/local/b2distfx.bin build/checks/audio-scene

Use a fresh output directory. report.json shows source, routed and processed
signal levels, controls and failures; scene.wav replays two seconds of the saved
scene with frozen controls, before master volume. It does not replay game events.
GPU captures are opt-in, bounded to 2048 draws/48 MiB of trace data plus the binary
files, and report truncation explicitly. Missing buffers have a null data field.

Performance recording

Press F9 during play to start, reproduce the slowdown, then press F9 again to
save. Graphics / Performance diagnostics has the same controls. Recording stops
and saves after 60 seconds or at game exit. F8 also saves the current recording
alongside the frame/audio capture. performance-* folders contain performance.bin,
performance.json and a short performance.txt, under the usual build/captures path.

Recording measures exclusive main-thread wall time for guest code, kernel and
platform services, GPU command processing, drawing, buffer/texture uploads,
resource preparation, GPU waits, publication, display, Present,
UI, pacing and scheduler idle. It records source-frame intervals and counters
for draw/vertex volume, uploads, cache misses, copies, packets, fences and
presented/generated frames. Intentional pacing, scheduler idle and recorder
overhead are separated from work; frame/audio capture stalls are marked and
excluded from frame-percentile summaries. Service callbacks retain their parent
service category. CPU wall time includes host scheduling delays.

Guest checkpoints are sampled cooperatively at most once per millisecond;
original addresses and guest thread IDs guide bounded code analysis. They are
not per-function CPU timings. Twice per second, Windows resource samples record
process/main-thread CPU time, working set, private memory, page faults, handles,
I/O totals, resource counts and the process's local/shared GPU memory usage and
budget. Validity flags preserve unavailable measurements. Audio mix batches have
separate atomic elapsed-time and budget-overrun counters.

GPU timestamps sum nonoverlapping render, copy/resource and display
spans, excluding idle gaps and the ImGui overlay. An opt-in pool of eight frames
with 64 spans each avoids waits/flushes for timing; missing spans, invalid clocks
and results still pending at save are explicit. Normal play allocates no recorder
or extra timing pool and performs no sampling or per-frame disk writes.
Recorder capacity is 4096 source frames, 65536 checkpoint samples, 128 resource
samples and 2048 operation buckets; bound hits are reported.

Offline inspection and focused recorder validation require no game boot:

& .\build\windows\Release\b2-tool.exe inspect-performance CAPTURE/performance.bin build/checks/performance-report
& .\build\windows\Release\b2-tool.exe check-performance build/checks/performance

Use fresh output directories. Inspection rejects unsupported layouts, truncation
and oversized input before allocating bounded storage. Hidden window checks also
exercise source/display recording and nonblocking GPU result association.
Recorded CPU/GPU model, executable link stamp and display settings identify each run.
Component checks and instrumentation do not establish gameplay performance.

Dynamic vertex/index uploads append to unused buffer space and discard only
when wrapping, preserving in-flight draws. Identical shader constants reuse
their previous upload. Complete shader-upload packets copy in bounded blocks;
partial uploads retain their original lane/load-index behavior. Semaphore writes
at the same guest GPU command position share an event query, with separate
completion points for subsequent draws, clears, launches and flips. Offline
checks cover buffer wrapping, current attributes, shader-bank uploads and a
4096-write semaphore burst. Requested SDK fences wait only for their semaphore
value, using the original unsigned counter comparison across wraparound; an
already completed fence returns immediately. Query-pool capacity waits retire
only enough work to free a slot. Recording separates completion polling,
capacity waits, requested fences and full CPU-requested GPU-idle waits. Every
wait reason appears in the report, even below the hot-operation list's cutoff.
NV097 WAIT_FOR_IDLE submits queued draws in GPU order without stopping the CPU;
CPU-visible semaphores and explicit idle requests retain completion queries.
An offline 1024-barrier workload checks ordered output and one requested
semaphore, without creating completion queries for the GPU barriers.
Push-buffer RAM is validated once per bounded submission, with packet boundaries
still checked.
The original audio calculator retains derived listener orientation between
sources; moving listeners and immediate/deferred settings remain effective.
research/performance.txt records measured optimization batches. The latest
15-second Airport Terminal 3 benchmark measured about 223 original FPS on a
Ryzen 5 5600X and RTX 5060 Ti at 1x, widescreen, 240 Hz selected, interpolation
off and V-sync off, using the local LLVM profile-guided build. The sustained
240 FPS goal remains unmet; these measurements do not establish performance
on every track or an unprofiled installation build.

Interpolated presentation checks DXGI frame availability without waiting and
uses nonblocking Present. A busy display queue leaves the game running until
the next display opportunity. VSync remains enabled when selected. Hidden
window checks include a 1000 Hz presentation workload with simulated CPU work
to verify that display backpressure does not starve the 60 Hz source cadence.

Live execution reaches the original Press START, Load/Save and Single Player menus
and the first driving lesson.
Original sound-device creation now opens SDL3 audio. Boot uploads and replaces
the custom DSP image and starts native processing. Sound-resource method tables
are discovered from their verified original registrar. A 90-second diagnostic
completed driving, collisions and the lesson transition without an unsupported
stop. Race modes and scene audio parity remain unverified.

& .\build\windows\Release\b2.exe
& .\build\windows\Release\b2.exe --check-window build/checks/settings.png
& .\build\windows\Release\b2.exe --check-window build/checks/settings-warp.png --warp
& .\build\windows\Release\b2.exe --run-game data/local/default.xbe --disc 'Burnout 2\Burnout 2 - Point of Impact (USA).xiso.iso' --seconds 20 --frame build/checks/live.png

General > Discord Rich Presence shares whether the game is running or settings
are open, together with elapsed time. It is off by default and saves automatically.
The Discord desktop app must be running with activity sharing allowed. No account
linking, bot or extra DLL is needed. Turning the setting off or closing the game
clears its activity. Connections retry automatically if Discord starts later.
Local IPC runs on a background worker; changed activity is sent at most once per
15 seconds. Window diagnostics and scripted runs never publish presence.
The project's public application ID is built in; developers can override it with
-DB2_DISCORD_APPLICATION_ID=ID when configuring CMake.

--run-game also accepts --controls SCRIPT for explicit autonomous diagnostics.
Each text line contains milliseconds, an SDL button/axis name and its value:
0 start 1
300 start 0
Button values are 0/1; axes use -32768..32767. Events must be ordered, with at most
128 events and a 16 KiB file. Timing begins with the first original game flip.
The script owns a separate virtual gamepad and never changes physical controls.
The name performance accepts 1 to start a recording and 0 to save it. Its times
use the same first-flip clock, allowing repeatable race recordings without UI input.
The command capture 1 requests the same complete frame/audio capture as F8.
Schedule it after benchmark recording stops so capture I/O does not affect timing.
Frame captures retain the last presented image, including when execution stops
mid-frame or in a smaller offscreen pass. Captures and traces remain opt-in.
It also exports the exact pre-HUD -scene-previous/-scene-current PNGs and a
-camera.json with the two original camera snapshots. Available depth inputs use
-depth-previous.f32/-depth-current.f32: B2D1, little-endian uint32 width/height,
then row-major float32 depth values on the bounded motion grid.
--memory ADDRESS:BYTES captures up to four selected RAM ranges after a live run,
with at most 4096 bytes per range. --trace-io includes the last 64 file operations
with filenames, offsets, transfer sizes and destination addresses in the JSON
report. Release builds keep optimized native symbols in b2.pdb for data breakpoints.
Hidden window checks exercise the actual
SDL3/D3D11/ImGui presentation path without booting the game.

Automatic failure logs are saved beside b2.exe in logs/b2-TIMESTAMP-PID.log,
independently of the working directory. Each launch keeps its own JSON-lines
report. GUI runs now retain game exit/error details, CPU registers, stack words,
the last 64 execution checkpoints, thread states and failed file operations.
Native crashes retain the exception, native module offset and available guest
context. Session-end records distinguish normal shutdown from abrupt exits.
Logging writes at startup, game start/end and failure; no per-frame disk writes
or image captures are added. Full file tracing remains opt-in through --trace-io.

DESIGN.txt defines the native service approach. Preserved knowledge is research:
verify ABI and addresses against original bytes and primary interfaces.

Optional LLVM profile-guided build

Normal builds leave B2_PROFILE_GENERATE off and B2_PROFILE_USE empty. To train
native compilation on a game scene, configure/build Release with:
cmake --preset windows -DB2_PROFILE_GENERATE=ON -DB2_PROFILE_USE=
cmake --build --preset release

Set LLVM_PROFILE_FILE to an absolute private filename containing %p before
launching the game. Use a timed control script with benchmark 1/0 to collect
normal-play branches without the detailed recorder. Starting either a frame
benchmark or F9 performance recording resets compiler counters, excluding
startup/menu navigation. Exit normally within 30 seconds of that
start. Compiler data is written on exit. This training executable is not an
FPS acceptance result. Clear the environment variable after training.

Merge the selected game profile, then build the optimized native executable:
llvm-profdata merge -o PATH/airport.profdata PATH/airport-PID.profraw
cmake --preset windows -DB2_PROFILE_GENERATE=OFF -DB2_PROFILE_USE=PATH/airport.profdata
cmake --build --preset release

Use absolute paths. Keep profiles private/generated, and rerun the actual
Airport benchmark and CPU/render diagnostics before accepting the result.
The optimized executable has no profiling counters. To restore ordinary
compilation, configure with both -DB2_PROFILE_GENERATE=OFF -DB2_PROFILE_USE=.

B2_AVX2 is an optional Release compiler target, disabled by default. Enable
with -DB2_AVX2=ON only for an AVX2-capable CPU and operating system; that binary
requires AVX2. Rebuild and check CPU, audio, rendering and actual game timings.
Use -DB2_AVX2=OFF to restore the portable x64 target.

Low-overhead game-frame benchmarking

Timed control scripts also accept benchmark 1 and benchmark 0. These record one
existing SDL timestamp at each original game flip, with an 8192-frame reserved
buffer and an automatic 30-second limit. They do not enable detailed per-call
CPU/GPU tracing. Use the same scene and controller events when comparing builds.
F9 and performance 1/0 retain the detailed diagnostic and are exclusive with a
frame-only benchmark. Reports go to build/captures/benchmark-*/benchmark.json,
including raw frame intervals, CPU/GPU/build identity, settings, dropped frames
and median/p95/p99/max frame times. Setup/loading precedes the measured segment.
