|
coastline 0.0.4
|
Reconstructed source of the Nintendo 64 game Top Gear Rally.
No copyrighted material is in this repository. You must provide a cartridge image of the game for its assets. Building this source alone will not result in a playable game.
PROGRESS.md records which routines of each release compile to the original code, with IDO 5.3 for the Nintendo 64 releases and MSVC 5.0 for the PC libraries, with a page for each part of the program.
The build presets are tgr-us, tgr-asia, tgr-jp, and tgr-eu for the Nintendo 64 releases, boss-rally for the PC game, and coastline for the SDL game. The boss-rally preset builds both Windows renderer libraries and an NSIS installer. The ROM image of an N64 release is read from the TGR_ROM environment variable, and its assets are extracted into the build directory on every build. The image is checked against the SHA-1 of the unmodified release before anything is read from it.
| Nintendo 64 release | ROM SHA-1 |
|---|---|
| USA | bfc51f086ebdb78904dc24ad0c3a2d946e26d022 |
| Asia | 7e36a98f6fafe3ff7e72d14e0fae16418458da47 |
| Europe | 9fae5d98fe3464f00d59034690df90118646eb95 |
| Japan | e0415b87c5a5b69ac581e79137406bdaa79b354a |
The Nintendo 64 compiler is libdragon's GCC, found through N64_INST, and no other part of libdragon is used. Only -Os is supported for libdragon-GCC ROM builds. CMake applies -Os after build-type flags; changing the final optimisation level can exceed the ROM code area or cause runtime faults. The Windows compiler is an i686 mingw-w64 GCC, found through MINGW_ROOT or on the path. The Windows build is 32-bit only, and its BRD3D.dll and BRGlide.dll are meant as drop-in replacements for the files of the installed game. Every routine compiles into an archive. The boss-rally build produces both renderer DLLs, their launchers, and build/boss-rally/BossRally-Setup.exe. The installer asks for the original disc directory and copies its game data into the original SouthPeak Interactive/Boss Rally installation layout. Mount the disc image or use an extracted disc directory; the installer does not open image files. The uninstaller retains that game data, including saves and paint files.
Each Nintendo 64 release builds a cartridge image, such as coastline-us.z64 in the build directory, whenever TGR_ROM is set. Routines not yet reconstructed in C link from the assembly of the original under src/n64/asm, generated by splat from the region's YAML under tools/splat. A routine is removed from the assembly of a release when its C body compiles for that release.
Patched N64 builds use the original screen resolutions by default. Experimental Expansion Pak support remains unavailable in supported builds.
Set -DENFORCE_MATCHING=ON on an N64 build to verify the reconstructed code during every build. This needs IDO 5.3 at IDO_ROOT and the libdragon cross toolchain at N64_INST. The verifier compares instruction digests against tools/matching/{us,asia,jp,eu}.json, generated from verified original ROM images. CI runs it in a separate job for each region, without storing ROM images. tools/ido_flags.txt records alternative IDO flags where the first build choice does not match. An IDO Release build with patches disabled also provides a rom target. It assembles the compiled objects into coastline-<region>-code-only.z64, with non-code bytes set to zero, and checks the regional SHA-256. Set COASTLINE_REFERENCE_ROM to a verified original ROM when configuring to produce coastline-<region>.z64 with the original header and assets. That output must match the original ROM's SHA-1. For example:
To regenerate a region's digest file from a verified ROM, run:
Review the result before replacing tools/matching/us.json. Pass --encoder with the built encode-text tool for the Japanese ROM.
The host tools under tools/ are built with the host compiler during the configure step. They need argparse, nlohmann JSON, spdlog, and zlib, from vcpkg, the system, or a pinned download.
The sdl platform builds coastline, a stand-alone 64-bit game for every operating system SDL 3 supports, from Windows 7 and macOS 10.15 on x86_64 and arm64. It draws through the GPU API of SDL (Vulkan, Metal, or Direct3D 12). It builds with GCC, Clang, MSVC of Visual Studio 2022, and MinGW.
The coastline preset takes the libraries from vcpkg, found through VCPKG_ROOT.
On Linux, Coastline requests Feral GameMode at startup when its client library and service are available, and releases the request on exit. Missing clients or failed requests do not prevent play. The config-only setting GameMode=0 under [Game] in BossRally.ini disables the request; the default is 1. Internal game restarts preserve the registration. Other platforms ignore the setting. GameMode is not requested by import or Controller Pak commands.
Discord Rich Presence is optional. Build with -DCOASTLINE_DISCORD=ON and -DCOASTLINE_DISCORD_APPLICATION_ID=YOUR_APPLICATION_ID. CI enables support; its application ID defaults to empty until an ID is supplied. Empty IDs disable IPC and its worker thread. Presence reports the intro, attract demos, menus, racing, and credits through the local Discord client. Communication runs asynchronously, retries missing clients, and coalesces updates at 15-second intervals. Import and Controller Pak commands do not start presence. Flatpak permits native and Flatpak Discord sockets. Strict Snap confinement can prevent access to Discord IPC; presence remains inactive when the socket is inaccessible.
Installation includes four manual pages under ${CMAKE_INSTALL_MANDIR}/man1. CMake inserts the version and UTC date at configuration time; SOURCE_DATE_EPOCH supplies the date for reproducible builds. Use -DCOASTLINE_MAN_DATE=YYYY-MM-DD to supply an explicit manual-page date.
To build with assets for system installation, supply a Boss Rally disc image and at least one Top Gear Rally ROM image. Multiple ROM paths use a semicolon-separated CMake list.
The coastline_assets target imports images into the build directory using the import CLI. Installation copies the generated assets tree to ${CMAKE_INSTALL_DATADIR}/coastline, normally share/coastline. macOS bundles use Coastline.app/Contents/Resources/coastline. The original disc and ROM images are not installed. The import does not create user configuration or logs. Image changes, CUE track changes, and importer rebuilds trigger conversion again. Cross builds require COASTLINE_ASSET_IMPORTER pointing to a host Coastline executable, or a configured CMAKE_CROSSCOMPILING_EMULATOR.
With COASTLINE_INSTALL_ASSETS=ON, the setup wizard, --reset, --factory-reset, --yes-really, and -y are omitted. Missing or outdated assets produce an error requiring installation of usable data. Normal builds retain the wizard and reset options.
On Windows, cpack --config build/coastline/CPackConfig.cmake builds an NSIS installer that installs the game for the current user, with shortcuts and an option to add it to PATH. Its final page starts the game unless Run Coastline is cleared. MSVC builds require the Microsoft Visual C++ Redistributable for the architecture of the game. Packages omit the runtime DLLs, and the installer offers a download of the redistributable when the installed runtime is missing or older than the build toolset.
A tag such as v1.2.3 names the build: the game shows the tag in place of the commit, and the build workflow attaches every package to a draft release of the tag. The release workflow publishes the draft once every workflow of the commit succeeds and every package is attached.
The build workflow uploads a debug and a release build of the game for each platform, an AppImage of each Linux release build, a snap for amd64 and arm64 built from snapcraft.yaml, and a Flatpak bundle for x86_64 and aarch64 built from sh.tat.coastline.yml.
Both packages import disc and cartridge images from the home directory and from removable media, and from nowhere else. The snap reads removable media once the interface is connected. It keeps its data in ~/snap/coastline/common, and the Flatpak in ~/.var/app/sh.tat.coastline.
Without vcpkg, each library and tool comes from a pinned release that is downloaded and built with the game. The USE_SYSTEM_<NAME> options take each from the system instead, with nothing downloaded: USE_SYSTEM_SDL3, USE_SYSTEM_ARGPARSE, USE_SYSTEM_FMT, USE_SYSTEM_FLAC, USE_SYSTEM_MESHOPTIMIZER, USE_SYSTEM_NLOHMANN_JSON, USE_SYSTEM_ZLIB, USE_SYSTEM_GLSLANG, USE_SYSTEM_SPIRV_CROSS, and USE_SYSTEM_DXC. A cross build takes glslang and SPIRV-Cross from the system or vcpkg, as it cannot run the tools it builds. Windows builds compile the Direct3D 12 shaders with DXC. The pinned DXC release is a prebuilt Windows (x64 and arm64) or Linux x86_64 program. Other hosts require USE_SYSTEM_DXC=ON with a DXC that includes the DXIL signing library.
On Linux, the build of SDL needs the development headers of ALSA, EGL, Wayland, xkbcommon, and the X11 extensions (Xcursor, Xfixes, Xi, Xrandr, Xss, Xtst), and autoconf-archive for vcpkg.
The game reads BossRally.ini from ~/.config/coastline, its data from ~/.local/share/coastline, and writes game.log to ~/.local/state/coastline. The XDG Base Directory variables move these directories. Windows uses Coastline in the roaming and local application data folders. macOS uses Coastline in Application Support, Caches, and Logs in the library of the user.
The first release uses version 1 of the imported asset formats. Pre-release installations require coastline --factory-reset; settings and data are not migrated.
Portable file lookup defaults to enabled, except in installed-asset builds, and is enabled in CI packages. Coastline checks for BossRally.ini and assets beside the executable, then in CoastlineData under the launch working directory, then in the working directory itself. Configuration and assets are selected independently. On macOS, adjacent files reside in CoastlineData beside Coastline.app, outside the bundle. AppImages use CoastlineData beside the original AppImage, rather than its temporary mount. Local assets precede system assets. Cache and state reside under the local asset root, or the local configuration root when assets use platform data. Absent local files use platform directories; unwritable selected locations produce an error.
Setup opens with separate directory-search and manual-path choices. Its portable-installation checkbox is unchecked for new installations. Selecting it imports assets and saves settings beside the application distribution, with local cache and state directories. Explicit --config or --data-dir overrides disable this checkbox. Moving a portable installation preserves setup paths stored relative to its directory. Configure with -DCOASTLINE_PORTABLE=OFF to disable portable lookup and installation.
Use --portable (-P) or COASTLINE_PORTABLE=1 to force adjacent storage without existing files. COASTLINE_PORTABLE=0 disables automatic local lookup, and --portable overrides the environment setting. The environment also accepts true/false, yes/no, and on/off, ignoring case. Explicit --config and --data-dir paths take precedence for configuration and assets; cache and state remain local when portable mode is forced.
Distributions with a bin directory use the complete package directory for portable storage. Windows ZIP packages include Coastline.lnk beside bin, with a relative target of bin\coastline.exe. Move the complete directory to relocate a portable installation.
Use coastline migrate-portable [DIRECTORY] to move portable assets, settings, saves, screenshots, and state into normal platform directories. DIRECTORY can be CoastlineData or its parent. Omit DIRECTORY to use automatic portable lookup. Add --copy to preserve the portable installation. Existing destination entries are never overwritten, and copying failures preserve the source. Cache is regenerated. After copying, use COASTLINE_PORTABLE=0 to select platform storage while portable files remain adjacent.
Use coastline make-portable [--copy] [DIRECTORY] to export normal platform assets, settings, saves, screenshots, and state. Windows and macOS create CoastlinePortable in the launch working directory by default. Windows exports the installed bin, library, and share directories with data at the package root. macOS exports the application bundle with an adjacent CoastlineData directory. Source program files are copied and preserved. Linux exports data only, defaulting to CoastlineData in the working directory. The executable may reside in a read-only installation. Without --copy, source data is removed after publishing the completed export. Move Linux exports beside an AppImage, or launch another portable-enabled build from the exported data directory.
On macOS the install is the application bundle Coastline.app, signed without an identity, with every library the game links that macOS does not provide inside it. The build workflow uploads it as a disk image. open passes the options of the command line after --args to the game. A game started by open runs in /, where a relative path does not resolve. Give absolute paths. -W waits for the import to finish, and -n starts a new instance, as open brings a running game forward without passing it the options. The output does not appear in the terminal, and game.log in ~/Library/Logs/Coastline records the result.
Ctrl+Z undoes the last paint-shop edit outside a dialog. In the main menu, press Up, Up, Down, Down, Left, Right, Left, Right, L, and R on the first controller to unlock Season Champion in track selection for the current game session. Directions are read from the directional pad, the stick, or the arrow keys. On the keyboard, A and S enter L and R. Season Champion is the unfinished course of the cutscene after a season (gamewin), with incomplete collision.
F8 toggles the free camera throughout the application, including setup, movies, menus, logos, and paused or running races. Flat screens become panels viewed in perspective while moving. Move with W, A, S, and D, rise with E, descend with Q, and look with the mouse. Two-finger vertical scrolling or the mouse wheel moves forward and backward. Shift increases movement speed. Free camera draws the whole track without distance fog or changes to saved settings. Escape exits free camera without pausing or navigating back; F8 also toggles the mode off. On a gamepad, Back toggles the camera, the left stick moves, the right stick looks, the shoulder buttons descend and rise, and pressing the left stick increases speed. Menu, driving, and text input remain active. The mouse controls the camera while free camera is enabled. The HUD disappears for screenshots.
Ctrl+Shift+R restarts the game from its intro without confirmation.
The Controls section of BossRally.ini maps the gamepad. Preset chooses one of the presets below, and a key of an action present in the section replaces the binding of the preset for that action. A value lists SDL gamepad names separated by commas (a, b, x, y, back, start, leftshoulder, rightshoulder, leftstick, rightstick, dpup, dpdown, dpleft, dpright, lefttrigger, righttrigger, leftx, lefty, rightx, and righty). a, b, x, and y are the south, east, west, and north buttons. A + or - after an axis selects one half of it, and an axis without a sign reads its positive half. An axis steers and accelerates in proportion, and a button gives the full amount. An empty value unbinds the action. The log records each name that is not a button or an axis, and the game ignores it.
DeadZone is the share of the travel of each axis that reads as 0, from 0 to 0.9, and the rest of the travel reads as it is. The default of 0.07 matches the dead zone of the steering of the Nintendo 64 release. A worn stick that steers or cancels the directional pad at rest needs a larger value.
The car of a player steers by the handling chosen on the car select screen, as the Nintendo 64 release does. The wheels turn towards the stick at a rate of the handling and return to the middle at once, and a stick pushed past 72% of its travel takes the whole lock, which narrows with the speed. The computer's cars and the autopilot of a script steer as in the PC release.
These are the keys and the bindings of each preset.
| Key | Default | Kart |
|---|---|---|
| SteerLeft | leftx-,dpleft | leftx-,dpleft |
| SteerRight | leftx+,dpright | leftx+,dpright |
| Accelerate | a,righttrigger | b |
| Brake | b,lefttrigger | a |
| Reverse | x | x |
| GearUp | rightshoulder | rightshoulder,righttrigger |
| GearDown | leftshoulder | leftshoulder,lefttrigger |
| CockpitCamera | righty- | righty- |
| BumperCamera | rightx- | rightx- |
| ChaseCamera | righty+,y | righty+,y |
| PauseMenuUp | lefty-,dpup | lefty-,dpup |
| PauseMenuDown | lefty+,dpdown | lefty+,dpdown |
| PauseMenuSelect | a | b |
| Pause | start | start |
| StartOrRespawn | back | back |
| MenuA | a | b |
| MenuB | b,x | a,x |
| MenuZ | lefttrigger | lefttrigger |
| MenuStart | start | start |
| MenuL | leftshoulder | leftshoulder |
| MenuR | rightshoulder,righttrigger | rightshoulder,righttrigger |
| MenuCUp | righty- | righty- |
| MenuCDown | righty+ | righty+ |
| MenuCLeft | rightx- | rightx- |
| MenuCRight | rightx+ | rightx+ |
| MenuDUp | dpup | dpup |
| MenuDDown | dpdown | dpdown |
| MenuDLeft | dpleft | dpleft |
| MenuDRight | dpright | dpright |
| MenuStickLeft | leftx- | leftx- |
| MenuStickRight | leftx+ | leftx+ |
| MenuStickUp | lefty- | lefty- |
| MenuStickDown | lefty+ | lefty+ |
Kart follows Mario Kart 8 on the Pro Controller, with the east button accelerating and the south button braking. A press of StartOrRespawn starts a race, and a second press within half a second resets the car. The menu keys drive the menus, and the race keys drive both players of a race.
In the pause menu, Escape continues the race whatever item is chosen, and Pause of the gamepad chooses the item, as Start does on the console. A race pauses when the window loses the focus. PauseOnFocusLoss in the [Game] section is 1, the default, to pause, or 0 to let the race run on. A run of run-script never pauses this way.
TypeA, TypeB, TypeC, TypeD, and SteeringWheel are the button layouts of the Nintendo 64 release, with A of the console on a, B on b, Z on lefttrigger, L and R on the shoulders, and the C buttons on the right stick. They bind the race keys below and the other keys as Default does. The controller configuration screen of the options menu writes Preset with any of the seven presets. Down reverses without A, and the console's e-brake (A and B together, or C down in TypeB) has no binding.
| Key | TypeA | TypeB | TypeC | TypeD | SteeringWheel |
|---|---|---|---|---|---|
| SteerLeft | leftx- | leftx- | dpleft | leftx- | leftx- |
| SteerRight | leftx+ | leftx+ | dpright | leftx+ | leftx+ |
| Accelerate | a | a | a | lefty- | a |
| Brake | b | b | b | lefttrigger | b |
| Reverse | lefty+ | lefty+ | dpdown | lefty+ | lefty+ |
| GearUp | rightshoulder | rightshoulder | rightshoulder | b,dpup | rightshoulder |
| GearDown | lefttrigger | lefttrigger | leftshoulder | a,dpdown | leftshoulder |
| CockpitCamera | righty- | righty- | righty- | righty- | righty- |
| BumperCamera | rightx- | rightx- | rightx- | rightx- | rightx- |
| ChaseCamera | righty+ | rightx+ | righty+ | righty+ | righty+ |
Player1 and Player2 choose the device of each player. A value is auto, the default, keyboard, gamepad1, gamepad2, and so on for the gamepads in the order they connect, a part of the name of a gamepad (PS5, DualSense, or Xbox), or none. With one player, the first player takes the devices of both. With two players, the gamepads go to the players that are auto in order, and the keyboard goes to the player that is auto without a gamepad. The keyboard and one gamepad are then enough for two players, with the gamepad for the first. The second player of a race drives with the keyboard bindings of the PC release (the arrow keys, Right Ctrl to brake, A and Z to change gear). The log records the device of each player at the start and whenever a gamepad connects or disconnects.
Alt+Enter and F11 switch between a window and the full screen on every screen of the game. F cycles through three states on every screen, from the first at each start. The first shows nothing, and the second shows the frame rate at the bottom of the screen, as in the PC release. The third adds lines at the top left with the time of the last frame and of the slowest frame of the second before, the use of one core and of every core together by the game, its memory (GAME RAM), the bytes of the textures and buffers the game has created on the GPU (GAME VRAM), and the share of an NVIDIA GPU the game used, read from NVML when the driver has it. On Linux GAME RAM leaves out the shared libraries and the GPU driver, and on Windows and macOS it includes the private memory of the driver, which those systems do not separate. The fonts of the menus have no percent sign, and PCT stands for it. In a race, F12 selects the next music track, and F11 does not select the previous one as in the PC release. F9 or Print Screen saves the frame as a PNG file to screenshots in the data directory (~/.local/share/coastline/screenshots), named by the time it was taken. F9 works where the desktop takes Print Screen for its own screenshots, as Plasma does. V switches between waiting for the vertical blank and presenting at once on every screen, except while a screen takes typed text, and saves the choice to VSync. From mailbox, V presents at once. Ctrl+U toggles an unlocked frame rate, temporarily bypassing VSync and the software frame limit. Toggling back restores the configured presentation mode and frame limit. The choice is saved as UnlockedFramerate. Setup starts with independent rendering and default pacing, preserving window and graphics-device selection. Ctrl+U can still toggle unlocked pacing during setup.
Statistics separate CPU WORK (frame work excluding presentation waits and the software limiter) from INTERVAL (measured time between frames, including pacing, displayed to four decimal places). CPU work is CPU-side elapsed time, not GPU execution time. FPS remains the measured frame rate.
Single-F FPS retains the PC counter's gradient and size, rendered at internal resolution and affected by scaling and screen shaders. Full statistics draw at output resolution after scaling and screen shaders, adapting to window display scaling. Statistics can use the full window, including aspect-ratio bars. Disabling statistics releases their output texture. Screenshots with statistics include the full output at window resolution.
Auto-save race progress in Options saves championship progress, records, and improved Time Attack ghosts after each completed race. Autosave is on by default (AutoSave=1 under [Game] in BossRally.ini). Championship saves resume at the next round. Automatic saves replace the primary season and ghost saves. The option takes effect immediately; manual saving remains available with autosave off. Preferences save independently of race progress. Failed automatic saves display a warning on the results screen.
Until Units is changed, --region jpn and --region eur select KPH, and --region usa selects MPH. Without an explicit region, system locales for MPH jurisdictions use MPH and other country locales use KPH. MPH country codes are AG, AI, AS, BS, BZ, DM, FK, FM, GB, GD, GG, GU, IM, IO, JE, KN, KY, LC, MH, MP, MS, PR, PW, SH, TC, US, VC, VG, and VI. Liberia defaults to KPH. If the locale has no country, MPH is the fallback. Changing Units records Units=mph or Units=kph under [Game] and overrides automatic selection on subsequent launches. Existing settings without a valid Units preference use automatic selection. Explicitly loading an options note saves its units as a manual choice. Set Units=auto to restore automatic selection.
Paint Shop supports Milk Truck, Cupra, Helmet, and Beach Ball. Cupra, Helmet, and Beach Ball use numbered texture buttons in place of body-panel buttons. Tall textures shrink to fit the canvas. Painting preserves the imported image beneath the decal; clearing the decal restores the image with the current body tint. Bonus-car decals save beneath controller-pak/custom-decals in the save directory, independently of the console Controller Pak capacity. Console decal notes retain their native format when imported from or exported to a Controller Pak image.
The Title screen option selects the Japanese or international opening independently of language and regional models and textures. [Game] TitleScreen accepts regional (default), japanese, or international. Changing the title reinitialises the game after Options closes and returns to the logos. Alternate titles require corresponding imported ROM assets. The menu offers available titles and marks a saved title as missing if its assets are absent. If the requested title cannot load, the game logs a warning and uses the selected model region's opening. Asset-pack overrides also apply to the chosen intro. An explicit --region overrides the saved title choice for that run and locks Title screen in Options to the active region's opening after fallback.
The Music option selects native N64 XM modules or PC CD audio (Music=XM or Music=CD under [Game]). The selection applies as Options closes. CD selection also plays the PC menu track in the front end. The BGM volume controls both sources. Missing CD audio falls back to XM with a warning. F12 advances the selected source's tracks; restarting a race retains a manually selected XM module. PlayMusic=0 silences music in menus and races while sound effects remain independent.
Sound effects selects PC or N64 samples (SoundEffects=PC or SoundEffects=N64 under [Game], with PC as the default). New installs use volume 4/10 for PC or 10/10 for N64 until the SFX volume is adjusted. A manual volume persists across sample changes and restarts as SfxVolume=0 through SfxVolume=10 under [Game]; SfxVolume=auto restores the source-dependent default. Changing samples reinitialises the game after Options closes and returns to the logos. Race sounds use the selected pack's converted WAV files. N64 samples retain their duration and match the RMS level of their PC counterparts, limited to 98% peak amplitude. Missing N64 samples fall back to PC with a warning; PC taunts are silent in N64 mode. Menu navigation and adjustments use their distinct native sounds with either race sound source. Intro sounds remain specific to the selected title. PlaySFX=0 silences menu feedback, intro sounds, and race sound effects independently of music.
Each player's selected race camera persists across races and application restarts. [Player1] and [Player2] store Camera as 0 (cockpit), 1 (chase), 2 (bumper), or 3 (trackside). Replays and automatic finish cameras preserve the player's selection.
Setting BGM or SFX volume to zero suspends processing for the corresponding category. BGM stops XM sequencing and mixing or pauses CD playback and FLAC decoding. SFX pauses native mixing and EAR playback updates. Raising a volume resumes its category independently; setting both to zero also pauses the native audio device.
Visual effects selects PC or N64 rendering (Effects=PC or Effects=N64 under [Game], with PC as the default). The selection applies as Options closes. N64 effects use the imported smoke and wheel-spray PNGs, with ordered opacity and depth writes for particles. Persistent skid marks appear only in PC mode, as in the original releases. Particle motion follows the race simulation in both modes. Import ROM images again to add the effect PNGs to older asset directories; missing images produce a warning and use PC effects.
Window reflections selects the original PC projection or N64 angular reflection mapping. WindowReflections=auto under [Game] follows Visual effects by default; PC and N64 override the mapping independently. Changes apply as Options closes. Both versions use the same reflection images and switch to the night image inside tunnels; their generated texture coordinates differ.
--gpu auto|high-performance|low-power overrides GpuPreference for one run. Automatic selection retains SDL's default preference for a dedicated GPU. Low-power selection prefers an integrated GPU when available. The log records the actual adapter, backend, driver, and preference. NVML loads only for an identified NVIDIA adapter and samples only a unique matching device. Non-NVIDIA and unknown adapters omit NVML utilization statistics; game memory counters remain.
The [Video] section of BossRally.ini sets up the display.
Options offers persistent Preset choices. Selecting a preset saves its settings in BossRally.ini; subsequent manual graphics adjustments select Custom. N64 and Boss Rally select their respective music and sound effects; other presets preserve both audio choices. Language and region remain independent. N64 and Boss Rally select 4:3; Ultra fills the screen. Worst and Low power preserve the aspect ratio.
| Preset | Minimum internal resolution | Filtering and effects | Screen shader | Frame limit |
|---|---|---|---|---|
| N64 | 320x240 | N64 filtering, console effects, original branding, and no anti-aliasing | Consumer CRT | 30 FPS |
| Boss Rally | 640x480 | Bilinear PC textures, PC effects, and Pure PC branding | PC CRT | 60 FPS |
| Ultra | Window size | Modern filtering, 8x anti-aliasing, 16x anisotropic filtering, and 2x draw distance | Off | Display refresh |
| Worst | 320x240 | Nearest textures and scaling, no anti-aliasing, and 1x draw distance | Off | 30 FPS |
| Low power | 640x480 | Modern textures, 2x anti-aliasing, 2x anisotropic filtering, and 1x draw distance | Off | 60 FPS |
Preset changes apply after exiting Options. Asset-pack, renderer, or frame-limit changes restart the game at the logos; other preset adjustments apply during the black transition screen. --preset n64 and --preset br select the corresponding look for one run without saving the preset. Explicit asset-pack and display arguments override the preset.
N64 and Boss Rally use 100% field of view and 1x draw distance. Anti-aliasing, anisotropic filtering, post-process anti-aliasing, and upscaling are off. Boss Rally uses Modern texture filtering without mipmaps, matching the original bilinear filtering. Both presets preserve the title screen, auto-save, and region for models and textures. N64 selects N64 window reflections, and Boss Rally selects PC window reflections.
--preset ultra fills the screen at window resolution with 2x draw distance, 100% field of view, 8-sample anti-aliasing, alpha to coverage, 16-sample anisotropic filtering, modern texture filtering, and PC visual effects. Upscaling, post-process anti-aliasing, and screen shaders are off. Ultra preserves the title screen, auto-save, sound effects, music, models and textures, and asset pack. Ultra uses wide menu backgrounds only while the internal frame is 16:9. Other aspect ratios use the normal menu background framing. WideMenus=auto under [Video] selects this behaviour; 1 fills all wide frames, and 0 disables wide menus. Ultra uses borderless full screen unless overridden. --preset worst uses 1x draw distance, nearest scaling and texture filtering, no anti-aliasing or screen filters, and a 320 by 240 base frame at 30 FPS. Worst preserves the aspect ratio and does not change GPU preference. --preset low-power requests SDL's lower-power adapter, when available, and uses the moderate settings above. Other explicit display arguments still apply. Unique choice prefixes are accepted, such as n, u, and l; ambiguous prefixes produce an argument error.
CLI overrides disable matching Options entries and grey their coins. Their labels show the active override, and the temporary values are not saved. For example, --aspect-ratio 4:3 disables only Aspect ratio, while --preset n64 disables all settings controlled by the preset. GPU preference changes recreate the GPU device and restart the game after Options closes.
| Key | Values |
|---|---|
| Fullscreen | 1 for the full screen, or 0 for a resizable window. Alt+Enter and F11 save their choice here. |
| FullscreenMode | borderless, the default, covers the display at its desktop mode. exclusive switches the display to Width by Height at RefreshRate. |
| RefreshRate | The refresh rate of the exclusive mode in hertz, or 0 for the rate of the desktop. |
| VSync | vsync or 1 waits for the vertical blank. mailbox presents without tearing and without waiting, and immediate or 0 presents at once. V saves its choice here. |
| GpuDriver | The GPU driver of SDL, vulkan, metal, or direct3d12, or empty, the default, for the driver SDL chooses. |
| GpuPreference | auto (default), high-performance, or low-power. --gpu overrides the setting for one run. |
| UnlockedFramerate | 1 bypasses presentation pacing and FrameRateLimit; 0 restores configured pacing. Ctrl+U toggles and saves this choice. |
| FrameRateLimit | The most frames drawn each second, or 0 for no limit. |
| InternalWidth | The width of the frame the game draws in pixels, or 0, the default, for the width of the window. |
| InternalHeight | The height of the frame the game draws in pixels, or 0, the default, for the height of the window. |
| RenderScale | The pixels of the frame for each pixel of the window, from 0.25 to 4, when the frame follows the window. The default is 1. |
| ScaleFilter | linear, the default, or nearest, how the frame is scaled to the window. |
| AspectRatio | auto, the default, for the shape of the window, or a shape the frame keeps in a window and in the full screen with bars around it: a ratio such as 4:3 or 16:10, or a number such as 1.6. --aspect-ratio sets it for one run. |
| FieldOfView | The multiplier of the field of view of a race, 1 for that of the PC release. |
| DrawDistance | The race draw-distance multiplier, from 1 (default) to 4, also applied to split views and mirrors. The Options menu offers 1x, 1.5x, 2x, 3x, and 4x. Applies as Options closes. |
| Antialias | The samples of each pixel the scene is drawn with, 2, 4, or 8 for multisample anti-aliasing, or 1, the default, for none. |
| AlphaToCoverage | 1, the default, smooths the edges of the cut texels of trees and fences by the share of the samples of a pixel their alpha covers, with Antialias above 1. 0 cuts them. |
| TextureFilter | modern, the default, filters textures bilinearly as the PC release does. n64 filters three texels as the RDP of the Nintendo 64 does. nearest takes the nearest texel for a blocky look, the menus and the HUD included. |
| AnisotropicFiltering | 2, 4, 8, or 16 mipmaps the textures of the tracks and the cars and filters them with that many samples, with the modern filter. 0, the default, does neither. |
| AntialiasPost | fxaa blends the finished frame along the edges it finds with fast approximate anti-aliasing. none, the default, does not. |
By default the frame follows the size of the window in pixels, and changes with it as the window is resized or covers the display. Options lists explicit internal resolutions from 320x240 through the highest resolution reported by connected displays, plus a default Window size choice. The list includes common intermediate sizes and reported display modes, with each size listed once. Selecting a resolution resets RenderScale to 1 and applies as Options closes. InternalWidth and InternalHeight set a size of their own, which takes the place of the size of the window and of RenderScale, and the frame is scaled to the window with bars where its shape differs. Width and Height set the size of the window and of the exclusive mode. A script that saves frames draws them at Width by Height times RenderScale, for the same captures on every machine. A RenderScale of 2 draws four pixels for each pixel of the window and filters them down, which is supersampling.
The frame passes through the anti-aliasing of AntialiasPost and then the scale of ScaleFilter on its way to the window.
Options also offers edge-adaptive upscaling and four screen shaders. Set ScaleFilter to edge-adaptive to reconstruct detail along detected edges when enlarging a lower internal resolution. Set ScreenShader to consumer-crt, pvm, aperture-grille, or pc-crt for CRT simulation, or none (default) to disable screen shaders. Consumer CRT adds curved corners, softer pixels, and a staggered phosphor mask. PVM has stronger scanlines and a finer mask. Aperture grille has a flat image and vertical RGB stripes. Scanlines fade near native resolution to reduce aliasing. PC CRT simulates a sharper progressive VGA monitor with a fine staggered shadow mask, faint scanlines, and mild curvature. Both settings apply as Options closes. Screenshots include enabled presentation filters at the displayed resolution.
For a 1990s consumer CRT look, choose 320x240 internal resolution, Upscaling Off, and Consumer CRT. Upscaling Off uses nearest-neighbour enlargement (ScaleFilter=nearest) without smoothing or edge reconstruction. The CRT shader still applies its softness, scanlines, curvature, and phosphor mask.
Aspect ratio defaults to Fill screen (AspectRatio=auto), matching the current window or display. Options also offers 4:3, 16:9, 21:9, and 32:9. A selected internal resolution supplies minimum dimensions; the frame expands across or down to match the ratio, with at least 320x240 pixels. For example, 320x240 becomes 427x240 at 16:9, 560x240 at 21:9, or 854x240 at 32:9. Fill screen recalculates the dimensions when the window changes size. Explicit ratios display bars when the window has another shape. Changes apply as Options closes.
A race keeps the vertical field of view of the PC release on a frame wider than 4:3 and widens across, and keeps the field across of 4:3 on a narrower frame. Neither field exceeds 120 degrees. The rear-view mirror keeps its shape and its size against the height of the view. The menus keep their 4:3 layout in the middle of the frame, with bars at the sides or at the top and bottom.
A mode of VSync the GPU driver does not support falls back to the other mode that does not wait, then to vsync. --no-vsync selects immediate. Under Wayland, vsync presents to the mailbox and paces the frames at the refresh rate of the display, as waiting for the vertical blank there drops frames on some drivers. fifo waits for the vertical blank under Wayland too. The races run at 30 steps a second and draw between the steps, and the menus move by the time between frames, at any frame rate.
The music of the cartridge's XM modules is scaled against the sound effects by the gain of the asset pack, 1.5 in the default pack and 1 for the level of the console. XmMusicGain in the [Game] section replaces the gain of the pack when the user adds it. The music clips rather than wrapping when the gain raises it past the range of a sample.
Starting the game without usable assets opens an in-game setup wizard. The wizard locates a Boss Rally BIN, CUE sheet, or ISO and at least one Top Gear Rally ROM image on a single Files screen. Three interchangeable ROM fields detect each release by SHA-1. Search directory for assets scans subfolders and displays discovered images during the search. Finish starts the intro in the same window.
The search includes hidden files and folders, skips . and .., and does not follow directory symlinks. ZIP archives are searched for ROM images, including entries in subfolders. Stored and deflated entries are checked by CRC and ROM SHA-1; valid ROMs are extracted to asset-search in the user cache. Encrypted, corrupt, oversized, and unsupported archive entries are skipped.
Before user assets, the game searches the installation data directory, including relocated bin/../share/coastline, /usr/local/share/coastline, and /usr/share/coastline on Unix. macOS also searches bundle resources and /Library/Application Support/Coastline. MSYS2 and Windows use the data directory relative to the executable and the configured installation prefix. The fallback is the user's data directory, such as ~/.local/share/coastline on Linux or ~/Library/Application Support/Coastline/data on macOS. Every data root uses assets/default and sibling asset packs. System packs take priority; a user mod can layer over system defaults in the user cache. Configurations, saves, screenshots, and cache remain in user directories. --data-dir explicitly selects a data root and bypasses system asset lookup.
Paths can be browsed, typed, or pasted, and an initial ~ expands to the home directory. Every field has a Clear button. Ctrl+A selects all text, Ctrl+V pastes, and Alt+Backspace deletes a word.
coastline --reset removes generated asset packs (default, boss, eur, and jpn) and asset caches before starting setup again. Saves, decals, settings, and custom asset packs are preserved. With --data-dir, reset clears generated packs in the selected data directory.
coastline --factory-reset deletes all Coastline configuration, imported assets, mods, saved games, decals, cache, and state before starting again. Both reset options request terminal confirmation with y or n, without case sensitivity. Add --yes-really or -y to skip confirmation.
--config INI reads and saves settings in the specified INI file instead of the default BossRally.ini. Relative paths resolve from the launch directory. Data, cache, state, and controller bindings use their normal directories. Combining --factory-reset with --config also deletes the specified INI file.
Cancel stops the import and returns to the first step. Setup replaces the generated packs default, boss, eur, and jpn, preserving mod packs and saved games.
Import generates simplified menu models for Race Track and Bonus Track, shared with their mirrors, as tracks/race-menu.gltf and tracks/bonus-menu.gltf. Re-import older packs to generate menu models. The conversion closes convex planar openings and adds sides beneath exposed terrain edges.
The data comes from a Boss Rally disc image and a Top Gear Rally cartridge image. The import checks the cartridge against the SHA-1 of each release, and converts the CD audio of a CUE sheet to FLAC. An ISO image has no CD audio. The import writes converted packs under assets in the data directory, and exits. The import subcommand takes the disc with --cd, a CUE sheet (.cue), an ISO image (.iso), a BIN image (.bin), CloneCD metadata (.ccd with its .img), Alcohol metadata (.mds with its .mdf files), a Nero image (.nrg), a DiscJuggler image (.cdi), or BlindWrite metadata (.bwt/.b5t/.b6t with its image files), and a ROM image with each --rom. A BIN first uses an adjacent CUE sheet with the same basename, ignoring case, or another adjacent sheet referencing the BIN. Without a CUE sheet, its whole-file SHA-1 selects the track offsets of a verified dump when available. Otherwise, sector sync and headers locate the data boundary, checked against the ISO volume size, and runs of digital silence identify audio pregaps. The verified 13-track Boss Rally BIN has SHA-1 391609a19eaa44cf470c0b8b2110122381a87f25; its CUE sheet is identified by track layout, without a CUE SHA-1. Audio discovery requires all 12 music tracks and sufficient track lengths; uncertain layouts import data only. A complete set of Track NN.bin files also imports without a CUE sheet. CloneCD uses its track metadata; .sub data is not required. Nero supports both 32-bit and 64-bit track metadata, recorded disc-at-once or track-at-once. Alcohol supports split image files and UTF-16 filenames. Both formats preserve track boundaries and exclude pregaps; interleaved subchannel bytes are discarded during conversion. DiscJuggler supports versions 2, 3, and 3.5, stored pregaps, multiple sessions, and variable-length index and CD-TEXT metadata. Its P-Q and P-W subchannels are discarded during conversion. BlindWrite 5/6 supports split images, UTF-16 filenames, multiple sessions, stored pregaps, and interleaved subchannels. Selecting .b5i or .b6i resolves the matching metadata file. BlindWrite 4 uses .bwt metadata with .bwi data files. It supports separate track files and stored pregaps; .bws subchannels are optional. Selecting .bwi or .bws resolves matching .bwt metadata. Filenames resolve as UTF-8 or Windows-1252. Unencrypted ISZ images support zero-filled, uncompressed, zlib, and bzip2 chunks, split segments, and checksums. Decoding uses temporary storage until import finishes. ISO payloads provide data; raw-sector payloads also use BIN track discovery for CD music. Pinnacle InstantCopy PDI images support cooked data or raw data and audio, including scrambled data and interleaved subchannels. PDI decoding requires temporary disk space for the headerless image.
The --cd option also accepts a directory, including a mounted physical disc or a copy of its files. Select the disc root with BossRally.pod directly inside it. In setup, enter its path or browse into the disc and select Use this directory. Recursive asset search also detects disc directories. Mounted directories provide data files without CD audio; use CUE/BIN for CD music.
Import validates required disc files before conversion and publishes generated packs after every conversion succeeds. A completed inventory records file sizes, a file count, and an inventory checksum. Startup rejects incomplete inventories and missing or truncated imported files, and offers re-import or quit before loading game assets.
CD audio encoding and independent regional ROM conversions use up to four worker threads, limited by available CPU concurrency. Cancellation stops pending work and waits for active conversions before discarding staging files.
Supply the disc and every ROM image in the same command. A successful import replaces generated packs (default, boss, eur, and jpn) and preserves mod packs. Failed or cancelled conversions preserve the previous assets. USA is the base when supplied; otherwise the first ROM is the base. assets/default/pack.json records the base in baseRegion. Every import creates default and boss. Additional cartridges produce eur and jpn packs with only differences from the base. Cartridge assets use n64/base within each pack. Fonts and strings from every imported language remain available in default independently of the selected region.
The saves of the game are the notes of a Controller Pak, a file for each note in controller-pak of the data directory (~/.local/share/coastline/controller-pak), with the frames of the ghost car in ghost-frames.bin beside it. The note of the options menu, TOP GEAR OPTIONS, is a setting and is stored in controller-pak of the configuration directory (~/.config/coastline/controller-pak), and the pak counts it with the other notes. Internal note files and ghost-pose sidecars have a versioned integrity header, payload length, and checksum. Header and payload are replaced atomically under a process lock. Loading a damaged save attempts to remove the invalid file and uses defaults. Controller Pak capacity counts native note bytes, excluding the integrity header. Prerelease save formats are not migrated. export-pak writes them to a Controller Pak image (.mpk) for a console or an emulator, with the codes of the release --release chooses: usa (the default), eur, or jpn. Each release reads only the notes with its own codes.
import-pak reads the notes of any release from an image.
Each import records conversion versions in assets/default/import.ini and the paths and sizes of generated files in assets/default/import-files.txt. Missing files, different sizes, old conversion versions, an unsupported layout, or an incomplete import prevent the game from starting and report the import command. Import old assets again.
Region in [Game] selects usa, eur, or jpn, defaulting to the imported base. --region selects a region for a single run. An unavailable region falls back to the base. Assets are layered in the order default, the regional difference pack, and the selected AssetPack (boss or a mod). Each optional pack falls back directly to default; packs do not declare inherited packs.
Language in the [Game] section selects the language of the text, en-us, the default, en-gb, or ja. --language selects one for a single run. The game reads the strings of the language from strings/LANGUAGE.json in the assets, and takes the string of strings/en-us.json for each key the language lacks. The text draws with the font of the cartridge of the language, the European release for en-gb, the Japanese release for ja, and the USA release for en-us, or the base fonts when the cartridge of the language was not imported. Region selects splash screens, menu models, and textures independently of Language.
The disc import writes the strings of BRString.dll to strings/en-us.json, each under the key the table of src/sdl/consolestrings.cpp gives its number, and the race of the game reads a string by its number through the same table. A message the PC and the Nintendo 64 releases draw in the same place with the same text has one race. key, written by the disc and by the cartridges, and a string of the PC release alone has a pc. key.
The import of a cartridge writes the text of the messages of its menus and its race to the file of its language: the USA release to strings/en-us.json, the European release to strings/en-gb.json, and the Japanese release to strings/ja.json. A message has the same key in every file, such as n64.carSelect.rumblePakNote, and the table of src/sdl/consolestrings.cpp lists the address of each line of the message in each release. A release draws the lines of a message one under the other, and the import joins them with a newline. Each release has its own lines, and a message of one release alone is only in the file of that release. The game saves to a folder, and the import of the USA cartridge writes the messages that name the save folder in place of the Controller Pak to strings/en-us.json under sdl. keys, and every language reads them there. The import of the Japanese cartridge also writes the kana and kanji of its font to fonts/jpn/japanese.png. Every file of strings is UTF-8.
The Japanese release has Japanese text only in the messages of the Controller Pak, the Rumble Pak, the paint shop, and the second controller. Its menus, its races, and its titles are in English, and its speed reads Mile/h and Km/h. With ja, the races draw the English strings and the speed units of the Japanese cartridge, and the car selection shows the Japanese note of the Rumble Pak. The European release has the English text of the USA release, with the messages of its save to the Game Pak and a few lines of its own.
Import deduplicates generated asset files. asset-aliases.txt records paths that share another file, and the game recreates alias paths in its cache before applying packs. Mod packs use normal files and directories; they do not need alias tables. After import, empty subdirectories are removed from generated packs. On Unix, existing read and execute permissions are preserved and all write bits are cleared; Windows files receive the read-only attribute. Reset and re-import handle protected packs automatically. Mod packs retain their permissions.
The game draws the images of the PC release, except where the PC release removed the branding of Nintendo, Top Gear, or Kemco. There, the default pack has the image of the cartridge, such as the NINTENDO and TOP GEAR RALLY decals of the cars, the Kemco livery of the Japanese car pj, the TOP GEAR RALLY banners of the desert, and the Nintendo banners of the season winner scene. The import lists these images in src/sdl/data/branded-textures.json, and moves each PC image it replaces to the pack boss in assets. A data directory imported before the packs existed takes them once the disc and the cartridges are imported again.
AssetPack in the [Game] section selects the pack, default or boss for the images of the PC release, and --asset-pack NAME selects one for a single run. A mod pack is a directory of its own in assets, selected by its directory name. A file of the selected pack replaces the file of the same path in assets/default, and every other file is read from assets/default. The game links the files of both packs into assets/NAME in the cache directory on each start.
Models may use separate .gltf, buffer, and PNG files or a single .glb with embedded buffers and PNG images. A reference to model.gltf also finds model.glb. When both formats exist for the same model in a pack, .gltf takes precedence; an invalid .gltf reports an error. A model in the selected pack replaces the default model regardless of format. Paint-shop models retain their coastlineModel and coastlinePaint extras when consolidated.
A pack may have a pack.json of settings. Each key of the selected pack replaces the key of assets/default/pack.json, which the import writes.
version is the version of the file, 1. xmMusicGain is the gain of the music of the XM modules.
A pack can replace regional splash screens with an ordered intro array. Pure PC uses the converted Boss Rally movie, followed by its legal image, then the main menu. Other packs retain regional splash screens when intro is absent. An empty array opens the menu immediately.
Each entry has a type (image, video, or model) and a file relative to prepared assets. Image and model entries have a positive duration in seconds (default 2, maximum 3600). Video entries play to their end unless a positive duration limits playback. skippable defaults to true; a skip button advances to the next entry. Static model entries accept scale in (0, 1000] (default 0.03125) and depth in [-100000, -1) (default -50). Missing media and unsupported videos are skipped.
During a movie, Left and Right seek backward and forward by videoControls.seekSeconds (default 2, positive and at most 3600). Space pauses or resumes playback. A paused movie is dimmed to greyscale with a central pause symbol. Shift+Left restarts the current movie. videoControls.progressBar enables the bottom progress bar (default true). progressTop and progressBottom specify its RGB gradient, yellow to red by default.
introOnce plays the sequence once per game restart (default false). mainMenuTitle replaces the main-menu heading (default TOP GEAR RALLY). mainMenuIdleSeconds sets its inactivity timeout from 0 through 3600 seconds, with 0 disabling the timeout (default 20). mainMenuAttractDemo starts a demonstration directly after the timeout (default false), returning to the menu afterwards. Pure PC uses the settings above. N64 packs return to the title sequence after 20 seconds; an attract demo can follow from the title sequence.
COASTLINE_VIDEO=ON enables intro movie playback; OFF excludes it. Linux uses libav for playback and for converting the original Indeo movie to H.264/AAC MP4. With vcpkg, select manifest features sdl;video to build libav and OpenH264. macOS and Windows play MP4 through AVFoundation and Media Foundation without linking libav. During import, these systems use FFmpeg from PATH, or download a temporary copy and delete it afterwards. Windows uses Gyan builds; Apple Silicon uses OSXExperts, and Intel macOS uses Evermeet. Downloaded tools use FFmpeg 9.0.2 from versioned URLs and pinned archive SHA-256 checksums.
coastline --help lists the options and the subcommands, and coastline SUBCOMMAND --help lists the options of a subcommand. Without a subcommand the game starts. The options of the game come before the subcommand. --debug logs the debug messages of every category, and --debug-gpu checks the use of the GPU with the validation layers of Vulkan when they are installed.
run-script starts the game at the splash screens, driven by scripted input, for unattended checks. With no filename, or with -, the command reads standard input and waits for EOF before starting. Use coastline run-script < check.txt to redirect a file, or finish interactive input with Ctrl-D on Unix or Ctrl-Z followed by Enter on Windows. Each line is a command, # starts a comment, and a blank line is ignored. A line that starts with a frame number, from 1, acts at that frame. These are the commands:
The frames save to screenshots in the data directory as frame-NNNNNN.png, by the number of the frame. A script that saves frames draws them at Width by Height and steps the splash screens by a 60th of a second a frame, for the same captures on every machine. A line that cannot be read stops the game before it opens a window, with the file and the line logged.
--minimized exists only in debug builds.
The tests under tests/ build the reconstructed C for the host with the host compiler and check it against the branches and command words of the disassembly.
The test of zlib inflates the assets extracted from a cartridge image and compares them with the extractor's output. It runs only when TGR_TEST_ASSETS names the asset directory of a build.
The offsets of the structures the assembly reads depend on the 32-bit pointers of the console, so tests/layout.c is compiled by the cross compiler as part of each Nintendo 64 build, where a wrong offset fails the build.