|
coastline 0.0.4
|
Classes | |
| struct | AssetFileAlias |
| A logical file backed by a physical file in the same pack or the default pack. More... | |
| struct | AssetStorageSavings |
| The number and total byte size of files removed from freshly converted generated packs. More... | |
| class | GameConfig |
| The settings of BossRally.ini. More... | |
| class | ConfigSaver |
| Writes copies of the configuration on a thread, away from the frames. More... | |
| class | ConsoleSegment |
| The main segment of a release, as the console loads it. More... | |
| struct | ConsoleString |
| A message of the Nintendo 64 releases. More... | |
| struct | SaveFolderString |
| A message of the menus in English that the game words differently from the console. More... | |
| struct | ControllerState |
| The state of one controller port, as libultra reports a pad. More... | |
| struct | PakNote |
| A note of a Controller Pak. More... | |
| class | ControllerPak |
| The notes of a Controller Pak, stored in a directory, with the settings note in another. More... | |
| struct | ControlPreset |
| A set of bindings of every action, in the syntax of the Controls section. More... | |
| struct | ControlSource |
| A button or the half of an axis of a gamepad that drives an action. More... | |
| class | ControlBindings |
| Configured action sources, player devices, and stick dead zone for an input owner. More... | |
| struct | DecalTexture |
| The byte offsets and dimensions of an indexed model texture or numbered paint layer. More... | |
| class | DecalCar |
| Editable console body materials or numbered image layers for an imported car. More... | |
| struct | DecodedDisc |
| A decoded disc image whose temporary files remain available through shared storage. More... | |
| class | DiscordPresence |
| Optional Discord Rich Presence through the local desktop client's IPC endpoint. More... | |
| class | DiscTrackReader |
| Read bounded sectors across the ordered parts of a disc track. More... | |
| struct | EngineTexture |
| A texture of the race engine, as 8-bit RGBA texels. More... | |
| class | EngineTextures |
| Decoded textures for one active race engine. More... | |
| struct | BrowserEntry |
| An entry of a listing of the file browser. More... | |
| struct | WizardImport |
| The files an import of the wizard reads. More... | |
| struct | WizardServices |
| The routines the wizard calls to check and import its files. More... | |
| struct | WizardSearchResult |
| The images found during a directory search, indexed by detected release. More... | |
| struct | WizardEvent |
| An event of the keyboard or the mouse. More... | |
| struct | WizardControl |
| A control positioned on the grid. More... | |
| class | SetupWizard |
| Manage setup screens, their controls and focus, the file browser, and the import. More... | |
| class | TextFont |
| The texture of the 256 glyphs of the font and of the mouse pointer. More... | |
| struct | TextCell |
| A cell of the grid. More... | |
| class | TextGrid |
| The cells of the screen and the place of the text cursor. More... | |
| struct | SetupRun |
| How a run of the setup wizard ended. More... | |
| class | FlacTrack |
| Decode imported FLAC tracks into stereo PCM without discarding block remainders. More... | |
| class | FreeCamera |
| A movable camera relative to the normal eye space of menus and logos. More... | |
| struct | StageVertex |
| A vertex of a shaded triangle of a stage: its place and its colour. More... | |
| struct | ScreenFade |
| The fade of the screen: a wipe whose level goes to its target at a rate, and the edges of the picture it shows, in pixels of the 320 by 240 screen. More... | |
| class | GameModeSession |
| Optional Linux GameMode registration for the lifetime of an interactive game process. More... | |
| class | GameSettings |
| Persistent game choices for the options menu. More... | |
| struct | GltfDocument |
| A glTF or GLB document with buffers joined and buffer-view offsets adjusted. More... | |
| struct | DisplayOptions |
| The options of the window and the GPU device. More... | |
| class | GpuWindow |
| The window of the game and the GPU device that draws into it. More... | |
| struct | IconEntry |
| One image of an icon file. More... | |
| struct | IconPixels |
| An image of an icon as 8-bit RGBA texels. More... | |
| struct | IconSize |
| The size of an image of the icon of the game, from the name of its PNG file. More... | |
| struct | UsaMusicModule |
| A music module of the USA cartridge and its name in a music pack. More... | |
| struct | DiscTrackExtent |
| A contiguous part of a disc track, excluding its pregap. More... | |
| struct | CueTrack |
| One disc track with stored sector sizes and logical track boundaries. More... | |
| struct | PlayerDevices |
| The devices that drive one player. More... | |
| class | InputBindings |
| Open every gamepad in the order it connects, and drive the first two ports with the devices the Player1 and Player2 keys of the Controls section choose. More... | |
| struct | IntroButtons |
| The buttons of the first controller that act on the splash screens. More... | |
| class | Intro |
| The regional splash screens, drawn with converted models or the Japanese title image. More... | |
| class | IntroSequence |
| An ordered asset-pack sequence of images, movies, and static models. More... | |
| class | GameLog |
| Forward SDL messages to a file and the previous callback until destruction. More... | |
| struct | MenuProfile |
| The parts of the profile of a player of the console the menus read, as InitPlayerProfileDefaults() of the console sets them. More... | |
| struct | MenuOptions |
| The settings of the options menu, as OptionSettings of the console. More... | |
| struct | MenuSeason |
| A season of the championship, as g_SeasonTable of the console records it. More... | |
| struct | MenuCar |
| A car the players can choose, as g_aCarModels of the console records it. More... | |
| struct | StageMesh |
| The shaded triangles of a display list of the stage of the cars. More... | |
| struct | CarSelectPlayer |
| The choices of a player on the car select screen, the per-player state of the console. More... | |
| class | Menus |
| The menus, drawn with the import of a release. More... | |
| struct | MenuButtons |
| The presses of a controller that act on a menu, each true on the frame it starts. More... | |
| struct | MenuItem |
| An item of a menu screen. More... | |
| struct | MenuSetup |
| What a frame of a screen shows, the arguments of ProcessScreenState(). More... | |
| struct | MenuTitleImage |
| A picture over the title of a screen, and its rectangle on the 320 by 240 screen. More... | |
| class | MenuScreen |
| The state and the assets of the menu screens, read once from the import of a release. More... | |
| struct | TextStyle |
| How a string of the menus is drawn. More... | |
| class | MenuText |
| The two fonts of the menus, their gradients, and the layout of their glyphs. More... | |
| class | MipsCpu |
| The VR4300 processor and the RDRAM it runs from. More... | |
| class | N64MixerContext |
| Mixer channels, XM storage, and synchronisation for one SDL audio session. More... | |
| class | N64Audio |
| The XM player and sample mixers of the Nintendo 64 release, streamed as native stereo PCM. More... | |
| class | N64MixerLock |
| A lock of the mixers and the music player of the console against the audio thread that mixes them, for the life of the object. More... | |
| struct | N64DemoFrame |
| The first vehicle of the demo after a step of its race. More... | |
| struct | N64Demo |
| The recorded demo. More... | |
| struct | GltfImage |
| A texture of a glTF document, as the RDP samples it. More... | |
| struct | GltfModel |
| A glTF document, the bytes of its one buffer, and its images. More... | |
| struct | PaintShopInput |
| The input of the player of the paint shop for a frame. More... | |
| struct | PaintRect |
| A rectangle of the 640 by 480 screen, ScreenRect of the console. More... | |
| struct | PaintSprite |
| A picture of the paint shop, Sprite of the console. More... | |
| struct | PaintSwatch |
| A colour of the palette of the decals and its swatch, PaletteSwatch of the console. More... | |
| struct | PaintGlyph |
| A key of the keyboard of the text tool and its glyph, DecalGlyph of the console. More... | |
| struct | PaintVector |
| A direction of the console. More... | |
| class | PaintShop |
| The paint shop of the console. More... | |
| struct | GamePaths |
| The directories the game reads and writes, each ending in the application directory. More... | |
| class | FrameTimings |
| One-second timing averages and worst values since collection began. More... | |
| class | PerformanceStats |
| Frame timings and system statistics, with memory and GPU sampling on a separate thread. More... | |
| class | Ptr32Memory |
| Writable memory within signed 32-bit offsets of g_abPtr32Anchor for converted asset pointers. More... | |
| class | ConsoleCredits |
| Captions and scrolling credits for one attract-demo controller. More... | |
| class | AttractDemo |
| Attract-demo rotation for one front end. More... | |
| class | RaceInputContext |
| Input history and haptic resources for one active input configuration. More... | |
| class | RaceMusicContext |
| Race music resources for one active audio session, destroyed before its shared menu player. More... | |
| class | FrontEndMusic |
| Front-end music with independent CD resources and the shared native XM player. More... | |
| struct | RacePlayerSetup |
| The car and the setup of a player. More... | |
| struct | RaceSetup |
| What a race is, in the terms of the race engine. More... | |
| struct | RacePlayerResult |
| How a player finished a race. More... | |
| struct | RaceResults |
| The results of a race, as the race engine records them. More... | |
| class | RaceSession |
| Race progress and results for one front end. More... | |
| struct | RaceCar |
| The car of a vehicle of a race. More... | |
| class | RaceView |
| The models of the track and the cars of a race, and their drawing from the state of the race. More... | |
| struct | ScriptPress |
| A press of the buttons of a controller from a frame for a number of frames. More... | |
| struct | ScriptMouse |
| The mouse at a place of the 320 by 240 screen from a frame for a number of frames. More... | |
| struct | ScriptKey |
| A key of the keyboard down from a frame for a number of frames. More... | |
| struct | ScriptTyping |
| A text typed at a frame, or a key of <backspace> or <enter>. More... | |
| struct | Script |
| The input and the captures of a script of run-script. More... | |
| struct | ScriptError |
| A line of a script that cannot be read. More... | |
| class | EngineRuntime |
| Front-end choices and race buffers for one active engine runtime. More... | |
| class | SaveFile |
| An exclusive lock shared by cooperating save writers, released on destruction or process exit. More... | |
| struct | Lighting |
| The lights of a model, an ambient colour and a directional colour from a direction in the space the model is placed in. More... | |
| struct | MorphPose |
| The pose of the vertices of an animated model: two keys and the share of the second. More... | |
| struct | VertexAnimationInfo |
| A vertex animation of a model, as the game plays it. More... | |
| struct | Reflection |
| The reflection of the sky on a car: the image the parts whose texture coordinates come from their normals sample, the axes those coordinates follow, and the column of the image the window starts at, as the tile of the reflection of the race takes it. More... | |
| struct | Highlight |
| The specular highlight of a car, as the PC release generates its coordinates for the tile of gDPSetHilite1Tile(): a quarter of the dot of the normal with each axis across the texture, from the offset of the tile, added to the colour drawn where the depth is equal. More... | |
| struct | Fog |
| The fog of the PC release: each vertex shows the share of its colour of the range by the reciprocal of its w, a share below 8 of 255 none, and the rest is the colour of the fog. More... | |
| struct | CarShadow |
| The shadow of a car on the track, as RenderTrackInstance() lays its texture on the ground under the car: 1024 across the texture, centred under the car, along and across its heading. More... | |
| struct | ImageDamage |
| The damage of an image of a car, as LoadCarPaintTextures() damages the image of a paint set. More... | |
| struct | ModelOptions |
| What of a glTF document a RenderModel takes, and how. More... | |
| class | RenderDocument |
| A glTF document of the import on the GPU, read and decoded once for every RenderModel of its parts: its vertices, its animations, and the images no paint colours. More... | |
| class | RenderModel |
| A converted model on the GPU: its meshes, its parts, and its animations. More... | |
| class | VertexDisplacement |
| How far each vertex of a model is moved on the GPU, such as by the dents of a car. More... | |
| class | RenderTexture |
| A texture of the renderer for flat pictures and text. More... | |
| struct | FlatVertex |
| A corner of a flat quad: its place in the space of the flat draws, its texels, and its colour. More... | |
| class | RenderQuadBuffer |
| Persistent quad slots, updated independently and drawn in a caller-specified order. More... | |
| struct | FlatMaterial |
| How a run of flat quads is coloured: the textures and the colour combiner of the RDP. More... | |
| class | SceneRenderer |
| The renderer of a frame. More... | |
| class | SoundEffects |
| Converted sound selection and per-sample level matching for one game session. More... | |
| class | GameText |
Read the strings of a language and of en-us, each a JSON object of strings by key, from strings/LANGUAGE.json and strings/en-us.json under assets, for the race and the menus. More... | |
| struct | ExtraMenuTrack |
| Additional tracks after the console tracks, before menu actions. More... | |
| class | EngineModels |
| Model relocation, texture lookup, converted vertices, and dents for one race engine. More... | |
| class | VideoPlayer |
| A decoded video and its audio, with bounded frame buffering. More... | |
Typedefs | |
| using | WizardProgress = std::function<bool(const std::string &step, double fraction)> |
| Reports the step of an import and its share done from 0 to 1, and returns false to cancel. | |
| using | WizardSearchProgress |
| Report search progress and return false to cancel. | |
| using | ImportProgress = std::function<bool(const std::string &step, double fraction)> |
| Reports import progress with a description and a fraction from 0 to 1. | |
| using | ImportJob = std::function<std::optional<std::string>(const ImportProgress &)> |
| Independent import work in a private destination directory. | |
| using | StringTable = std::map<std::string, std::string, std::less<>> |
| Strings by key, in UTF-8. | |
| using | NoteEquipmentCounts = std::array<std::size_t, 5> |
| Counts of handling, transmission, tyre, suspension, and controller-layout choices, in order. | |
| using | EnvironmentReader = std::function<std::optional<std::string>(const char *name)> |
| Reads an environment variable, or nothing when it is unset or empty. | |
| using | SavePayloadValidator = std::function<bool(std::span<const std::uint8_t>)> |
| Validate format-specific fields of an internal save's payload under its exclusive process lock. | |
| using | Matrix4 = std::array<float, 16> |
| A 4 by 4 matrix, column by column. | |
| using | CarDamage = std::array<int, CAR_DAMAGE_SIDES> |
| The levels of damage of the sides of a car, each from 0 for none to CAR_DAMAGE_LEVELS. | |
Enumerations | |
| enum | ControllerButton : std::uint16_t { BUTTON_C_RIGHT = 0x0001 , BUTTON_C_LEFT = 0x0002 , BUTTON_C_DOWN = 0x0004 , BUTTON_C_UP = 0x0008 , BUTTON_R = 0x0010 , BUTTON_L = 0x0020 , BUTTON_D_RIGHT = 0x0100 , BUTTON_D_LEFT = 0x0200 , BUTTON_D_DOWN = 0x0400 , BUTTON_D_UP = 0x0800 , BUTTON_START = 0x1000 , BUTTON_Z = 0x2000 , BUTTON_B = 0x4000 , BUTTON_A = 0x8000 } |
| The buttons of a Nintendo 64 controller, with the bits libultra reports. More... | |
| enum class | PakRelease { Usa , Eur , Jpn } |
| The release of the cartridge whose game code and company code the notes of an image take. More... | |
| enum | ControlAction : std::size_t { CONTROL_STEER_LEFT , CONTROL_STEER_RIGHT , CONTROL_ACCELERATE , CONTROL_BRAKE , CONTROL_REVERSE , CONTROL_GEAR_UP , CONTROL_GEAR_DOWN , CONTROL_COCKPIT_CAMERA , CONTROL_BUMPER_CAMERA , CONTROL_CHASE_CAMERA , CONTROL_PAUSE_MENU_UP , CONTROL_PAUSE_MENU_DOWN , CONTROL_PAUSE_MENU_SELECT , CONTROL_PAUSE , CONTROL_START_OR_RESPAWN , CONTROL_MENU_A , CONTROL_MENU_B , CONTROL_MENU_Z , CONTROL_MENU_START , CONTROL_MENU_L , CONTROL_MENU_R , CONTROL_MENU_C_UP , CONTROL_MENU_C_DOWN , CONTROL_MENU_C_LEFT , CONTROL_MENU_C_RIGHT , CONTROL_MENU_D_UP , CONTROL_MENU_D_DOWN , CONTROL_MENU_D_LEFT , CONTROL_MENU_D_RIGHT , CONTROL_MENU_STICK_LEFT , CONTROL_MENU_STICK_RIGHT , CONTROL_MENU_STICK_UP , CONTROL_MENU_STICK_DOWN , CONTROL_ACTION_COUNT } |
| The actions of a gamepad the Controls section of BossRally.ini binds, in the order of keys. More... | |
| enum class | WizardCartridge { Usa , Eur , Jpn } |
| A supported ROM release. More... | |
| enum class | WizardKey { Tab , Enter , Space , Escape , Up , Down , Left , Right , PageUp , PageDown , Home , End , Backspace , Delete , SelectAll , DeleteWord , DeleteNextWord , WordLeft , WordRight } |
| A key of the keyboard the wizard reads. More... | |
| enum class | WizardScreen { Reimport , SourceSelection , Files , SearchDirectory , Search , Import , Done } |
| A screen of the wizard, in order. More... | |
| enum class | WizardEnd { Running , Quit , Finished } |
| How the wizard ended. More... | |
| enum class | WizardControlId { DiscText , DiscBrowse , DiscClear , Rom1Text , Rom2Text , Rom3Text , Rom1Browse , Rom2Browse , Rom3Browse , Rom1Clear , Rom2Clear , Rom3Clear , SearchAssets , SpecifyPaths , Portable , SearchText , SearchBrowse , SearchClear , StartSearch , RetrySearch , UseFound , Back , Next , Quit , Cancel , Finish , BrowserList , BrowserFilter , BrowserOk , BrowserUseDirectory , BrowserCancel , MessageOk , MessageYes , MessageNo } |
| A control of a screen or a dialog of the wizard. More... | |
| enum class | CgaColor : std::uint8_t { Black , Blue , Green , Cyan , Red , Magenta , Brown , LightGray , DarkGray , LightBlue , LightGreen , LightCyan , LightRed , LightMagenta , Yellow , White } |
| The 16 colours of CGA, by their number. More... | |
| enum class | ScaleFilter { Linear , Nearest , EdgeAdaptive } |
| How the frame is scaled to the window. More... | |
| enum class | TextureFilter { N64 , Modern , Nearest } |
| How the textures the game filters are filtered. More... | |
| enum class | PostAntialias { None , Fxaa } |
| The anti-aliasing of the finished frame, before it is scaled to the window. More... | |
| enum class | ScreenShader { None , ConsumerCrt , Pvm , ApertureGrille , PcCrt } |
| Display simulation applied after the internal frame is scaled to the window. More... | |
| enum class | HdrOutput { Auto , On , Off } |
| Whether HDR output follows the window, is requested, or is disabled. More... | |
| enum class | RomRelease { Usa , Jpn , Eur , Asia } |
| A Nintendo 64 release the game reads models, textures, and music from. More... | |
| enum class | ImportSource { Disc , Usa , Jpn , Eur , Asia } |
| A source of the data of the default pack. More... | |
| enum class | IntroEnd { Running , MainMenu , AttractDemo } |
| Where the splash screens go once they fade out. More... | |
| enum class | MenusEnd { Running , Quit , Splash , AttractDemo , Race , Credits , ApplySettings , Reinitialize } |
| Where the menus go next. More... | |
| enum class | GameMode { Championship , Arcade , TimeAttack , Practice } |
| The modes of the game, as g_dwGameMode of the console. More... | |
| enum class | MenuResult { None , Chosen , Cancelled , Up , Down } |
| What a frame of a menu screen ends with, the results of ProcessScreenState(). More... | |
| enum | MipsRegister : int { MIPS_ZERO = 0 , MIPS_V0 = 2 , MIPS_V1 = 3 , MIPS_A0 = 4 , MIPS_A1 = 5 , MIPS_A2 = 6 , MIPS_A3 = 7 , MIPS_SP = 29 , MIPS_RA = 31 } |
| The numbers of the general registers the calling convention gives a role. More... | |
| enum class | N64DemoRelease { Usa , Jpn , Eur } |
| A release of the cartridge whose demo is recorded. More... | |
| enum | PaintTool : u8 { PAINT_TOOL_BRUSH_SIZE , PAINT_TOOL_BRUSH , PAINT_TOOL_FILL , PAINT_TOOL_LINE , PAINT_TOOL_TEXT , PAINT_TOOL_RECTANGLE , PAINT_TOOL_OVAL , PAINT_TOOL_MIRROR , PAINT_TOOL_CLEAR , PAINT_TOOL_LOAD , PAINT_TOOL_SAVE , PAINT_TOOL_UNDO , PAINT_TOOL_EXIT , PAINT_TOOLS } |
| The tools of the paint shop, each a button, as the console numbers them. More... | |
| enum class | RaceMusicSource { Modules , CdAudio } |
| Where the music of a race comes from. More... | |
| enum class | RaceEnd { Running , Results , Menu , SeasonMenu , Credits } |
| How a race ends. More... | |
| enum class | ScriptMouseButton { None , Left , Right } |
| The button of the mouse a move holds down. More... | |
Functions | |
| std::optional< std::string > | ImportAssetImages (const std::filesystem::path &data, const std::filesystem::path &disc, std::span< const std::filesystem::path > roms, const ImportProgress &progress={}, std::vector< std::filesystem::path > *sources=nullptr) |
| Import a disc and every supplied ROM as one batch. | |
| std::optional< std::string > | WriteImportDependencies (const std::filesystem::path &file, const std::filesystem::path &target, std::span< const std::filesystem::path > sources) |
| Write a GCC-style dependency file atomically for a completed asset import. | |
| std::optional< std::string > | CurateAssetPacks (const std::filesystem::path &defaults) |
| Put the images of the cartridges that show the branding the PC release removed (Nintendo, Top Gear, and Kemco) in place of their PC images in the default pack, and move the PC images to the pack boss beside it. | |
| nlohmann::json | PackSettings (const std::filesystem::path &data, std::string_view pack, const std::filesystem::path &fallback={}) |
| Read default settings from pack.json and replace matching keys with selected pack settings. | |
| std::expected< AssetStorageSavings, std::string > | DeduplicateAssetFiles (const std::filesystem::path &defaults) |
| Replace byte-identical generated files with aliases. | |
| std::optional< std::string > | FinalizeGeneratedAssetPacks (const std::filesystem::path &defaults) |
| Remove empty subdirectories and write permissions from generated packs, excluding mod packs. | |
| void | RemoveAssetTree (const std::filesystem::path &path, std::error_code &error) |
| Delete a tree after restoring directory owner-write permissions, without following symlinks. | |
| std::expected< std::vector< AssetFileAlias >, std::string > | ReadAssetFileAliases (const std::filesystem::path &pack, const std::filesystem::path &defaults) |
| Read and validate an alias table, including its physical targets. | |
| std::optional< float > | ParseAspectRatio (std::string_view text) |
| Read a finite, positive aspect ratio or an automatic-sizing setting. | |
| std::array< int, 2 > | ExpandInternalResolution (int width, int height, float aspect) |
| Expand a resolution to an aspect ratio, with minimum dimensions of 320x240. | |
| std::array< int, 2 > | ScaleFrameResolution (int width, int height, float scale, float aspect) |
| Scale window dimensions and fit an aspect ratio before bounded integer conversion. | |
| std::optional< std::string > | ExportPakImage (const ControllerPak &pak, const std::filesystem::path &file, PakRelease release=PakRelease::Usa) |
| Write the notes of a pak as the image of a formatted Controller Pak, with the game code and the company code of a release on each note. | |
| std::optional< std::string > | ImportPakImage (const ControllerPak &pak, const std::filesystem::path &file) |
| Copy the notes of any release of the game from the image of a Controller Pak, or from the first pak of an image of four, to a pak. | |
| constexpr ControlPreset | RaceControlPreset (std::string_view name, const std::array< std::string_view, RACE_CONTROL_ACTIONS > &race) |
| void | LoadControls (const GameConfig &config) |
Read the Controls section of config: the preset of the Preset key, the default for an absent or unknown preset, with each action key present replacing the binding of the preset, the device of each player, and the dead zone of the axes. | |
| std::string_view | PlayerDevice (std::size_t player) |
| bool | IsControlAnalog (ControlAction action) |
| int | ReadControl (SDL_Gamepad *gamepad, ControlAction action) |
| int | TexelOffset (int x, int y, int width) |
| The byte of a texel of a 4-bit texture as the console loads it in one block, the 64-bit words of each odd row swapped. | |
| std::expected< DecodedDisc, std::string > | CreateDecodedDisc (bool raw, std::uint64_t bytes) |
| Create private temporary storage for an ISO or raw-sector image. | |
| constexpr bool | IsDiscImageExtension (std::string_view extension) |
| Check a lower-case filename extension, including its initial dot. | |
| std::expected< std::vector< CueTrack >, std::string > | ReadDiscTracks (const std::filesystem::path &disc, const ImportProgress &progress={}, std::vector< std::filesystem::path > *sources=nullptr) |
| Resolve tracks from CUE, ISO, BIN, numbered track files, CloneCD, DiscJuggler CDI, Nero NRG, Alcohol MDS, BlindWrite 4/5/6, Pinnacle PDI, or an unencrypted ISZ image. | |
| std::optional< std::string > | DownloadFile (const std::string &url, const std::filesystem::path &output, const ImportProgress &progress={}) |
| Download an HTTPS URL to a file with the HTTP client of the operating system, following redirects. | |
| unsigned | CreateEngineTexture (const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes) |
| Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFromN64Image() of the PC release creates one. | |
| int | DecodeEngineTexture (void *destination, const unsigned char *image, const unsigned char *palette, int width, int height, int lineBytes) |
| Decode an 8-bit colour-indexed image of the console to its colours, each a big-endian RGBA5551 half, as the hook g_pfnDecodeN64TextureToPixelBuffer() of the PC release decodes one. | |
| void | LoadEngineTexture (unsigned entry, const unsigned char *colors) |
| Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them. | |
| const EngineTexture * | FindEngineTexture (unsigned entry) |
| void | ClearEngineTextures () |
| Drop every texture, as the renderer of the PC release shuts its textures down. | |
| std::optional< std::vector< BrowserEntry > > | ListBrowserDirectory (const std::filesystem::path &directory, std::span< const std::string_view > extensions, bool directoriesOnly=false) |
List a directory for the file browser: .. first, or on Windows the drives at the root of a drive, then the directories, then the files with one of extensions. | |
| std::filesystem::path | ResolveUserPath (std::string_view text, const std::filesystem::path &home) |
| Expand an initial home-directory shorthand and use native separators after expansion. | |
| std::filesystem::path | PathFromUtf8 (std::string_view text) |
| std::string | LowercaseExtension (const std::filesystem::path &path) |
| std::optional< WizardCartridge > | BaseCartridge (const std::array< bool, WIZARD_CARTRIDGES > &checked) |
| Choose the base release for the default pack. | |
| WizardSearchResult | SearchWizardDirectory (const std::filesystem::path &directory, const WizardServices &services, const WizardSearchProgress &progress) |
| Search recursively, including hidden directories, for validated disc and ROM images. | |
| char | AcceleratorOf (const std::string &label) |
| Matrix4 | TextGridProjection (float aspect) |
| std::array< int, 2 > | GridPointInWindow (float windowWidth, float windowHeight, float frameAspect, float x, float y) |
| The place of the mouse on the grid, with the frame fitted to the window and the grid to the frame as TextGridProjection() fits it. | |
| std::uint8_t | Cp437FromCodepoint (char32_t codepoint) |
| std::u32string | DecodeUtf8 (std::string_view text) |
| std::string | EncodeUtf8 (std::u32string_view text) |
| SetupRun | RunSetupWizard (GpuWindow &window, GamePaths &paths, GameConfig &config, const Script &script, std::span< const SDL_Scancode > scriptKeys, const std::filesystem::path &captures, bool fixedTime, const std::string &reimportReason={}, const std::filesystem::path &portableDirectory={}) |
| Show the setup wizard until the user finishes or quits it. | |
| constexpr std::uint32_t | SfxVolume (std::uint32_t right, std::uint32_t left) |
| constexpr std::array< std::uint32_t, 2 > | CombineLerp (std::uint32_t a0, std::uint32_t b0, std::uint32_t c0, std::uint32_t d0, std::uint32_t alphaA0, std::uint32_t alphaB0, std::uint32_t alphaC0, std::uint32_t alphaD0, std::uint32_t a1, std::uint32_t b1, std::uint32_t c1, std::uint32_t d1, std::uint32_t alphaA1, std::uint32_t alphaB1, std::uint32_t alphaC1, std::uint32_t alphaD1) |
| The two words of gDPSetCombineLERP(), from the colour and alpha inputs of each cycle. | |
| Matrix4 | Translation (float x, float y, float z) |
| Matrix4 | Scale (float s) |
| Matrix4 | RotationX (float angle) |
| Matrix4 | RotationZ (float angle) |
| std::array< float, 2 > | ScreenExtent (float aspect) |
| The part of the frame the 4:3 screen of the menus covers, centred: the whole height of a frame wider than 4:3 and the whole width of a narrower one. | |
| Matrix4 | MenuProjection (float aspect, float nearPlane, float farPlane, const std::optional< Matrix4 > &camera=std::nullopt) |
| The camera of the menus, which looks at the middle of the 320 by 240 screen from 290 in front of it with a field of 45 degrees, onto the 4:3 screen centred in the frame, to a depth from 0 to 1. | |
| Matrix4 | FlatProjection (float aspect) |
| Matrix4 | ScreenModelAt (float x, float y, float z, float angle, float scale) |
| DrawModelAt() of the console: a model turned about its own axis, scaled, stood up, and placed. | |
| Matrix4 | StageCamera (float aspect, const std::array< float, 3 > &eye, int x, int y, int width, int height, const std::optional< Matrix4 > &camera=std::nullopt) |
| SetupCameraMatrix() of the console for the trackside camera of a stage of the menus. | |
| Matrix4 | StageFrameAt (float x, float y, float angle) |
| The frame of a car on a stage of the menus in the space of the console, facing an angle about z, 0.254 above the stage. | |
| Matrix4 | StageCarAt (float x, float y, float angle) |
| The place of a car on a stage of the menus, facing an angle about z, 0.254 above the stage. | |
| Reflection | StageReflection (const RenderTexture *texture, const std::array< float, 3 > &eye) |
| The reflection of the sky on a car as RenderVehicleModel() sets it up for the trackside camera of the menus looking at the origin from an eye: the axes of guLookAtReflectF() from the heading of the camera, and the window of the tile turning with the heading. | |
| void | AddTriangle (std::vector< FlatVertex > &quads, const StageVertex &a, const StageVertex &b, const StageVertex &c) |
| Add a shaded triangle to flat quads, as a quad whose last corner repeats its third. | |
| SDL_Rect | FrameRect (Uint32 frameWidth, Uint32 frameHeight, int x, int y, int width, int height) |
| Lighting | ReadLighting (const nlohmann::json &light) |
| std::optional< std::vector< s8 > > | ReadSound (const std::filesystem::path &path) |
| s16 | PlaySoundEffect (std::vector< s8 > &sample, std::uint32_t volume) |
| Play a sound on a free sound effect channel. | |
| bool | ApplyGraphicsPreset (GameConfig &config, std::string_view preset) |
| Apply a graphics preset without changing language or region. | |
| bool | SpeedInMph (const GameConfig &config, std::string_view region, std::string_view country) |
| Resolve speed units without recording an automatic choice as a user preference. | |
| int | SoundEffectsVolume (const GameConfig &config, bool n64) |
| Resolve SFX volume from a manual preference or the selected sample source. | |
| std::optional< nlohmann::ordered_json > | GhostToJson (std::span< const std::uint8_t > bytes) |
| Describe a ghost recording of the PC release (RGho) as JSON: the recording, the settings, the name of its slot, and each frame with every bit in a named field. | |
| std::optional< std::vector< std::uint8_t > > | GhostFromJson (const nlohmann::ordered_json &json) |
| Build the file of a ghost recording from its JSON, the inverse of GhostToJson(). | |
| std::string | FormatGhostJson (const nlohmann::ordered_json &json) |
| Write the JSON of a recording with each frame on one line. | |
| std::optional< std::vector< u8 > > | PackGhostNote (std::span< const u8 > recording) |
| Compress a recording into the note of a ghost car, as SaveSaveLoadNote() of the console does: each of the two channels of the recording (the steering and the actions) with run lengths, and the length of each channel first in the byte order of the console. | |
| std::optional< std::vector< u8 > > | UnpackGhostNote (std::span< const u8 > note) |
| Expand the note of a ghost car into its recording. | |
| std::vector< u8 > | PackGhostFrames (std::span< const u8 > recording, std::span< const u8 > frames) |
| Store the frames of the race engine with the recording of the console they were recorded with. | |
| std::optional< std::vector< u8 > > | GhostFramesFor (std::span< const u8 > file, std::span< const u8 > recording) |
| Read the frames of the race engine of a recording of the console from the file of PackGhostFrames(). | |
| bool | SaveGhostFrames (const std::filesystem::path &path, std::span< const u8 > recording, std::span< const u8 > frames) |
| Atomically write the payload of PackGhostFrames() with a verified integrity header. | |
| std::optional< std::vector< u8 > > | LoadGhostFrames (const std::filesystem::path &path, std::span< const u8 > recording) |
| Read the frames of a recording from the file of SaveGhostFrames(). | |
| std::expected< GltfDocument, std::string > | ReadGltfDocument (const std::filesystem::path &path) |
| Read a model or image-override document. | |
| SDL_GPUTexture * | CreateGpuTexture (SDL_GPUDevice *device, const SDL_GPUTextureCreateInfo *info) |
| SDL_CreateGPUTexture(), recording bytes of every level and sample in GpuWindow::GpuMemoryBytes(). | |
| SDL_GPUBuffer * | CreateGpuBuffer (SDL_GPUDevice *device, const SDL_GPUBufferCreateInfo *info) |
| SDL_CreateGPUBuffer(), recording its size in GpuWindow::GpuMemoryBytes(). | |
| SDL_GPUTransferBuffer * | CreateGpuTransferBuffer (SDL_GPUDevice *device, const SDL_GPUTransferBufferCreateInfo *info) |
| SDL_CreateGPUTransferBuffer(), recording its size in GpuWindow::GpuMemoryBytes(). | |
| void | ReleaseGpuTexture (SDL_GPUDevice *device, SDL_GPUTexture *texture) |
| SDL_ReleaseGPUTexture(), subtracting its bytes from GpuWindow::GpuMemoryBytes(). | |
| void | ReleaseGpuBuffer (SDL_GPUDevice *device, SDL_GPUBuffer *buffer) |
| SDL_ReleaseGPUBuffer(), subtracting its bytes from GpuWindow::GpuMemoryBytes(). | |
| void | ReleaseGpuTransferBuffer (SDL_GPUDevice *device, SDL_GPUTransferBuffer *buffer) |
| SDL_ReleaseGPUTransferBuffer(), subtracting its bytes from GpuWindow::GpuMemoryBytes(). | |
| std::optional< IconSize > | ParseIconName (std::string_view name) |
| Read the size of an image of the icon from the name the import gives its PNG file. | |
| std::string | IconName (const IconSize &size) |
| Give the name of the PNG file of an image of the icon. | |
| std::vector< IconEntry > | ListIconImages (std::span< const std::uint8_t > icon) |
| List the images of an icon file. | |
| std::optional< IconPixels > | DecodeIconBitmap (std::span< const std::uint8_t > image) |
| Decode an icon image that is a device-independent bitmap: the colours, then the AND mask that makes a pixel transparent. | |
| bool | NormalizeRomByteOrder (std::span< std::uint8_t > image) |
| Convert a cartridge image in any of the three byte orders (z64, v64, n64) to big-endian. | |
| std::expected< RomRelease, std::string > | IdentifyRom (std::span< const std::uint8_t > image) |
| Identify a big-endian cartridge image by its SHA-1. | |
| std::expected< RomRelease, std::string > | IdentifyRomFile (const std::filesystem::path &image) |
| Identify a cartridge image file in any of the three byte orders by its SHA-1. | |
| std::expected< RomRelease, std::string > | ImportRom (const std::filesystem::path &image, const std::filesystem::path &dataDirectory, const ImportProgress &progress={}) |
Check a cartridge image and extract its main segment and its assets, inflated, to n64/usa, n64/jpn, n64/eur, or n64/asia under dataDirectory. | |
| std::expected< std::vector< CueTrack >, std::string > | ParseCueSheet (const std::filesystem::path &cue) |
| Parse a CUE sheet. | |
| std::expected< std::size_t, std::string > | ImportDisc (const std::filesystem::path &disc, const std::filesystem::path &dataDirectory, const ImportProgress &progress, std::vector< std::filesystem::path > *sources=nullptr) |
Copy the files of the Boss Rally disc the game opens to dataDirectory, and its CD audio tracks as music/trackNN.flac. | |
| std::optional< std::string > | CheckDisc (const std::filesystem::path &disc) |
| Check that a disc image or directory provides Boss Rally files without copying them. | |
| std::optional< std::string > | RunImportJobs (std::span< const ImportJob > jobs, const ImportProgress &progress={}) |
| Run independent jobs with at most four workers, limited by available CPU concurrency. | |
| bool | RecordImport (const std::filesystem::path &defaults, ImportSource source) |
Record in import.ini of the default pack that source was imported with the current version of its conversion. | |
| std::vector< ImportSource > | StaleImports (const std::filesystem::path &defaults) |
| The sources of the default pack imported with a conversion version different from the current one. | |
| bool | DefaultPackUsable (const std::filesystem::path &defaults) |
| Check whether import.ini records the disc and at least one cartridge at current conversion versions, the regional layout is current, and every recorded file exists at its imported size. | |
| bool | RecordImportFiles (const std::filesystem::path &defaults) |
| Atomically record the relative path and size of every generated file after a successful import. | |
| std::string | ReimportMessage (std::span< const ImportSource > sources) |
| bool | SaveIndexed4Png (const std::filesystem::path &path, std::span< const std::uint8_t > texels, std::span< const std::uint8_t, 32 > palette, int width, int height) |
| Write a 4-bit colour-indexed image of the console as an indexed PNG image. | |
| bool | LoadIndexed4Png (const std::filesystem::path &path, std::span< std::uint8_t > texels, std::span< std::uint8_t, 32 > palette) |
| Read an indexed PNG image as the 4-bit texels and the RGBA5551 palette of the console. | |
| bool | LoadIndexed4Png (std::span< const std::uint8_t > bytes, std::span< std::uint8_t > texels, std::span< std::uint8_t, 32 > palette) |
| Read an encoded indexed PNG with the same requirements as the file overload. | |
| bool | SaveRgba8Png (const std::filesystem::path &path, std::span< const std::uint8_t > rgba, int width, int height) |
| Write 8-bit RGBA texels as a PNG image, and read it back to check it. | |
| std::optional< std::vector< std::uint8_t > > | EncodeIndexed4Png (std::span< const std::uint8_t > texels, std::span< const std::uint8_t, 32 > palette, int width, int height) |
| Encode a 4-bit colour-indexed image of the console as an indexed PNG image in memory. | |
| std::optional< std::vector< std::uint8_t > > | EncodeRgba8Png (std::span< const std::uint8_t > rgba, int width, int height) |
| Encode 8-bit RGBA texels as a PNG image in memory. | |
| PlayerDevices | AssignedDevices (std::size_t player, std::size_t players) |
| Resolve the Player1 and Player2 keys of the Controls section against the open gamepads. | |
| ControllerState | ReadRacePad (const PlayerDevices &devices) |
| Read the second player of a race as the console reads a pad: the race actions of the Controls section for each gamepad, and the keyboard bindings of the PC release for the keyboard. | |
| std::int8_t | ScaleStickAxis (std::int16_t axis) |
| Scale an SDL axis of -32768 to 32767 to the range of the controller stick. | |
| void | SetScriptedKeys (std::vector< int > scancodes) |
| Add simulated key presses alongside physical keyboard input, for tests. | |
| bool | IsKeyDown (SDL_Scancode scancode) |
| void | IgnoreKeyUntilReleased (SDL_Scancode scancode) |
| Report a key as up to IsKeyDown() until it is released, for a key a shortcut of the window consumed, such as Enter of Alt and Enter. | |
| void | SetSecondControllerState (const ControllerState &state) |
| Set the state of the second controller the race reads for its second player, until the next call. | |
| int | TakeMouseWheel () |
| void | ClearMouseWheel () |
| Discard the wheel of the mouse scrolled since TakeMouseWheel() last read it. | |
| std::expected< DecodedDisc, std::string > | DecodeIsz (const std::filesystem::path &image, const ImportProgress &progress={}) |
| Decode an unencrypted ISZ image, including split segments, to temporary storage. | |
| const std::string & | SelectedLanguage () |
| StringTable | MergeStrings (StringTable fallback, const StringTable &language) |
| std::filesystem::path | ReleaseDirectory (const std::filesystem::path &assets) |
| std::string | CartridgeRegion (const std::filesystem::path &release) |
| std::vector< std::string > | AvailableCartridgeRegions (std::span< const std::filesystem::path > dataRoots) |
| std::optional< std::string > | TitleScreenRegion (std::string_view choice, std::string_view currentRegion, std::span< const std::string > available) |
| std::filesystem::path | FontDirectory (const std::filesystem::path &assets, std::string_view language) |
| std::string | AbbreviateLogPaths (std::string_view message, std::string_view home) |
| Abbreviate home-directory paths in a log message without changing similarly prefixed paths. | |
| void | StopGameLog () |
| Close the active game log and restore its previous callback before fatal process exit. | |
| int | CenterLines (std::string_view text, int y, int lines, int lineHeight) |
| Centre a string on the place of a block of a number of lines, as a release that draws a message in fewer lines than the USA release centres it. | |
| void | PublishN64Volumes () |
| Hand the volumes the game writes (g_bBgmVolume, g_bMusicVolume, g_bSfxMasterVolume, and g_bSfxVolume) to the mixers. | |
| std::expected< N64Demo, std::string > | RecordN64AttractDemo (std::span< const std::uint8_t > rom, N64DemoRelease release) |
| Record the attract demo of a cartridge. | |
| std::expected< GltfModel, std::string > | CarModelToGltf (std::span< const std::uint8_t > bytes, std::size_t imageOffset, std::string_view bufferUri) |
| Describe the model of a car as glTF. | |
| std::expected< GltfModel, std::string > | TrackToGltf (std::span< const std::uint8_t > bytes, std::string_view bufferUri) |
| Describe a track as glTF. | |
| std::expected< GltfModel, std::string > | FrontEndModelToGltf (std::span< const std::uint8_t > bytes, std::string_view bufferUri) |
| Describe a model of the front end, such as a logo of the splash screens, as glTF. | |
| std::expected< std::vector< std::uint8_t >, std::string > | ModelFromGltf (const nlohmann::ordered_json &json, std::span< const std::uint8_t > buffer) |
| Build the file of a model or a track from its glTF, the inverse of CarModelToGltf(), TrackToGltf(), and FrontEndModelToGltf(). | |
| bool | ValidSavedRaceTime (float seconds) |
| Check that a saved race time is finite, non-negative, and safe to display in signed hundredths. | |
| bool | ValidOptionsNote (std::span< const std::uint8_t > note, const NoteEquipmentCounts &counts) |
| Validate native options-note length, volume levels, units, and equipment indices. | |
| bool | ValidSeasonNoteValues (std::span< const std::uint8_t > note, const NoteEquipmentCounts &counts) |
| Validate native season-note length, times, placements, and equipment indices. | |
| bool | ValidGhostRecording (std::span< const std::uint8_t > recording, std::size_t tracks, std::size_t cars, const NoteEquipmentCounts &counts) |
| Validate an expanded console ghost's length, track, car, and equipment header. | |
| std::string | Utf8FromPath (const std::filesystem::path &path) |
| bool | PortablePathsEnabled () |
| std::filesystem::path | PortableRoot (const std::filesystem::path &executable, const std::filesystem::path &appImage={}) |
| Locate portable files beside an application bundle, AppImage, or ordinary executable. | |
| std::expected< GamePaths, std::string > | ResolvePortablePaths (const GamePaths &fallback, const std::filesystem::path &executable, const std::filesystem::path &workingDirectory={}) |
| Prefer adjacent configuration and assets independently when portable lookup is enabled. | |
| std::filesystem::path | StorePortablePath (const std::filesystem::path &path, const std::filesystem::path &root, const std::filesystem::path &home) |
| Store an input path relative to the portable directory, using '~' for external home paths. | |
| std::filesystem::path | RestorePortablePath (const std::filesystem::path &path, const std::filesystem::path &root, const std::filesystem::path &home) |
| Rebuild a stored portable input path at its current executable or home location. | |
| std::optional< GamePaths > | ResolveXdgPaths (const EnvironmentReader &environment, const std::string &application) |
| Resolve the directories with the XDG Base Directory variables and their defaults under the home directory. | |
| std::optional< GamePaths > | ResolveGamePaths (const std::string &application) |
| Resolve the directories with the conventions of the running operating system: the XDG Base Directory variables on Linux and the BSDs, the folders of the user's library on macOS, and the roaming and local application data folders on Windows. | |
| std::vector< std::filesystem::path > | SystemDataDirectories (const std::filesystem::path &executable) |
| List system data roots, including the relocated installation and platform defaults. | |
| std::optional< std::filesystem::path > | FindAssetData (const std::filesystem::path &user, std::span< const std::filesystem::path > system) |
| Find usable assets in system roots first, then in the writable user data root. | |
| bool | CreateGamePaths (const GamePaths &paths) |
Create every directory of paths that does not exist. | |
| std::optional< std::string > | MigratePortablePaths (const GamePaths &source, const GamePaths &destination, bool copyOnly=false) |
| Move portable assets, settings, saves, screenshots, and state to platform directories. | |
| std::optional< std::string > | MakePortablePaths (const GamePaths &source, const std::filesystem::path &directory, bool copyOnly=false) |
| Export platform data as a portable installation, without copying the executable. | |
| std::optional< std::string > | MakePortableDistribution (const GamePaths &source, const std::filesystem::path &executable, const std::filesystem::path &directory, bool copyOnly=false) |
| Export installed program files and platform data into a complete portable distribution. | |
| std::optional< std::string > | ResetGamePaths (const GamePaths &paths, bool factoryReset=false) |
| Clear imported assets and asset caches, or all application data for a factory reset. | |
| std::filesystem::path | DefaultAssets (const std::filesystem::path &data) |
| The directory the import writes the game data to, the default pack. | |
| std::filesystem::path | PackDirectory (const std::filesystem::path &data, std::string_view pack, const std::filesystem::path &fallback={}) |
| The directory of a pack under assets of the data directory, named after the pack. | |
| std::optional< std::filesystem::path > | PackAssets (const std::filesystem::path &data, const std::filesystem::path &cache, std::string_view pack, const std::filesystem::path &fallback={}, std::string_view region={}) |
| The directory the game reads its assets from with a pack selected. | |
| std::expected< DecodedDisc, std::string > | DecodePdi (const std::filesystem::path &image, const ImportProgress &progress={}) |
| Decode a Pinnacle InstantCopy PDI image to temporary storage. | |
| std::optional< std::size_t > | UniqueGpuIndex (std::string_view active, std::span< const std::string > devices) |
| Match the active adapter to one provider device, rejecting absent and ambiguous identities. | |
| std::optional< std::uint64_t > | StatmResidentPages (std::string_view text) |
| std::optional< std::uint64_t > | SmapsGamePssBytes (std::string_view text, std::string_view executable) |
| void | OpenRaceData (bool playSounds) |
| Set the default configuration, the bindings, and the strings of the race, and open its sound, as the PC release does once at its start. | |
| bool | StartRaceMusic (const std::filesystem::path &directory, RaceMusicSource source, int musicTrack=-1) |
| Add a user of the music of the races, as the PC release opens its music device. | |
| void | StopRaceMusic () |
| Drop a user of the music of the races. | |
| void | ShutdownRaceMusic () |
| Release all race music resources regardless of active users, before SDL audio shuts down. | |
| void | RestartRaceMusic () |
| Play the track of the race from its start, with the device of the music resumed. | |
| void | ShareRaceMusicPlayer (N64Audio *audio) |
| Play the modules of the races through the player of the music of the menus, which mixes the channels of the console, instead of a player of their own. | |
| std::size_t | RenderRaceMusic (std::size_t frames) |
| Render frames of the track that plays, without a device, for tests. | |
| std::array< int, 2 > | RaceVolumeLevels () |
| int | RaceTrack () |
| std::vector< RaceCar > | RaceCars () |
| float | RaceFieldOfView (float fovy, float aspect, float scale=1.0f) |
| The vertical field of view of a view of the race on a frame. | |
| std::optional< std::vector< std::uint8_t > > | ReadWholeFile (const std::filesystem::path &path) |
| Reads a whole file with one read of its size. | |
| std::expected< Script, ScriptError > | ParseScript (std::string_view text) |
| Read a script of run-script: one command a line, with # starting a comment and blank lines ignored. | |
| std::optional< std::vector< std::uint8_t > > | ReadSaveFile (const std::filesystem::path &path, std::size_t limit) |
| Read a complete regular file without allocating beyond a caller-supplied limit. | |
| bool | WriteSaveFile (const std::filesystem::path &path, std::span< const std::uint8_t > bytes) |
| Lock and atomically replace a binary save. | |
| bool | WriteSaveFile (const std::filesystem::path &path, std::string_view text) |
| Lock and atomically replace a text save. | |
| std::optional< std::vector< std::uint8_t > > | ReadVerifiedSaveFile (const std::filesystem::path &path, std::size_t limit, bool resetInvalid=true, const SavePayloadValidator &validate={}) |
| Read an internal binary save with its format signature, payload length, and SHA-1 checksum. | |
| bool | WriteVerifiedSaveFile (const std::filesystem::path &path, std::span< const std::uint8_t > bytes) |
| Atomically write an internal binary save with a format signature, length, and SHA-1 checksum. | |
| Matrix4 | MultiplyMatrices (const Matrix4 &a, const Matrix4 &b) |
| std::optional< MorphPose > | PoseAtTime (const VertexAnimationInfo &animation, float time) |
| The pose of a vertex animation at a time, as the console blends its keys. | |
| std::map< unsigned, std::string > | ReadLibraryStrings (std::span< const std::uint8_t > image) |
| Read the string resources of a Windows library. | |
| void | AppendUtf8 (std::string &text, char32_t c) |
| Append a code point to UTF-8 text. | |
| char32_t | NextCodePoint (std::string_view text, std::size_t &position) |
| Decode the code point of UTF-8 text at a position, and step past it. | |
| const std::string * | FindString (std::string_view key) |
| std::string_view | GameString (std::string_view key) |
| constexpr int | EngineTrackForMenu (int track) |
| constexpr int | MenuTrackForEngine (int track) |
| int | LoadedTextureMapEntries () |
| unsigned | ConvertedVertexCount () |
| std::vector< std::array< float, 3 > > | CarDentOffsets (const VehicleModel *model, std::span< const std::array< float, 3 > > rest) |
| How far DeformVehicleMeshByImpact() has moved each vertex of a car from where it rested when the car loaded, by the position it rested at. | |
| std::expected< GltfModel, std::string > | TrackPreviewToGltf (const GltfModel &track, std::string_view bufferUri) |
| Generate a static menu miniature from a converted track during import. | |
| std::optional< std::string > | ConvertIntroMedia (const std::filesystem::path &directory, const ImportProgress &progress={}) |
| Convert optional disc intro media. | |
| constexpr int | RaceVolumeLevel (int level) |
| constexpr int | MenuVolumeLevel (int raceLevel, int level) |
| The level of the options menu after the pause menu of a race changed the level of the race engine. | |
| void | AttachParentConsole () |
| Attach to an existing parent console and reconnect unavailable standard streams. | |
| std::optional< std::string > | VisitZipEntries (const std::filesystem::path &archive, const std::function< bool(const std::string &, std::uint32_t)> &accept, const std::function< bool(const std::string &, std::vector< std::uint8_t > &)> &visit, const std::function< bool(const std::string &, double)> &progress={}) |
| Visit CRC-checked stored and deflated entries in a ZIP archive without extracting archive paths. | |
| std::optional< std::string > | VisitZipRoms (const std::filesystem::path &archive, const std::function< bool(std::vector< std::uint8_t > &)> &visit, const std::function< bool(const std::string &, double)> &progress={}) |
| Visit CRC-checked ROM entries in a ZIP archive without extracting archive paths. | |
Variables | |
| constexpr std::string_view | BOSS_PACK = "boss" |
| The name of the pack of the PC images the default pack replaces with branded images. | |
| constexpr int | PACK_SETTINGS_VERSION = 1 |
| The version of pack.json the import writes. | |
| constexpr float | DEFAULT_XM_MUSIC_GAIN = 1.5f |
| The gain of the music modules of the default pack, as they play quieter than the CD audio. | |
| constexpr const char * | ASSET_ALIASES_FILE = "asset-aliases.txt" |
| The alias-table filename for logical paths and their physical backing files. | |
| const std::array< ConsoleString, 147 > | CONSOLE_STRINGS |
| The messages the Japanese release draws in Japanese and the messages the other releases draw in their place, then the messages of the race that a string of BRString.dll draws in the PC release, paired across the releases by the code that draws them. | |
| const std::array< SaveFolderString, 10 > | SAVE_FOLDER_STRINGS |
| The messages of the console that name the Controller Pak where the game saves to a folder, as the import writes them to strings/en-us.json with the text of the USA cartridge. | |
| constexpr std::size_t | LIBRARY_STRING_COUNT = 303 |
| The number of strings of BRString.dll, numbered from 1. | |
| const std::array< std::string_view, LIBRARY_STRING_COUNT > | LIBRARY_STRING_KEYS |
| The key of each string of BRString.dll, by its number less 1. | |
| constexpr std::size_t | CONTROLLER_PORTS = 4 |
| The number of controller ports of the console. | |
| constexpr std::size_t | PAK_PAGE_BYTES = 0x100 |
| The bytes of a page of a Controller Pak, the unit a note takes its room in. | |
| constexpr std::size_t | PAK_PAGES = 123 |
| The pages of a Controller Pak free for notes. | |
| constexpr std::size_t | PAK_NOTES = 16 |
| The notes a Controller Pak has room for. | |
| constexpr std::string_view | PAK_SETTINGS_NOTE = "TOP GEAR OPTIONS" |
| The note of the settings of the options menu, stored with the settings of the game. | |
| constexpr std::size_t | PAK_IMAGE_BYTES = 0x8000 |
| The bytes of the image of a Controller Pak, as emulators and the tools of a pak store one. | |
| constexpr std::array< std::string_view, CONTROL_ACTION_COUNT > | CONTROL_KEYS |
| The keys of the Controls section, by ControlAction. | |
| constexpr std::string_view | CONTROL_PRESET_KEY = "Preset" |
| The key of the Controls section that chooses a preset. | |
| constexpr std::string_view | DEAD_ZONE_KEY = "DeadZone" |
| The key of the Controls section with the share of the travel of an axis that reads as 0. | |
| constexpr std::array< std::string_view, 2 > | PLAYER_DEVICE_KEYS {"Player1", "Player2"} |
| The keys of the Controls section that choose the input device of each player. | |
| constexpr ControlPreset | DEFAULT_CONTROL_PRESET |
| The preset of an absent or unknown Preset key. | |
| constexpr std::size_t | RACE_CONTROL_ACTIONS = CONTROL_CHASE_CAMERA + 1 |
| The actions of a race, from CONTROL_STEER_LEFT to CONTROL_CHASE_CAMERA. | |
| constexpr std::array< ControlPreset, 7 > | CONTROL_PRESETS |
| The presets the Preset key chooses from, the first the default. | |
| constexpr int | CONTROL_FULL = 32768 |
| The magnitude of a button held down or of an axis at its end. | |
| constexpr int | DECAL_SLOTS = 10 |
| The decals of a car, each the texture of the material of the same number. | |
| constexpr int | CAR_MATERIALS = 12 |
| The materials of a car whose palettes the colour of the car paints. | |
| constexpr int | CAR_MATERIAL_PAINT = 2 |
| The material whose palette is the paint, saved with the decals. | |
| constexpr int | CAR_MATERIAL_HEADLIGHTS = 10 |
| The material whose palette is the headlights. | |
| constexpr int | CAR_MATERIAL_REAR_LIGHTS = 11 |
| The material whose palette is the rear lights. | |
| constexpr std::array< std::string_view, 19 > | DISC_IMAGE_EXTENSIONS |
| Disc images, track metadata, and companion files accepted by the importer. | |
| constexpr int | WIZARD_CARTRIDGES = 3 |
| The number of supported ROM releases. | |
| constexpr int | GRID_WIDTH = GRID_COLUMNS * CELL_WIDTH |
| The width of the grid in pixels, 640. | |
| constexpr int | GRID_HEIGHT = GRID_ROWS * CELL_HEIGHT |
| The height of the grid in pixels, 400. | |
| constexpr int | GRID_COLUMNS = 80 |
| The columns of the grid. | |
| constexpr int | GRID_ROWS = 25 |
| The rows of the grid. | |
| constexpr int | CELL_WIDTH = 8 |
| The width of a cell in pixels. | |
| constexpr int | CELL_HEIGHT = 16 |
| The height of a cell in pixels. | |
| constexpr std::array< std::array< std::uint8_t, 3 >, 16 > | CGA_PALETTE |
| The red, green, and blue of each colour of CGA, by its number. | |
| constexpr std::uint8_t | REPLACEMENT_GLYPH = 0 |
| The glyph drawn for a character code page 437 does not have. | |
| constexpr float | HALF_PI = 1.570796371f |
| A quarter turn in radians, in the single precision of the console. | |
| constexpr float | PI = 3.141592741f |
| A half turn in radians, in the single precision of the console. | |
| constexpr float | TWO_PI = 6.283185482f |
| A whole turn in radians, in the single precision of the console. | |
| constexpr float | SCREEN_WIDTH = 320.0f |
| The low-resolution screen of the console, in pixels. | |
| constexpr float | SCREEN_HEIGHT = 240.0f |
| The height of the low-resolution console screen, in pixels. | |
| constexpr std::size_t | SOUND_PADDING = 0x100 |
| The silence after each sound, for the mixer to read zeros past its end. | |
| constexpr std::uint64_t | SFX_STEP_ONE = 1ull << 32 |
| The 32.32 step that plays a sample at its own rate. | |
| constexpr u8 | MAX_SFX_VOLUME = 0xFF |
| The volume of the sound effects at full level. | |
| constexpr std::uint32_t | COMBINED = 0 |
| The previous cycle's result as an RDP colour-combiner input. | |
| constexpr std::uint32_t | TEXEL0 = 1 |
| The first sampled texel as an RDP colour-combiner input. | |
| constexpr std::uint32_t | TEXEL1 = 2 |
| The second sampled texel as an RDP colour-combiner input. | |
| constexpr std::uint32_t | PRIMITIVE = 3 |
| The primitive colour as an RDP colour-combiner input. | |
| constexpr std::uint32_t | SHADE = 4 |
| The interpolated vertex colour as an RDP colour-combiner input. | |
| constexpr std::uint32_t | ENVIRONMENT = 5 |
| The environment colour as an RDP colour-combiner input. | |
| constexpr std::uint32_t | ZERO_AB = 15 |
| The zero selector for the A and B RDP colour-combiner operands. | |
| constexpr std::uint32_t | ZERO_D = 7 |
| The zero selector for the D RDP colour-combiner operand. | |
| constexpr std::uint32_t | ZERO_ALPHA = 7 |
| The zero selector for an RDP alpha-combiner operand. | |
| constexpr std::array< std::string_view, 7 > | STAGE_CAR_PARTS |
| The parts of a car RenderVehicleModel() draws in the menus: the near detail, the textured parts, the painted body, and the normal wheels. | |
| const Lighting | STAGE_CAR_LIGHTING |
| The lights RenderVehicleModel() lights a car with in the menus: g_DefaultLights, from (84, 84, 84), in the colours of SetupWeatherLights() in clear weather. | |
| constexpr std::size_t | GHOST_NOTE_SIZE = 0x3A00 |
| The size of the note of a ghost car, 58 pages. | |
| constexpr std::size_t | GHOST_RECORDING_CAPACITY = 0xDE5C |
| The capacity of the recording of the console, its header included. | |
| constexpr UsaMusicModule | USA_MUSIC_MODULES [] |
| The music modules of the USA cartridge: the menus, then the modules of the tracks. | |
| constexpr int | DISC_CONVERTER_VERSION = 2 |
| The version of the conversion of the Boss Rally disc: the cars, the tracks, the images, and the other files ImportDisc() converts, n64model.cpp included. | |
| constexpr int | CARTRIDGE_CONVERTER_VERSION = 1 |
| The version of the conversion of a Top Gear Rally cartridge: the models, the images, the music, and the other files ImportRom() converts, n64model.cpp included. | |
| constexpr std::string_view | DEFAULT_LANGUAGE = "en-us" |
| The language unless the configuration or the command line selects another. | |
| constexpr u32 | MENU_ITEM_ADJUSTABLE = 0x01 |
| The flag of an item whose up and down change it in place, as MenuResult::Up and Down. | |
| constexpr u32 | MENU_ITEM_IMMEDIATE = 0x02 |
| The flag of an item chosen at once, without fading the screen out. | |
| constexpr u32 | MENU_ITEM_SPINNING = 0x04 |
| The flag of an item drawn as its model spinning round as the items slide. | |
| constexpr u32 | MENU_ITEM_UNAVAILABLE = 0x08 |
| The flag of an item that cannot be chosen, whose screen explains why. | |
| constexpr u32 | MENU_ITEM_MIRRORED_MODEL = 0x10 |
| The flag of an item whose model is drawn mirrored. | |
| constexpr u32 | MENU_ITEM_FIRST_PLAYER = 0x20 |
| The flag of an item only the first player may choose. | |
| constexpr u32 | MENU_ITEM_LOCKED = 0x80000000 |
| The flag of an item that cannot be chosen, without a reason shown. | |
| constexpr int | N64_AUDIO_RATE = 21998 |
| The sample rate of the imported music, in stereo frames per second. | |
| constexpr std::string_view | DEFAULT_PACK = "default" |
| The name of the asset pack of the import, the directory assets/default. | |
| constexpr int | FRAME_RATE_STATES = 3 |
| The states of F in g_bShowFpsCounter: 0 for off, 1 for the frame rate, and 2 for both. | |
| constexpr int | FRAME_RATE_STATISTICS = 2 |
| The state of F in g_bShowFpsCounter that shows the statistics beside the frame rate. | |
| constexpr int | PC_RECORD_TRACKS = 15 |
| Track record slots in race-engine order, including the SDL Bonus Track. | |
| constexpr int | RESULT_LAPS = 12 |
| The most laps of a race the results record. | |
| constexpr int | SCRIPT_PRESS_FRAMES = 6 |
| The frames a press of a button or a key lasts when its line gives no number. | |
| constexpr Matrix4 | IDENTITY_MATRIX {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1} |
| The matrix that changes nothing. | |
| constexpr std::array< std::array< float, 3 >, 4 > | CLEAR_LIGHT_RAMP |
| The ambient colours of a ramped instance of a track on a clear day, from 0 to 1. | |
| constexpr std::size_t | MAX_CAR_SHADOWS = 4 |
| The most shadows of cars that fall on an instance of a track. | |
| constexpr int | CAR_DAMAGE_SIDES = 8 |
| The number of sides of a car that take damage, as IncrementDamageTextureLevel() counts them. | |
| constexpr int | CAR_DAMAGE_LEVELS = 3 |
| The levels of damage of a car after the first, as LoadCarPaintTextures() makes them. | |
| constexpr int | CONSOLE_TRACK_COUNT = 10 |
| Five console tracks and their five mirrored variants precede additional tracks. | |
| constexpr std::array< ExtraMenuTrack, 5 > | EXTRA_MENU_TRACKS |
| PC-only track entries; Season Champion (gamewin) remains indexed but unavailable for ordinary selection. | |
| constexpr int | MENU_TRACK_COUNT |
| The number of track entries before menu actions, including unavailable entries. | |
| constexpr int | MAX_VOLUME_LEVEL = 10 |
| The loudest level of the options menu. | |
| constexpr int | MAX_RACE_VOLUME_LEVEL = 9 |
| The loudest level of the race engine. | |
| using coastline::WizardProgress = std::function<bool(const std::string &step, double fraction)> |
Reports the step of an import and its share done from 0 to 1, and returns false to cancel.
Report search progress and return false to cancel.
| using coastline::ImportProgress = std::function<bool(const std::string &step, double fraction)> |
Reports import progress with a description and a fraction from 0 to 1.
It returns false to cancel the import before its next step.
| using coastline::ImportJob = std::function<std::optional<std::string>(const ImportProgress &)> |
Independent import work in a private destination directory.
Report progress from zero to one and stop when the callback returns false. Return an error on failure, or an empty optional on success.
| using coastline::StringTable = std::map<std::string, std::string, std::less<>> |
Strings by key, in UTF-8.
| using coastline::NoteEquipmentCounts = std::array<std::size_t, 5> |
Counts of handling, transmission, tyre, suspension, and controller-layout choices, in order.
| using coastline::EnvironmentReader = std::function<std::optional<std::string>(const char *name)> |
Reads an environment variable, or nothing when it is unset or empty.
| using coastline::SavePayloadValidator = std::function<bool(std::span<const std::uint8_t>)> |
Validate format-specific fields of an internal save's payload under its exclusive process lock.
Return false to reject the payload before it can be used by the game.
| using coastline::Matrix4 = std::array<float, 16> |
A 4 by 4 matrix, column by column.
| using coastline::CarDamage = std::array<int, CAR_DAMAGE_SIDES> |
The levels of damage of the sides of a car, each from 0 for none to CAR_DAMAGE_LEVELS.
The buttons of a Nintendo 64 controller, with the bits libultra reports.
|
strong |
The actions of a gamepad the Controls section of BossRally.ini binds, in the order of keys.
|
strong |
|
strong |
A key of the keyboard the wizard reads.
|
strong |
A screen of the wizard, in order.
|
strong |
|
strong |
A control of a screen or a dialog of the wizard.
|
strong |
The 16 colours of CGA, by their number.
|
strong |
|
strong |
|
strong |
|
strong |
Display simulation applied after the internal frame is scaled to the window.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Where the menus go next.
| Enumerator | |
|---|---|
| Running | A menu screen is still showing. |
| Quit | Two Escape presses request an application exit. |
| Splash | The player went back from the main menu, or it timed out. |
| AttractDemo | The asset pack starts a demonstration after main-menu inactivity. |
| Race | The race of Menus::ChosenRace() starts. |
| Credits | The race of the credits of the options menu starts. |
| ApplySettings | Apply pending settings after the options fade out. |
| Reinitialize | Reload game resources and return to the logos. |
|
strong |
|
strong |
What a frame of a menu screen ends with, the results of ProcessScreenState().
| enum coastline::MipsRegister : int |
The numbers of the general registers the calling convention gives a role.
|
strong |
| enum coastline::PaintTool : u8 |
The tools of the paint shop, each a button, as the console numbers them.
|
strong |
|
strong |
How a race ends.
|
strong |
| std::optional< std::string > coastline::ImportAssetImages | ( | const std::filesystem::path & | data, |
| const std::filesystem::path & | disc, | ||
| std::span< const std::filesystem::path > | roms, | ||
| const ImportProgress & | progress = {}, | ||
| std::vector< std::filesystem::path > * | sources = nullptr ) |
Import a disc and every supplied ROM as one batch.
USA is the base when supplied; otherwise the first ROM is the base. Failed or cancelled conversions preserve installed packs. A successful batch replaces generated packs and preserves mod packs. Each additional cartridge produces a regional difference pack over the base. Language fonts and strings remain available independently of the selected region.
| data | The data root where generated packs are installed under assets. |
| disc | A Boss Rally disc image or mounted disc directory. |
| roms | Top Gear Rally ROM images, with at most one image per region. |
| progress | Report batch progress, or empty. Return false to cancel before installation. |
| sources | Receives original input files and searched directories on success, or null. |
| std::optional< std::string > coastline::WriteImportDependencies | ( | const std::filesystem::path & | file, |
| const std::filesystem::path & | target, | ||
| std::span< const std::filesystem::path > | sources ) |
Write a GCC-style dependency file atomically for a completed asset import.
Paths become absolute UTF-8 paths with sorted, unique dependencies. Line breaks and tabs cannot be represented; literal backslashes are also rejected on POSIX.
| file | The dependency output file. |
| target | The build output depending on imported sources. |
| sources | Original input files and searched directories. |
| std::optional< std::string > coastline::CurateAssetPacks | ( | const std::filesystem::path & | defaults | ) |
Put the images of the cartridges that show the branding the PC release removed (Nintendo, Top Gear, and Kemco) in place of their PC images in the default pack, and move the PC images to the pack boss beside it.
The images are listed in data/branded-textures.json. An image whose model has another image of the PC release in the same file takes a file of its own, and the primitives of the listed meshes sample it; the original model moves to boss. An image whose cartridge or disc is not yet imported is skipped, and an image already in place is not written again. Each file written is read back and compared. The default pack and boss also take their pack.json.
| defaults | The directory of the default pack, assets/default of the data directory. |
| nlohmann::json coastline::PackSettings | ( | const std::filesystem::path & | data, |
| std::string_view | pack, | ||
| const std::filesystem::path & | fallback = {} ) |
Read default settings from pack.json and replace matching keys with selected pack settings.
Missing or malformed files do not contribute keys.
| data | The data directory of the game. |
| pack | The name of the pack. |
| fallback | Another data root searched for the selected pack, or empty. Default settings still come from data. |
| std::expected< AssetStorageSavings, std::string > coastline::DeduplicateAssetFiles | ( | const std::filesystem::path & | defaults | ) |
Replace byte-identical generated files with aliases.
Files shared by multiple non-default packs move into default/shared. Mod packs are excluded. Call before recording the inventory.
| defaults | The freshly converted default pack, without an alias table. |
| std::optional< std::string > coastline::FinalizeGeneratedAssetPacks | ( | const std::filesystem::path & | defaults | ) |
Remove empty subdirectories and write permissions from generated packs, excluding mod packs.
Preserve pack roots and reject symbolic links encountered during finalisation. Call after installation and inventory validation, with rollback available on failure.
| defaults | The completed default pack beside other generated packs. |
| void coastline::RemoveAssetTree | ( | const std::filesystem::path & | path, |
| std::error_code & | error ) |
Delete a tree after restoring directory owner-write permissions, without following symlinks.
Windows files also have their read-only attribute cleared before deletion.
| path | The file, directory, or symlink to delete; missing paths are accepted. |
| error | Receives a filesystem error, or is cleared on success. |
| std::expected< std::vector< AssetFileAlias >, std::string > coastline::ReadAssetFileAliases | ( | const std::filesystem::path & | pack, |
| const std::filesystem::path & | defaults ) |
Read and validate an alias table, including its physical targets.
Targets never refer to aliases or to another optional pack.
| pack | The physical pack directory. |
| defaults | The physical default pack directory. |
| std::optional< float > coastline::ParseAspectRatio | ( | std::string_view | text | ) |
Read a finite, positive aspect ratio or an automatic-sizing setting.
| text | Empty text, auto (case-insensitive), a ratio such as 4:3, or a number such as 1.6. |
| std::array< int, 2 > coastline::ExpandInternalResolution | ( | int | width, |
| int | height, | ||
| float | aspect ) |
Expand a resolution to an aspect ratio, with minimum dimensions of 320x240.
Each dimension is limited to 16384 pixels, even when the requested ratio requires more.
| width | The requested internal width, in pixels. |
| height | The requested internal height, in pixels. |
| aspect | The output width divided by height; invalid ratios only clamp the dimensions. |
| std::array< int, 2 > coastline::ScaleFrameResolution | ( | int | width, |
| int | height, | ||
| float | scale, | ||
| float | aspect ) |
Scale window dimensions and fit an aspect ratio before bounded integer conversion.
| width | Window width in pixels; non-positive values become 1. |
| height | Window height in pixels; non-positive values become 1. |
| scale | Render scale, clamped to [0.25, 4]; non-finite values use 1. |
| aspect | Width divided by height; non-finite or non-positive values follow the window. |
| std::optional< std::string > coastline::ExportPakImage | ( | const ControllerPak & | pak, |
| const std::filesystem::path & | file, | ||
| PakRelease | release = PakRelease::Usa ) |
Write the notes of a pak as the image of a formatted Controller Pak, with the game code and the company code of a release on each note.
An image of four paks of 0x20000 bytes, as mupen64plus writes one, takes the notes in its first pak, and its other paks are retained. Another file is replaced by an image of one pak.
| pak | The pak of the notes. |
| file | The image. |
| release | The release whose cartridge reads the notes. |
| std::optional< std::string > coastline::ImportPakImage | ( | const ControllerPak & | pak, |
| const std::filesystem::path & | file ) |
Copy the notes of any release of the game from the image of a Controller Pak, or from the first pak of an image of four, to a pak.
A note the pak has already is replaced and the replacement is logged. The notes of other games are skipped.
| pak | The pak the notes are written to. |
| file | The image. |
|
constexpr |
| name | The value of the Preset key. |
| race | The bindings of the actions of a race. |
| void coastline::LoadControls | ( | const GameConfig & | config | ) |
Read the Controls section of config: the preset of the Preset key, the default for an absent or unknown preset, with each action key present replacing the binding of the preset, the device of each player, and the dead zone of the axes.
A name that is not a button or an axis of a gamepad is logged and ignored.
| config | The settings of BossRally.ini. |
| std::string_view coastline::PlayerDevice | ( | std::size_t | player | ) |
| player | The player, 0 for the first. |
| bool coastline::IsControlAnalog | ( | ControlAction | action | ) |
| action | The action. |
| int coastline::ReadControl | ( | SDL_Gamepad * | gamepad, |
| ControlAction | action ) |
| gamepad | The gamepad. |
| action | The action. |
|
inline |
The byte of a texel of a 4-bit texture as the console loads it in one block, the 64-bit words of each odd row swapped.
| x | The column. |
| y | The row. |
| width | The width of the texture in texels. |
| std::expected< DecodedDisc, std::string > coastline::CreateDecodedDisc | ( | bool | raw, |
| std::uint64_t | bytes ) |
Create private temporary storage for an ISO or raw-sector image.
| raw | Whether the image uses raw CD sectors rather than cooked data sectors. |
| bytes | Required disk space in bytes. |
|
constexpr |
Check a lower-case filename extension, including its initial dot.
| extension | Normalised extension to test. |
| std::expected< std::vector< CueTrack >, std::string > coastline::ReadDiscTracks | ( | const std::filesystem::path & | disc, |
| const ImportProgress & | progress = {}, | ||
| std::vector< std::filesystem::path > * | sources = nullptr ) |
Resolve tracks from CUE, ISO, BIN, numbered track files, CloneCD, DiscJuggler CDI, Nero NRG, Alcohol MDS, BlindWrite 4/5/6, Pinnacle PDI, or an unencrypted ISZ image.
Returned tracks and readers retain shared temporary storage for decoded images.
| disc | Disc image or metadata file. Adjacent CUE sheets precede BIN layout discovery. |
| progress | Decoding progress, or empty. Return false to cancel image decoding. |
| sources | Optional output, replaced on success by original metadata and data paths. Temporary decoded files are excluded. BIN discovery also records its directory. |
| std::optional< std::string > coastline::DownloadFile | ( | const std::string & | url, |
| const std::filesystem::path & | output, | ||
| const ImportProgress & | progress = {} ) |
Download an HTTPS URL to a file with the HTTP client of the operating system, following redirects.
| url | The HTTPS URL. |
| output | The file to write. |
| progress | Progress and cancellation callback, or empty. |
| unsigned coastline::CreateEngineTexture | ( | const unsigned char * | image, |
| const unsigned char * | palette, | ||
| int | width, | ||
| int | height, | ||
| int | lineBytes ) |
Create a texture from an 8-bit colour-indexed image of the console, as the hook g_pfnCreateTextureFromN64Image() of the PC release creates one.
| image | The indices of the texels. |
| palette | The 256 colours, each a big-endian RGBA5551 half. |
| width | The width in texels. |
| height | The height in texels. |
| lineBytes | The bytes of a row of the image. |
| int coastline::DecodeEngineTexture | ( | void * | destination, |
| const unsigned char * | image, | ||
| const unsigned char * | palette, | ||
| int | width, | ||
| int | height, | ||
| int | lineBytes ) |
Decode an 8-bit colour-indexed image of the console to its colours, each a big-endian RGBA5551 half, as the hook g_pfnDecodeN64TextureToPixelBuffer() of the PC release decodes one.
| destination | Receives the colours, row by row. |
| image | The indices of the texels. |
| palette | The 256 colours, each a big-endian RGBA5551 half. |
| width | The width in texels. |
| height | The height in texels. |
| lineBytes | The bytes of a row of the image. |
| void coastline::LoadEngineTexture | ( | unsigned | entry, |
| const unsigned char * | colors ) |
Load the decoded colours of an image into a texture, as a command 0xdd of a display list loads them.
| entry | The texture entry, from 1. Invalid entries are ignored. |
| colors | The colours of its texels, each a big-endian RGBA5551 half, row by row. |
| const EngineTexture * coastline::FindEngineTexture | ( | unsigned | entry | ) |
| entry | The entry of a texture. |
| void coastline::ClearEngineTextures | ( | ) |
Drop every texture, as the renderer of the PC release shuts its textures down.
| std::optional< std::vector< BrowserEntry > > coastline::ListBrowserDirectory | ( | const std::filesystem::path & | directory, |
| std::span< const std::string_view > | extensions, | ||
| bool | directoriesOnly = false ) |
List a directory for the file browser: .. first, or on Windows the drives at the root of a drive, then the directories, then the files with one of extensions.
The directories and the files are each sorted by name without regard to case. An entry whose name starts with a full stop is hidden and not listed.
| directory | The directory, absolute. |
| extensions | The extensions of the files listed, lowercase with the full stop, such as .cue, or empty for every file. |
| directoriesOnly | Whether to omit files and list only navigable directories. |
| std::filesystem::path coastline::ResolveUserPath | ( | std::string_view | text, |
| const std::filesystem::path & | home ) |
Expand an initial home-directory shorthand and use native separators after expansion.
| text | A UTF-8 path, optionally starting with '~', '~/', or '~\'. |
| home | The directory substituted for the initial tilde, or empty to disable expansion. |
| std::filesystem::path coastline::PathFromUtf8 | ( | std::string_view | text | ) |
| text | A path in UTF-8. |
| std::string coastline::LowercaseExtension | ( | const std::filesystem::path & | path | ) |
| path | A path. |
| std::optional< WizardCartridge > coastline::BaseCartridge | ( | const std::array< bool, WIZARD_CARTRIDGES > & | checked | ) |
Choose the base release for the default pack.
Prefer the USA release when detected, then the European release, then the Japanese release.
| checked | Whether each release is available, in the order of WizardCartridge. |
| WizardSearchResult coastline::SearchWizardDirectory | ( | const std::filesystem::path & | directory, |
| const WizardServices & | services, | ||
| const WizardSearchProgress & | progress ) |
Search recursively, including hidden directories, for validated disc and ROM images.
| directory | The root directory to traverse. |
| services | Required disc and ROM validators, plus an optional ZIP validator. |
| progress | Reports discoveries and validation progress; return false to cancel. |
| char coastline::AcceleratorOf | ( | const std::string & | label | ) |
| label | A label with & before the letter of its accelerator. |
| Matrix4 coastline::TextGridProjection | ( | float | aspect | ) |
| aspect | The width of the frame over its height. |
| std::array< int, 2 > coastline::GridPointInWindow | ( | float | windowWidth, |
| float | windowHeight, | ||
| float | frameAspect, | ||
| float | x, | ||
| float | y ) |
The place of the mouse on the grid, with the frame fitted to the window and the grid to the frame as TextGridProjection() fits it.
| windowWidth | The width of the window. |
| windowHeight | The height of the window. |
| frameAspect | The width of the frame over its height. |
| x | The mouse across the window, in the units of the window. |
| y | The mouse down the window, in the units of the window. |
| std::uint8_t coastline::Cp437FromCodepoint | ( | char32_t | codepoint | ) |
| codepoint | A Unicode code point. |
| std::u32string coastline::DecodeUtf8 | ( | std::string_view | text | ) |
| text | UTF-8 text. A byte that does not start a valid sequence reads as U+FFFD. |
| std::string coastline::EncodeUtf8 | ( | std::u32string_view | text | ) |
| text | Unicode code points. |
| SetupRun coastline::RunSetupWizard | ( | GpuWindow & | window, |
| GamePaths & | paths, | ||
| GameConfig & | config, | ||
| const Script & | script, | ||
| std::span< const SDL_Scancode > | scriptKeys, | ||
| const std::filesystem::path & | captures, | ||
| bool | fixedTime, | ||
| const std::string & | reimportReason = {}, | ||
| const std::filesystem::path & | portableDirectory = {} ) |
Show the setup wizard until the user finishes or quits it.
Its import deletes the packs default, boss, eur, and jpn under assets of the data directory and imports the chosen files into the default pack. The wizard hides the cursor of the system and draws its own, and shows the cursor again when it ends. Disc, ROM, search, and last-browsed paths are restored from the SetupWizard section of config and updated on exit, including cancellation.
| window | The window of the game. |
| paths | The directories of the game, updated after a successful portable installation. |
| config | The settings of the game. |
| script | The run-script input, or an empty script. Scripted key presses, text input, and mouse movements operate wizard controls. Mouse coordinates on the 320 by 240 screen scale to the 640 by 400 grid. |
| scriptKeys | The scancode of each key of script, in order. |
| captures | The directory the frames of the script are saved to. |
| fixedTime | Whether each frame steps the blink of the cursor by a 60th of a second. |
| reimportReason | Why existing assets require another import, or empty for first-run setup. |
| portableDirectory | Portable destination, or empty to disable the installation checkbox. |
|
constexpr |
| right | The level of the right side, from 0 to 32. |
| left | The level of the left side, from 0 to 32. |
|
constexpr |
The two words of gDPSetCombineLERP(), from the colour and alpha inputs of each cycle.
| a0 | The first cycle's colour operand A, masked to four bits. |
| b0 | The first cycle's colour operand B, masked to four bits. |
| c0 | The first cycle's colour multiplier C, masked to five bits. |
| d0 | The first cycle's colour addend D, masked to three bits. |
| alphaA0 | The first cycle's alpha operand A, masked to three bits. |
| alphaB0 | The first cycle's alpha operand B, masked to three bits. |
| alphaC0 | The first cycle's alpha multiplier C, masked to three bits. |
| alphaD0 | The first cycle's alpha addend D, masked to three bits. |
| a1 | The second cycle's colour operand A, masked to four bits. |
| b1 | The second cycle's colour operand B, masked to four bits. |
| c1 | The second cycle's colour multiplier C, masked to five bits. |
| d1 | The second cycle's colour addend D, masked to three bits. |
| alphaA1 | The second cycle's alpha operand A, masked to three bits. |
| alphaB1 | The second cycle's alpha operand B, masked to three bits. |
| alphaC1 | The second cycle's alpha multiplier C, masked to three bits. |
| alphaD1 | The second cycle's alpha addend D, masked to three bits. |
| Matrix4 coastline::Translation | ( | float | x, |
| float | y, | ||
| float | z ) |
| x | The horizontal displacement in model units. |
| y | The vertical displacement in model units. |
| z | The depth displacement in model units. |
| Matrix4 coastline::Scale | ( | float | s | ) |
| s | The scale multiplier applied equally to all three axes. |
| Matrix4 coastline::RotationX | ( | float | angle | ) |
| angle | The rotation in radians about the x axis, following guRotateF(). |
| Matrix4 coastline::RotationZ | ( | float | angle | ) |
| angle | The rotation in radians about the z axis, following guRotateF(). |
| std::array< float, 2 > coastline::ScreenExtent | ( | float | aspect | ) |
The part of the frame the 4:3 screen of the menus covers, centred: the whole height of a frame wider than 4:3 and the whole width of a narrower one.
| aspect | The width of the frame over its height. |
| Matrix4 coastline::MenuProjection | ( | float | aspect, |
| float | nearPlane, | ||
| float | farPlane, | ||
| const std::optional< Matrix4 > & | camera = std::nullopt ) |
The camera of the menus, which looks at the middle of the 320 by 240 screen from 290 in front of it with a field of 45 degrees, onto the 4:3 screen centred in the frame, to a depth from 0 to 1.
| aspect | The width of the frame over its height. |
| nearPlane | The nearest distance drawn. |
| farPlane | The farthest distance drawn. |
| camera | Optional eye-space camera override; extends draw distance to the maximum. |
| Matrix4 coastline::FlatProjection | ( | float | aspect | ) |
| aspect | The width of the frame over its height. |
| Matrix4 coastline::ScreenModelAt | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | angle, | ||
| float | scale ) |
DrawModelAt() of the console: a model turned about its own axis, scaled, stood up, and placed.
The glTF of a model of the console is stood up from z up to y up, and this turns it back.
| x | The place across, in the space of the screen. |
| y | The place up. |
| z | The place forward. |
| angle | The turn about the axis of the model, in radians. |
| scale | The scale. |
| Matrix4 coastline::StageCamera | ( | float | aspect, |
| const std::array< float, 3 > & | eye, | ||
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height, | ||
| const std::optional< Matrix4 > & | camera = std::nullopt ) |
SetupCameraMatrix() of the console for the trackside camera of a stage of the menus.
The camera looks at the origin from an eye with z up, in a viewport of the 320 by 240 screen. The picture is moved and scaled to the rectangle of the viewport in the frame, where the screen is centred at 4:3.
| aspect | The width of the frame over its height. |
| eye | The place of the camera, in the space of the race. |
| x | The left of the viewport. |
| y | The top of the viewport. |
| width | The width of the viewport. |
| height | The height of the viewport. |
| camera | Optional eye-space camera override; extends draw distance to the maximum. |
| Matrix4 coastline::StageFrameAt | ( | float | x, |
| float | y, | ||
| float | angle ) |
The frame of a car on a stage of the menus in the space of the console, facing an angle about z, 0.254 above the stage.
| x | The place across. |
| y | The place along. |
| angle | The direction the car faces, in radians. |
| Matrix4 coastline::StageCarAt | ( | float | x, |
| float | y, | ||
| float | angle ) |
The place of a car on a stage of the menus, facing an angle about z, 0.254 above the stage.
The frame of the car is turned back from the z up of the console to the y up of the glTF.
| x | The place across. |
| y | The place along. |
| angle | The direction the car faces, in radians. |
| Reflection coastline::StageReflection | ( | const RenderTexture * | texture, |
| const std::array< float, 3 > & | eye ) |
The reflection of the sky on a car as RenderVehicleModel() sets it up for the trackside camera of the menus looking at the origin from an eye: the axes of guLookAtReflectF() from the heading of the camera, and the window of the tile turning with the heading.
| texture | The image of the sky. |
| eye | The place of the camera. |
| void coastline::AddTriangle | ( | std::vector< FlatVertex > & | quads, |
| const StageVertex & | a, | ||
| const StageVertex & | b, | ||
| const StageVertex & | c ) |
Add a shaded triangle to flat quads, as a quad whose last corner repeats its third.
| quads | The corners of the quads. |
| a | The first corner. |
| b | The second corner. |
| c | The third corner. |
| SDL_Rect coastline::FrameRect | ( | Uint32 | frameWidth, |
| Uint32 | frameHeight, | ||
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height ) |
| frameWidth | The width of the frame, in pixels. |
| frameHeight | The height of the frame, in pixels. |
| x | The left of a rectangle of the 320 by 240 screen. |
| y | The top of the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| Lighting coastline::ReadLighting | ( | const nlohmann::json & | light | ) |
| light | The lights of a screen in lights.json. |
| std::optional< std::vector< s8 > > coastline::ReadSound | ( | const std::filesystem::path & | path | ) |
| path | A sound of the import, an unsigned 8-bit WAV file. |
| s16 coastline::PlaySoundEffect | ( | std::vector< s8 > & | sample, |
| std::uint32_t | volume ) |
Play a sound on a free sound effect channel.
| sample | The samples, with the padding after them. |
| volume | The levels of the channel, from SfxVolume(). |
| bool coastline::ApplyGraphicsPreset | ( | GameConfig & | config, |
| std::string_view | preset ) |
Apply a graphics preset without changing language or region.
N64 selects console music and BR selects PC CD music; other presets preserve the music source. N64 and BR select N64 and PC sound effects, respectively. N64 and BR select N64 and PC window reflections, respectively. N64 and BR select 4:3; Ultra fills the screen. Other presets preserve the aspect ratio.
| config | The configuration to update in memory. |
| preset | custom, n64, br, ultra, worst, or low-power. |
| bool coastline::SpeedInMph | ( | const GameConfig & | config, |
| std::string_view | region, | ||
| std::string_view | country ) |
Resolve speed units without recording an automatic choice as a user preference.
Game.Units values mph and kph override region and locale. Otherwise, explicit eur and jpn regions use KPH and usa uses MPH. Without a region, MPH jurisdictions use MPH, other countries use KPH, and an absent country defaults to MPH.
| config | Saved settings; an absent or invalid Game.Units value selects automatic units. |
| region | The explicit CLI region, or empty to use the system locale. |
| country | The first available ISO 3166 country code in preferred locale order, or empty. |
| int coastline::SoundEffectsVolume | ( | const GameConfig & | config, |
| bool | n64 ) |
Resolve SFX volume from a manual preference or the selected sample source.
| config | Saved settings. Game.SfxVolume accepts 0 through 10; other values are automatic. |
| n64 | Whether N64 sound effects are selected. |
| std::optional< nlohmann::ordered_json > coastline::GhostToJson | ( | std::span< const std::uint8_t > | bytes | ) |
Describe a ghost recording of the PC release (RGho) as JSON: the recording, the settings, the name of its slot, and each frame with every bit in a named field.
The checksum and the sizes are left out, as the file computes them from the rest.
| bytes | The file. |
| std::optional< std::vector< std::uint8_t > > coastline::GhostFromJson | ( | const nlohmann::ordered_json & | json | ) |
Build the file of a ghost recording from its JSON, the inverse of GhostToJson().
| json | The JSON. |
| std::string coastline::FormatGhostJson | ( | const nlohmann::ordered_json & | json | ) |
Write the JSON of a recording with each frame on one line.
| json | The JSON of GhostToJson(). |
| std::optional< std::vector< u8 > > coastline::PackGhostNote | ( | std::span< const u8 > | recording | ) |
Compress a recording into the note of a ghost car, as SaveSaveLoadNote() of the console does: each of the two channels of the recording (the steering and the actions) with run lengths, and the length of each channel first in the byte order of the console.
The rest of the note is zero.
| recording | The recording, its header included. |
| std::optional< std::vector< u8 > > coastline::UnpackGhostNote | ( | std::span< const u8 > | note | ) |
Expand the note of a ghost car into its recording.
| note | The note. |
| std::vector< u8 > coastline::PackGhostFrames | ( | std::span< const u8 > | recording, |
| std::span< const u8 > | frames ) |
Store the frames of the race engine with the recording of the console they were recorded with.
| recording | The recording of the console. |
| frames | The frames, GHOST_FRAME_SIZE bytes each. |
| std::optional< std::vector< u8 > > coastline::GhostFramesFor | ( | std::span< const u8 > | file, |
| std::span< const u8 > | recording ) |
Read the frames of the race engine of a recording of the console from the file of PackGhostFrames().
| file | The file. |
| recording | The recording of the console. |
| bool coastline::SaveGhostFrames | ( | const std::filesystem::path & | path, |
| std::span< const u8 > | recording, | ||
| std::span< const u8 > | frames ) |
Atomically write the payload of PackGhostFrames() with a verified integrity header.
| path | The file. |
| recording | The recording of the console. |
| frames | The frames, GHOST_FRAME_SIZE bytes each. |
| std::optional< std::vector< u8 > > coastline::LoadGhostFrames | ( | const std::filesystem::path & | path, |
| std::span< const u8 > | recording ) |
Read the frames of a recording from the file of SaveGhostFrames().
| path | The file. |
| recording | The recording of the console. |
| std::expected< GltfDocument, std::string > coastline::ReadGltfDocument | ( | const std::filesystem::path & | path | ) |
Read a model or image-override document.
A sibling .gltf takes precedence over .glb, including when the .gltf is invalid. Embedded images remain in their buffer views.
| path | The document path, with either extension. |
| SDL_GPUTexture * coastline::CreateGpuTexture | ( | SDL_GPUDevice * | device, |
| const SDL_GPUTextureCreateInfo * | info ) |
SDL_CreateGPUTexture(), recording bytes of every level and sample in GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| info | The texture to create. |
| SDL_GPUBuffer * coastline::CreateGpuBuffer | ( | SDL_GPUDevice * | device, |
| const SDL_GPUBufferCreateInfo * | info ) |
SDL_CreateGPUBuffer(), recording its size in GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| info | The buffer to create. |
| SDL_GPUTransferBuffer * coastline::CreateGpuTransferBuffer | ( | SDL_GPUDevice * | device, |
| const SDL_GPUTransferBufferCreateInfo * | info ) |
SDL_CreateGPUTransferBuffer(), recording its size in GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| info | The transfer buffer to create. |
| void coastline::ReleaseGpuTexture | ( | SDL_GPUDevice * | device, |
| SDL_GPUTexture * | texture ) |
SDL_ReleaseGPUTexture(), subtracting its bytes from GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| texture | A texture of CreateGpuTexture(), or null. |
| void coastline::ReleaseGpuBuffer | ( | SDL_GPUDevice * | device, |
| SDL_GPUBuffer * | buffer ) |
SDL_ReleaseGPUBuffer(), subtracting its bytes from GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| buffer | A buffer of CreateGpuBuffer(), or null. |
| void coastline::ReleaseGpuTransferBuffer | ( | SDL_GPUDevice * | device, |
| SDL_GPUTransferBuffer * | buffer ) |
SDL_ReleaseGPUTransferBuffer(), subtracting its bytes from GpuWindow::GpuMemoryBytes().
| device | The GPU device. |
| buffer | A transfer buffer of CreateGpuTransferBuffer(), or null. |
| std::optional< IconSize > coastline::ParseIconName | ( | std::string_view | name | ) |
Read the size of an image of the icon from the name the import gives its PNG file.
| name | The file name, such as 32x32x4.png. |
| std::string coastline::IconName | ( | const IconSize & | size | ) |
Give the name of the PNG file of an image of the icon.
| size | The size of the image. |
| std::vector< IconEntry > coastline::ListIconImages | ( | std::span< const std::uint8_t > | icon | ) |
List the images of an icon file.
An entry that records 0 bits per pixel takes the bits per pixel of its bitmap, or 32 for a PNG image.
| icon | The bytes of the icon file, which must outlive the entries. |
| std::optional< IconPixels > coastline::DecodeIconBitmap | ( | std::span< const std::uint8_t > | image | ) |
Decode an icon image that is a device-independent bitmap: the colours, then the AND mask that makes a pixel transparent.
A 32-bit image with any alpha takes its alpha in place of the mask.
| image | The bitmap, from its BITMAPINFOHEADER, with the height of the colours and the mask together. |
| bool coastline::NormalizeRomByteOrder | ( | std::span< std::uint8_t > | image | ) |
Convert a cartridge image in any of the three byte orders (z64, v64, n64) to big-endian.
| image | The image, converted in place. |
| std::expected< RomRelease, std::string > coastline::IdentifyRom | ( | std::span< const std::uint8_t > | image | ) |
Identify a big-endian cartridge image by its SHA-1.
| image | The big-endian image. |
| std::expected< RomRelease, std::string > coastline::IdentifyRomFile | ( | const std::filesystem::path & | image | ) |
Identify a cartridge image file in any of the three byte orders by its SHA-1.
| image | The cartridge image. |
| std::expected< RomRelease, std::string > coastline::ImportRom | ( | const std::filesystem::path & | image, |
| const std::filesystem::path & | dataDirectory, | ||
| const ImportProgress & | progress = {} ) |
Check a cartridge image and extract its main segment and its assets, inflated, to n64/usa, n64/jpn, n64/eur, or n64/asia under dataDirectory.
The cartridge also provides XM modules in music when music/menu.xm does not exist.
| image | The cartridge image. |
| dataDirectory | The directory of the pack to write, assets/default of the data directory. |
| progress | Reports extraction and conversion progress, or empty. Return false to cancel. |
| std::expected< std::vector< CueTrack >, std::string > coastline::ParseCueSheet | ( | const std::filesystem::path & | cue | ) |
Parse a CUE sheet.
Track extents end at the INDEX 00 or INDEX 01 of the next track in the same file, or at the end of the file.
| cue | The CUE sheet. |
| std::expected< std::size_t, std::string > coastline::ImportDisc | ( | const std::filesystem::path & | disc, |
| const std::filesystem::path & | dataDirectory, | ||
| const ImportProgress & | progress, | ||
| std::vector< std::filesystem::path > * | sources = nullptr ) |
Copy the files of the Boss Rally disc the game opens to dataDirectory, and its CD audio tracks as music/trackNN.flac.
An ISO image or mounted disc directory provides only data files. The icon Boss.ico moves to icon/coastline.ico, beside a PNG image of each of its sizes.
| disc | A mounted disc directory, CUE sheet, ISO, BIN, numbered Track NN.bin file, CloneCD, DiscJuggler CDI, Nero NRG, Alcohol MDS, BlindWrite 4/5/6, PDI, or unencrypted ISZ image. Adjacent CUE metadata precedes known-dump and discovered BIN layouts. Uncertain audio layouts import data only. |
| dataDirectory | The directory of the pack to write, assets/default of the data directory. |
| progress | Called as each file and track is written, or empty. |
| sources | Receives original input files and searched directories on success, or null. |
progress cancels the import. | std::optional< std::string > coastline::CheckDisc | ( | const std::filesystem::path & | disc | ) |
Check that a disc image or directory provides Boss Rally files without copying them.
| disc | A mounted disc directory, CUE sheet, ISO, BIN, numbered track file, or CloneCD image. |
| std::optional< std::string > coastline::RunImportJobs | ( | std::span< const ImportJob > | jobs, |
| const ImportProgress & | progress = {} ) |
Run independent jobs with at most four workers, limited by available CPU concurrency.
Progress callbacks are serialised, may run on any worker, and have a monotonic combined fraction. Cancellation and failures stop scheduling work and request active jobs to stop through progress. All workers finish before this function returns, including when a job or callback throws. A rejected progress report cancels its job regardless of the job's returned error text. A conversion failure takes precedence over cancellation of other jobs in the batch.
| jobs | Independent jobs with equal progress weights; empty input succeeds. |
| progress | Combined progress, or empty. Return false to cancel the complete batch. |
| bool coastline::RecordImport | ( | const std::filesystem::path & | defaults, |
| ImportSource | source ) |
Record in import.ini of the default pack that source was imported with the current version of its conversion.
| defaults | The directory of the default pack. |
| source | The source imported. |
| std::vector< ImportSource > coastline::StaleImports | ( | const std::filesystem::path & | defaults | ) |
The sources of the default pack imported with a conversion version different from the current one.
Source directories without version records also require a new import.
| defaults | The directory of the default pack. |
| bool coastline::DefaultPackUsable | ( | const std::filesystem::path & | defaults | ) |
Check whether import.ini records the disc and at least one cartridge at current conversion versions, the regional layout is current, and every recorded file exists at its imported size.
Require a complete inventory with a matching record count and SHA-1 digest. Required converted POD metadata and attract recordings must be available.
| defaults | The directory of the default pack. |
| bool coastline::RecordImportFiles | ( | const std::filesystem::path & | defaults | ) |
Atomically record the relative path and size of every generated file after a successful import.
A versioned header records the file count and SHA-1 of the complete inventory body.
| defaults | The directory of the default pack. |
| std::string coastline::ReimportMessage | ( | std::span< const ImportSource > | sources | ) |
| sources | The sources to import again, at least one. |
| bool coastline::SaveIndexed4Png | ( | const std::filesystem::path & | path, |
| std::span< const std::uint8_t > | texels, | ||
| std::span< const std::uint8_t, 32 > | palette, | ||
| int | width, | ||
| int | height ) |
Write a 4-bit colour-indexed image of the console as an indexed PNG image.
| path | The PNG image to write. |
| texels | The texels, two to a byte with the first in the high four bits, row by row, each row starting on a byte. |
| palette | The 16 colours, each a big-endian RGBA5551 half. |
| width | The width in texels. |
| height | The height in texels. |
| bool coastline::LoadIndexed4Png | ( | const std::filesystem::path & | path, |
| std::span< std::uint8_t > | texels, | ||
| std::span< std::uint8_t, 32 > | palette ) |
Read an indexed PNG image as the 4-bit texels and the RGBA5551 palette of the console.
| path | The PNG image. |
| texels | Receives the texels, two to a byte with the first in the high four bits, each row starting on a byte. |
| palette | Receives the 16 colours, each a big-endian RGBA5551 half. |
texels. | bool coastline::LoadIndexed4Png | ( | std::span< const std::uint8_t > | bytes, |
| std::span< std::uint8_t > | texels, | ||
| std::span< std::uint8_t, 32 > | palette ) |
Read an encoded indexed PNG with the same requirements as the file overload.
| bytes | The encoded PNG image, borrowed for this call. |
| texels | Receives packed 4-bit texels, with each row starting on a byte. |
| palette | Receives 16 big-endian RGBA5551 colours. |
texels. | bool coastline::SaveRgba8Png | ( | const std::filesystem::path & | path, |
| std::span< const std::uint8_t > | rgba, | ||
| int | width, | ||
| int | height ) |
Write 8-bit RGBA texels as a PNG image, and read it back to check it.
| path | The image to write. |
| rgba | The texels, red, green, blue, and alpha each, row by row from the top. |
| width | The width in texels. |
| height | The height in texels. |
| std::optional< std::vector< std::uint8_t > > coastline::EncodeIndexed4Png | ( | std::span< const std::uint8_t > | texels, |
| std::span< const std::uint8_t, 32 > | palette, | ||
| int | width, | ||
| int | height ) |
Encode a 4-bit colour-indexed image of the console as an indexed PNG image in memory.
| texels | The texels, two to a byte with the first in the high four bits, row by row, each row starting on a byte. |
| palette | The 16 colours, each a big-endian RGBA5551 half. |
| width | The width in texels. |
| height | The height in texels. |
| std::optional< std::vector< std::uint8_t > > coastline::EncodeRgba8Png | ( | std::span< const std::uint8_t > | rgba, |
| int | width, | ||
| int | height ) |
Encode 8-bit RGBA texels as a PNG image in memory.
| rgba | The texels, red, green, blue, and alpha each, row by row from the top. |
| width | The width in texels. |
| height | The height in texels. |
| PlayerDevices coastline::AssignedDevices | ( | std::size_t | player, |
| std::size_t | players ) |
Resolve the Player1 and Player2 keys of the Controls section against the open gamepads.
A key that is auto takes the gamepads no other key chooses, one each in the order of the players and the rest by the first player that is auto, and the keyboard goes to the first player that is auto with no gamepad, else to the first player that is auto.
| player | The player, 0 for the first. |
| players | The number of players, 1 or 2. One player takes the devices of both. |
| ControllerState coastline::ReadRacePad | ( | const PlayerDevices & | devices | ) |
Read the second player of a race as the console reads a pad: the race actions of the Controls section for each gamepad, and the keyboard bindings of the PC release for the keyboard.
| devices | The devices of the player. |
| std::int8_t coastline::ScaleStickAxis | ( | std::int16_t | axis | ) |
Scale an SDL axis of -32768 to 32767 to the range of the controller stick.
The axis has passed through the dead zone of ReadControl().
| axis | The SDL axis value. |
| void coastline::SetScriptedKeys | ( | std::vector< int > | scancodes | ) |
Add simulated key presses alongside physical keyboard input, for tests.
| scancodes | The SDL scancodes to report as down, replacing the previous list. |
| bool coastline::IsKeyDown | ( | SDL_Scancode | scancode | ) |
| scancode | The key. |
| void coastline::IgnoreKeyUntilReleased | ( | SDL_Scancode | scancode | ) |
Report a key as up to IsKeyDown() until it is released, for a key a shortcut of the window consumed, such as Enter of Alt and Enter.
| scancode | The key. |
| void coastline::SetSecondControllerState | ( | const ControllerState & | state | ) |
Set the state of the second controller the race reads for its second player, until the next call.
| state | The state of the second port. |
| int coastline::TakeMouseWheel | ( | ) |
| void coastline::ClearMouseWheel | ( | ) |
Discard the wheel of the mouse scrolled since TakeMouseWheel() last read it.
| std::expected< DecodedDisc, std::string > coastline::DecodeIsz | ( | const std::filesystem::path & | image, |
| const ImportProgress & | progress = {} ) |
Decode an unencrypted ISZ image, including split segments, to temporary storage.
Validate metadata, compressed stream lengths, and checksums when supplied by the header.
| image | First segment of an ISZ image. |
| progress | Decoding progress, or empty. Return false to cancel and discard temporary data. |
| const std::string & coastline::SelectedLanguage | ( | ) |
| StringTable coastline::MergeStrings | ( | StringTable | fallback, |
| const StringTable & | language ) |
| fallback | The strings of DEFAULT_LANGUAGE. |
| language | The strings of the selected language. |
fallback for each key the language lacks. | std::filesystem::path coastline::ReleaseDirectory | ( | const std::filesystem::path & | assets | ) |
| assets | The assets of the pack. |
| std::string coastline::CartridgeRegion | ( | const std::filesystem::path & | release | ) |
| release | The converted cartridge directory with cartridge.ini. |
| std::vector< std::string > coastline::AvailableCartridgeRegions | ( | std::span< const std::filesystem::path > | dataRoots | ) |
| dataRoots | The data directories searched for default and regional packs. |
| std::optional< std::string > coastline::TitleScreenRegion | ( | std::string_view | choice, |
| std::string_view | currentRegion, | ||
| std::span< const std::string > | available ) |
| choice | regional, japanese, or international; another value is unavailable. |
| currentRegion | The active cartridge region, assumed available. |
| available | Other available cartridge regions. |
| std::filesystem::path coastline::FontDirectory | ( | const std::filesystem::path & | assets, |
| std::string_view | language ) |
| assets | The prepared asset directory. |
| language | ja for Japanese fonts, en-gb for European fonts, or another value for USA fonts. |
| std::string coastline::AbbreviateLogPaths | ( | std::string_view | message, |
| std::string_view | home ) |
Abbreviate home-directory paths in a log message without changing similarly prefixed paths.
Windows drive and UNC paths accept either separator and match ASCII letters without case sensitivity.
| message | The formatted message, possibly including several paths. |
| home | The absolute home directory, with or without a trailing separator. Empty and single-character directories disable abbreviation. |
| void coastline::StopGameLog | ( | ) |
Close the active game log and restore its previous callback before fatal process exit.
| int coastline::CenterLines | ( | std::string_view | text, |
| int | y, | ||
| int | lines, | ||
| int | lineHeight ) |
Centre a string on the place of a block of a number of lines, as a release that draws a message in fewer lines than the USA release centres it.
| text | The string, with a newline between lines. |
| y | The baseline of the first line of the block. |
| lines | The lines of the block. |
| lineHeight | The distance between the baselines of two lines. |
| void coastline::PublishN64Volumes | ( | ) |
Hand the volumes the game writes (g_bBgmVolume, g_bMusicVolume, g_bSfxMasterVolume, and g_bSfxVolume) to the mixers.
The mixers read the copy, and the game calls this once a frame.
| std::expected< N64Demo, std::string > coastline::RecordN64AttractDemo | ( | std::span< const std::uint8_t > | rom, |
| N64DemoRelease | release ) |
Record the attract demo of a cartridge.
| rom | The image, in the byte order of the console. |
| release | The release of the image. |
| std::expected< GltfModel, std::string > coastline::CarModelToGltf | ( | std::span< const std::uint8_t > | bytes, |
| std::size_t | imageOffset, | ||
| std::string_view | bufferUri ) |
Describe the model of a car as glTF.
The document has a scene for each level of detail, with a mesh for each display list of the body and the wheels at their places. Every vertex the display lists load appears once, in the order of the file, and the bytes of the file outside the vertices are retained in the buffer for ModelFromGltf().
| bytes | The file, a header of imageOffset bytes followed by the image of the model as the console loads it at 0x803c8000. |
| imageOffset | The size of the header before the image, 0x8000 for a .rca file of the PC release and 0 for a model of the cartridge. |
| bufferUri | The URI the document gives its buffer. |
| std::expected< GltfModel, std::string > coastline::TrackToGltf | ( | std::span< const std::uint8_t > | bytes, |
| std::string_view | bufferUri ) |
Describe a track as glTF.
The document has one scene, with a node for each placed model at its place, and the sky as a node outside the scene. The bytes of the file outside the vertices are retained in the buffer for ModelFromGltf(), the textures of the bank after the geometry among them.
| bytes | The file, the image of the geometry as the console loads it at 0x80025c00, followed by the textures that stream from it. |
| bufferUri | The URI the document gives its buffer. |
| std::expected< GltfModel, std::string > coastline::FrontEndModelToGltf | ( | std::span< const std::uint8_t > | bytes, |
| std::string_view | bufferUri ) |
Describe a model of the front end, such as a logo of the splash screens, as glTF.
The document has one scene, with a node for each part at its place. Each key of each animation of the vertices is a morph target of every mesh, and the animation blends from each key to the next, with the flags and the span of time the game plays it by in its extras. The bytes of the file outside the vertices are retained in the buffer for ModelFromGltf().
| bytes | The model as it inflates from the cartridge, its offsets from its first byte. |
| bufferUri | The URI the document gives its buffer. |
| std::expected< std::vector< std::uint8_t >, std::string > coastline::ModelFromGltf | ( | const nlohmann::ordered_json & | json, |
| std::span< const std::uint8_t > | buffer ) |
Build the file of a model or a track from its glTF, the inverse of CarModelToGltf(), TrackToGltf(), and FrontEndModelToGltf().
The vertices come from the accessors of the document.
| json | The document. |
| buffer | The bytes of its buffer. |
| bool coastline::ValidSavedRaceTime | ( | float | seconds | ) |
Check that a saved race time is finite, non-negative, and safe to display in signed hundredths.
| seconds | Saved time in seconds; zero represents an unset record. |
| bool coastline::ValidOptionsNote | ( | std::span< const std::uint8_t > | note, |
| const NoteEquipmentCounts & | counts ) |
Validate native options-note length, volume levels, units, and equipment indices.
| note | Native Controller Pak payload. |
| counts | Available equipment choices in the active menu. |
| bool coastline::ValidSeasonNoteValues | ( | std::span< const std::uint8_t > | note, |
| const NoteEquipmentCounts & | counts ) |
Validate native season-note length, times, placements, and equipment indices.
Season, round, and unlock availability must also be checked against the active championship.
| note | Native Controller Pak payload. |
| counts | Available equipment choices in the active menu. |
| bool coastline::ValidGhostRecording | ( | std::span< const std::uint8_t > | recording, |
| std::size_t | tracks, | ||
| std::size_t | cars, | ||
| const NoteEquipmentCounts & | counts ) |
Validate an expanded console ghost's length, track, car, and equipment header.
| recording | Expanded header and paired steering/action bytes. |
| tracks | Number of available tracks. |
| cars | Number of available cars. |
| counts | Available equipment choices in the active menu. |
|
inline |
| path | A native filesystem path. |
| bool coastline::PortablePathsEnabled | ( | ) |
| std::filesystem::path coastline::PortableRoot | ( | const std::filesystem::path & | executable, |
| const std::filesystem::path & | appImage = {} ) |
Locate portable files beside an application bundle, AppImage, or ordinary executable.
| executable | Absolute base directory reported by SDL. |
| appImage | Absolute AppImage filename, or empty for other distributions. |
executable for other layouts. | std::expected< GamePaths, std::string > coastline::ResolvePortablePaths | ( | const GamePaths & | fallback, |
| const std::filesystem::path & | executable, | ||
| const std::filesystem::path & | workingDirectory = {} ) |
Prefer adjacent configuration and assets independently when portable lookup is enabled.
| fallback | Platform directories used for absent adjacent files. |
| executable | Absolute portable directory of the application distribution. |
| workingDirectory | Launch directory checked after the distribution, including its CoastlineData child, or empty to omit it. |
| std::filesystem::path coastline::StorePortablePath | ( | const std::filesystem::path & | path, |
| const std::filesystem::path & | root, | ||
| const std::filesystem::path & | home ) |
Store an input path relative to the portable directory, using '~' for external home paths.
| path | Input path; empty and relative paths remain unchanged. |
| root | Portable directory rebuilt from the executable location on startup. |
| home | Home directory, or empty to disable home shorthand. |
| std::filesystem::path coastline::RestorePortablePath | ( | const std::filesystem::path & | path, |
| const std::filesystem::path & | root, | ||
| const std::filesystem::path & | home ) |
Rebuild a stored portable input path at its current executable or home location.
| path | Stored path, possibly relative or starting with a '~' component. |
| root | Current portable directory. |
| home | Current home directory, or empty to preserve home shorthand. |
| std::optional< GamePaths > coastline::ResolveXdgPaths | ( | const EnvironmentReader & | environment, |
| const std::string & | application ) |
Resolve the directories with the XDG Base Directory variables and their defaults under the home directory.
A relative XDG value is ignored, as the specification requires.
| environment | The source of the environment variables. |
| application | The name of the directory created under each base directory. |
| std::optional< GamePaths > coastline::ResolveGamePaths | ( | const std::string & | application | ) |
Resolve the directories with the conventions of the running operating system: the XDG Base Directory variables on Linux and the BSDs, the folders of the user's library on macOS, and the roaming and local application data folders on Windows.
| application | The name of the directory created under each base directory. |
| std::vector< std::filesystem::path > coastline::SystemDataDirectories | ( | const std::filesystem::path & | executable | ) |
List system data roots, including the relocated installation and platform defaults.
| executable | The directory of the executable, or empty to omit relative roots. |
| std::optional< std::filesystem::path > coastline::FindAssetData | ( | const std::filesystem::path & | user, |
| std::span< const std::filesystem::path > | system ) |
Find usable assets in system roots first, then in the writable user data root.
| user | The writable user data root. |
| system | System data roots in lookup order. |
| bool coastline::CreateGamePaths | ( | const GamePaths & | paths | ) |
Create every directory of paths that does not exist.
| paths | The directories to create. |
| std::optional< std::string > coastline::MigratePortablePaths | ( | const GamePaths & | source, |
| const GamePaths & | destination, | ||
| bool | copyOnly = false ) |
Move portable assets, settings, saves, screenshots, and state to platform directories.
Derived cache is not copied and is removed only when moving the installation. Existing destination entries are never overwritten.
| source | Selected portable directories; unrelated neighbouring files are preserved. |
| destination | Normal platform directories, outside the portable source trees. |
| copyOnly | Whether to preserve the portable installation after copying. |
| std::optional< std::string > coastline::MakePortablePaths | ( | const GamePaths & | source, |
| const std::filesystem::path & | directory, | ||
| bool | copyOnly = false ) |
Export platform data as a portable installation, without copying the executable.
Existing destination entries are never overwritten. Derived cache is regenerated.
| source | Normal platform directories with imported assets and BossRally.ini. |
| directory | Absolute destination directory for assets, settings, and state. |
| copyOnly | Whether to preserve platform data after copying. |
| std::optional< std::string > coastline::MakePortableDistribution | ( | const GamePaths & | source, |
| const std::filesystem::path & | executable, | ||
| const std::filesystem::path & | directory, | ||
| bool | copyOnly = false ) |
Export installed program files and platform data into a complete portable distribution.
Bundles use CoastlineData beside the copied bundle; bin packages store data at their root. Source program files are preserved. Data is removed only after publishing the completed copy.
| source | Normal platform directories with imported assets and BossRally.ini. |
| executable | Absolute SDL base directory within an installed bundle or bin directory. |
| directory | New absolute parent directory for the complete portable distribution. |
| copyOnly | Whether to preserve platform data after copying. |
| std::optional< std::string > coastline::ResetGamePaths | ( | const GamePaths & | paths, |
| bool | factoryReset = false ) |
Clear imported assets and asset caches, or all application data for a factory reset.
| paths | Absolute, non-root application directories whose generated data is removed. |
| factoryReset | Whether to remove all four directories, including settings and saves. |
|
inline |
The directory the import writes the game data to, the default pack.
A mod pack is a directory beside it under assets.
| data | The data directory of the game. |
| std::filesystem::path coastline::PackDirectory | ( | const std::filesystem::path & | data, |
| std::string_view | pack, | ||
| const std::filesystem::path & | fallback = {} ) |
The directory of a pack under assets of the data directory, named after the pack.
| data | The data directory of the game. |
| pack | The name of the pack. |
| fallback | Another data root used when data lacks the pack directory, or empty. |
| std::optional< std::filesystem::path > coastline::PackAssets | ( | const std::filesystem::path & | data, |
| const std::filesystem::path & | cache, | ||
| std::string_view | pack, | ||
| const std::filesystem::path & | fallback = {}, | ||
| std::string_view | region = {} ) |
The directory the game reads its assets from with a pack selected.
Duplicate-file aliases are expanded under cache before layering. Without aliases, the default pack is read in place. Another pack is layered over the default pack in a directory under cache. An entry of the pack replaces the entry of the same name in the default pack, and a directory in both is layered in turn. Each entry is a link to the file or the directory it comes from, or a copy where the file system has no links. The directory is made again only when the path or the write time of an entry of either pack differs from the stamp recorded in it, or the stamp is missing.
| data | The data directory of the game. |
| cache | The cache directory of the game. |
| pack | The name of the pack. |
| fallback | Another data root searched for the selected pack, or empty. Default assets still come from data. |
| region | A regional difference pack applied before pack, or empty for the base region. |
| std::expected< DecodedDisc, std::string > coastline::DecodePdi | ( | const std::filesystem::path & | image, |
| const ImportProgress & | progress = {} ) |
Decode a Pinnacle InstantCopy PDI image to temporary storage.
Support cooked data, raw data and audio, scrambled data, and interleaved subchannels.
| image | PDI image with a 304-byte container header. |
| progress | Decoding progress, or empty. Return false to discard temporary data and cancel. |
|
inline |
Match the active adapter to one provider device, rejecting absent and ambiguous identities.
| active | The active adapter identifier, compared exactly. |
| devices | The provider identifiers in device-index order. |
|
inline |
| text | A line of /proc/self/statm. |
|
inline |
| text | The contents of /proc/self/smaps. |
| executable | The path of the program, as /proc/self/exe links to it. |
| void coastline::OpenRaceData | ( | bool | playSounds | ) |
Set the default configuration, the bindings, and the strings of the race, and open its sound, as the PC release does once at its start.
The models of BossRally.pod load from its import. The working directory is the directory of the default assets.
| playSounds | Whether the race plays its sound effects. |
| bool coastline::StartRaceMusic | ( | const std::filesystem::path & | directory, |
| RaceMusicSource | source, | ||
| int | musicTrack = -1 ) |
Add a user of the music of the races, as the PC release opens its music device.
The first user finds the tracks and opens the playback device, when the game plays music.
| directory | The directory of the music files. |
| source | Where the music comes from. |
| musicTrack | The engine track selecting XM music, or -1 for the current race track. PC CD selection ignores this parameter. |
| void coastline::StopRaceMusic | ( | ) |
Drop a user of the music of the races.
The last user stops the music of the CD and closes its device. A shared player of the menus then plays the module of the track on, as the console plays it on the screens after a race.
| void coastline::ShutdownRaceMusic | ( | ) |
Release all race music resources regardless of active users, before SDL audio shuts down.
| void coastline::RestartRaceMusic | ( | ) |
Play the track of the race from its start, with the device of the music resumed.
| void coastline::ShareRaceMusicPlayer | ( | N64Audio * | audio | ) |
Play the modules of the races through the player of the music of the menus, which mixes the channels of the console, instead of a player of their own.
Two players would mix the same channels on two threads.
| audio | The player of the menus, with its device open, or null for a player of their own. |
| std::size_t coastline::RenderRaceMusic | ( | std::size_t | frames | ) |
Render frames of the track that plays, without a device, for tests.
| frames | The stereo frames. |
| std::array< int, 2 > coastline::RaceVolumeLevels | ( | ) |
| int coastline::RaceTrack | ( | ) |
| std::vector< RaceCar > coastline::RaceCars | ( | ) |
| float coastline::RaceFieldOfView | ( | float | fovy, |
| float | aspect, | ||
| float | scale = 1.0f ) |
The vertical field of view of a view of the race on a frame.
A frame at least as wide as 4:3 keeps the vertical field and widens across, and a narrower frame keeps the field across of 4:3 and grows the vertical field. Neither field exceeds 120 degrees, and past the widest field across the vertical field shrinks.
| fovy | The vertical field in radians of the view on the 4:3 screen of the PC release, before the configured multiplier. |
| aspect | The width of the view over its height on the frame. |
| scale | The field multiplier, with non-positive values treated as 1. |
| std::optional< std::vector< std::uint8_t > > coastline::ReadWholeFile | ( | const std::filesystem::path & | path | ) |
Reads a whole file with one read of its size.
| path | The file. |
| std::expected< Script, ScriptError > coastline::ParseScript | ( | std::string_view | text | ) |
Read a script of run-script: one command a line, with # starting a comment and blank lines ignored.
A line that starts with a frame number acts at that frame, and the lines autopilot and screenshot-every N take no frame and apply from the start.
| text | The text of the script. |
| std::optional< std::vector< std::uint8_t > > coastline::ReadSaveFile | ( | const std::filesystem::path & | path, |
| std::size_t | limit ) |
Read a complete regular file without allocating beyond a caller-supplied limit.
| path | File to read. Concurrent atomic replacement preserves the opened contents. |
| limit | Maximum accepted length in bytes. |
| bool coastline::WriteSaveFile | ( | const std::filesystem::path & | path, |
| std::span< const std::uint8_t > | bytes ) |
Lock and atomically replace a binary save.
| path | Destination file. |
| bytes | Complete new contents. |
| bool coastline::WriteSaveFile | ( | const std::filesystem::path & | path, |
| std::string_view | text ) |
Lock and atomically replace a text save.
| path | Destination file. |
| text | Complete new contents, written without newline conversion. |
| std::optional< std::vector< std::uint8_t > > coastline::ReadVerifiedSaveFile | ( | const std::filesystem::path & | path, |
| std::size_t | limit, | ||
| bool | resetInvalid = true, | ||
| const SavePayloadValidator & | validate = {} ) |
Read an internal binary save with its format signature, payload length, and SHA-1 checksum.
Exclude cooperating writers while validating and optionally removing damaged or oversized saves. Unreadable files are preserved when their size cannot prove corruption.
| path | Internal save file; native interchange files and editable INI files are excluded. |
| limit | Maximum payload size in bytes, excluding the integrity header. |
| resetInvalid | Remove damaged saves; disable when scanning possibly unrelated files. |
| validate | Optional format-specific validator, called after the checksum passes. |
| bool coastline::WriteVerifiedSaveFile | ( | const std::filesystem::path & | path, |
| std::span< const std::uint8_t > | bytes ) |
Atomically write an internal binary save with a format signature, length, and SHA-1 checksum.
The payload and integrity header are replaced together under the save's process lock.
| path | Internal save file, with parent directories created as needed. |
| bytes | Complete binary payload. |
| a | The matrix applied second. |
| b | The matrix applied first. |
| std::optional< MorphPose > coastline::PoseAtTime | ( | const VertexAnimationInfo & | animation, |
| float | time ) |
The pose of a vertex animation at a time, as the console blends its keys.
| animation | The animation. |
| time | The time of the animation, in seconds. |
| std::map< unsigned, std::string > coastline::ReadLibraryStrings | ( | std::span< const std::uint8_t > | image | ) |
Read the string resources of a Windows library.
| image | The bytes of the library file. |
| void coastline::AppendUtf8 | ( | std::string & | text, |
| char32_t | c ) |
Append a code point to UTF-8 text.
| text | The UTF-8 text. |
| c | The code point. |
| char32_t coastline::NextCodePoint | ( | std::string_view | text, |
| std::size_t & | position ) |
Decode the code point of UTF-8 text at a position, and step past it.
A sequence cut short by the end of the text decodes from the bytes it has.
| text | The UTF-8 text. |
| position | The byte of the code point, moved to the byte after it. |
| const std::string * coastline::FindString | ( | std::string_view | key | ) |
| key | The key of a string, such as 1 or n64.carSelect.rumblePakNote. |
| std::string_view coastline::GameString | ( | std::string_view | key | ) |
| key | The key of a string, such as n64.carSelect.rumblePakNote. |
key when neither file has it, logged the first time.
|
constexpr |
| track | The zero-based track-selection index. |
|
constexpr |
| track | The PC race-engine track index. |
| int coastline::LoadedTextureMapEntries | ( | ) |
| unsigned coastline::ConvertedVertexCount | ( | ) |
| std::vector< std::array< float, 3 > > coastline::CarDentOffsets | ( | const VehicleModel * | model, |
| std::span< const std::array< float, 3 > > | rest ) |
How far DeformVehicleMeshByImpact() has moved each vertex of a car from where it rested when the car loaded, by the position it rested at.
| model | The model of the car. |
| rest | The position each vertex rests at, in the units of the model. |
rest, or nothing when the car has no dent. | std::expected< GltfModel, std::string > coastline::TrackPreviewToGltf | ( | const GltfModel & | track, |
| std::string_view | bufferUri ) |
Generate a static menu miniature from a converted track during import.
Instance transforms are flattened, sky geometry is omitted, convex planar openings are capped, exposed terrain edges extend to the base, and attribute-aware simplification reduces detail. Average texture colours become vertex colours; the result does not require external images.
| track | The complete result of TrackToGltf(), including decoded images. |
| bufferUri | The relative URI of the generated binary buffer. |
| std::optional< std::string > coastline::ConvertIntroMedia | ( | const std::filesystem::path & | directory, |
| const ImportProgress & | progress = {} ) |
Convert optional disc intro media.
Linux uses libav directly. Windows and macOS use a temporary FFmpeg executable when one is absent from PATH.
| directory | The extracted disc assets, including optional brally.avi and splash.img. |
| progress | Progress and cancellation callback, or empty. |
|
constexpr |
| level | A level of the options menu. |
|
constexpr |
The level of the options menu after the pause menu of a race changed the level of the race engine.
| raceLevel | The level of the race engine as the race ended. |
| level | The level of the options menu the race started at. |
level when RaceVolumeLevel() gives raceLevel for it, else the highest level of the options menu RaceVolumeLevel() gives raceLevel for. | void coastline::AttachParentConsole | ( | ) |
Attach to an existing parent console and reconnect unavailable standard streams.
Redirected streams are preserved. A console window is never allocated.
| std::optional< std::string > coastline::VisitZipEntries | ( | const std::filesystem::path & | archive, |
| const std::function< bool(const std::string &, std::uint32_t)> & | accept, | ||
| const std::function< bool(const std::string &, std::vector< std::uint8_t > &)> & | visit, | ||
| const std::function< bool(const std::string &, double)> & | progress = {} ) |
Visit CRC-checked stored and deflated entries in a ZIP archive without extracting archive paths.
| archive | The ZIP archive. |
| accept | Receive the path and unpacked size of an entry. Return true to unpack it. |
| visit | Process the path and unpacked bytes of an accepted entry. Return false to stop. |
| progress | Report entry progress, or empty. Return false to stop. |
| std::optional< std::string > coastline::VisitZipRoms | ( | const std::filesystem::path & | archive, |
| const std::function< bool(std::vector< std::uint8_t > &)> & | visit, | ||
| const std::function< bool(const std::string &, double)> & | progress = {} ) |
Visit CRC-checked ROM entries in a ZIP archive without extracting archive paths.
| archive | The ZIP archive. |
| visit | Process unpacked entry bytes. Return false to stop. |
| progress | Report entry progress, or empty. Return false to stop. |
|
inlineconstexpr |
The name of the pack of the PC images the default pack replaces with branded images.
|
inlineconstexpr |
The version of pack.json the import writes.
|
inlineconstexpr |
The gain of the music modules of the default pack, as they play quieter than the CD audio.
|
inlineconstexpr |
The alias-table filename for logical paths and their physical backing files.
|
extern |
The messages the Japanese release draws in Japanese and the messages the other releases draw in their place, then the messages of the race that a string of BRString.dll draws in the PC release, paired across the releases by the code that draws them.
A message without lines in a release is absent from that release.
|
extern |
The messages of the console that name the Controller Pak where the game saves to a folder, as the import writes them to strings/en-us.json with the text of the USA cartridge.
Every other language takes them from there.
|
inlineconstexpr |
The number of strings of BRString.dll, numbered from 1.
|
extern |
The key of each string of BRString.dll, by its number less 1.
The import writes the string under the key, and GetStringResource() of the race reads it from there. A key of the race (race.) is also in CONSOLE_STRINGS, where the PC and the Nintendo 64 releases draw the same text in the same place, and every other key (pc.) is the PC release's alone.
|
inlineconstexpr |
The number of controller ports of the console.
|
inlineconstexpr |
The bytes of a page of a Controller Pak, the unit a note takes its room in.
|
inlineconstexpr |
The pages of a Controller Pak free for notes.
|
inlineconstexpr |
The notes a Controller Pak has room for.
|
inlineconstexpr |
The note of the settings of the options menu, stored with the settings of the game.
|
inlineconstexpr |
The bytes of the image of a Controller Pak, as emulators and the tools of a pak store one.
|
inlineconstexpr |
The keys of the Controls section, by ControlAction.
|
inlineconstexpr |
The key of the Controls section that chooses a preset.
|
inlineconstexpr |
The key of the Controls section with the share of the travel of an axis that reads as 0.
|
inlineconstexpr |
The keys of the Controls section that choose the input device of each player.
|
inlineconstexpr |
The preset of an absent or unknown Preset key.
|
inlineconstexpr |
The actions of a race, from CONTROL_STEER_LEFT to CONTROL_CHASE_CAMERA.
|
inlineconstexpr |
The presets the Preset key chooses from, the first the default.
Kart follows Mario Kart 8 on the Pro Controller, with the east button for accelerate and A of the menus, and the south button for brake and B of the menus.
The five after Kart are the button layouts of the controller screen of the Nintendo 64 release, as TranslateControllerInput() of the console reads them, with A of the console on the south button, B on the east, Z on the left trigger, L and R on the shoulders, and the C buttons on the right stick. An action of the console that needs two buttons at once has the second alone: down reverses without A, and the e-brake of A and B, or of C down in TypeB, has no binding.
|
inlineconstexpr |
The magnitude of a button held down or of an axis at its end.
|
inlineconstexpr |
The decals of a car, each the texture of the material of the same number.
|
inlineconstexpr |
The materials of a car whose palettes the colour of the car paints.
|
inlineconstexpr |
The material whose palette is the paint, saved with the decals.
|
inlineconstexpr |
The material whose palette is the headlights.
|
inlineconstexpr |
The material whose palette is the rear lights.
|
inlineconstexpr |
Disc images, track metadata, and companion files accepted by the importer.
|
inlineconstexpr |
The number of supported ROM releases.
|
inlineconstexpr |
The width of the grid in pixels, 640.
|
inlineconstexpr |
The height of the grid in pixels, 400.
|
inlineconstexpr |
The columns of the grid.
|
inlineconstexpr |
The rows of the grid.
|
inlineconstexpr |
The width of a cell in pixels.
|
inlineconstexpr |
The height of a cell in pixels.
|
inlineconstexpr |
The red, green, and blue of each colour of CGA, by its number.
|
inlineconstexpr |
The glyph drawn for a character code page 437 does not have.
|
constexpr |
A quarter turn in radians, in the single precision of the console.
|
constexpr |
A half turn in radians, in the single precision of the console.
|
constexpr |
A whole turn in radians, in the single precision of the console.
|
constexpr |
The low-resolution screen of the console, in pixels.
|
constexpr |
The height of the low-resolution console screen, in pixels.
|
constexpr |
The silence after each sound, for the mixer to read zeros past its end.
|
constexpr |
The 32.32 step that plays a sample at its own rate.
|
constexpr |
The volume of the sound effects at full level.
|
constexpr |
The previous cycle's result as an RDP colour-combiner input.
|
constexpr |
The first sampled texel as an RDP colour-combiner input.
|
constexpr |
The second sampled texel as an RDP colour-combiner input.
|
constexpr |
The primitive colour as an RDP colour-combiner input.
|
constexpr |
The interpolated vertex colour as an RDP colour-combiner input.
|
constexpr |
The environment colour as an RDP colour-combiner input.
|
constexpr |
The zero selector for the A and B RDP colour-combiner operands.
|
constexpr |
The zero selector for the D RDP colour-combiner operand.
|
constexpr |
The zero selector for an RDP alpha-combiner operand.
|
inlineconstexpr |
The parts of a car RenderVehicleModel() draws in the menus: the near detail, the textured parts, the painted body, and the normal wheels.
The underside shows only from below.
|
extern |
The lights RenderVehicleModel() lights a car with in the menus: g_DefaultLights, from (84, 84, 84), in the colours of SetupWeatherLights() in clear weather.
|
inlineconstexpr |
The size of the note of a ghost car, 58 pages.
|
inlineconstexpr |
The capacity of the recording of the console, its header included.
|
inlineconstexpr |
The music modules of the USA cartridge: the menus, then the modules of the tracks.
The table of the tracks also lists 0x19BC10 for track 10, a sound sample rather than a module.
|
inlineconstexpr |
The version of the conversion of the Boss Rally disc: the cars, the tracks, the images, and the other files ImportDisc() converts, n64model.cpp included.
Increase it with every change to the output of the conversion, so that the game warns about data imported before the change.
|
inlineconstexpr |
The version of the conversion of a Top Gear Rally cartridge: the models, the images, the music, and the other files ImportRom() converts, n64model.cpp included.
Increase it with every change to the output of the conversion, so that the game warns about data imported before the change.
|
inlineconstexpr |
The language unless the configuration or the command line selects another.
|
constexpr |
The flag of an item whose up and down change it in place, as MenuResult::Up and Down.
|
constexpr |
The flag of an item chosen at once, without fading the screen out.
|
constexpr |
The flag of an item drawn as its model spinning round as the items slide.
|
constexpr |
The flag of an item that cannot be chosen, whose screen explains why.
|
constexpr |
The flag of an item whose model is drawn mirrored.
|
constexpr |
The flag of an item only the first player may choose.
|
constexpr |
The flag of an item that cannot be chosen, without a reason shown.
|
inlineconstexpr |
The sample rate of the imported music, in stereo frames per second.
|
inlineconstexpr |
The name of the asset pack of the import, the directory assets/default.
|
inlineconstexpr |
The states of F in g_bShowFpsCounter: 0 for off, 1 for the frame rate, and 2 for both.
|
inlineconstexpr |
The state of F in g_bShowFpsCounter that shows the statistics beside the frame rate.
|
constexpr |
Track record slots in race-engine order, including the SDL Bonus Track.
|
constexpr |
The most laps of a race the results record.
|
inlineconstexpr |
The frames a press of a button or a key lasts when its line gives no number.
|
inlineconstexpr |
The matrix that changes nothing.
|
inlineconstexpr |
The ambient colours of a ramped instance of a track on a clear day, from 0 to 1.
|
inlineconstexpr |
The most shadows of cars that fall on an instance of a track.
|
constexpr |
The number of sides of a car that take damage, as IncrementDamageTextureLevel() counts them.
|
constexpr |
The levels of damage of a car after the first, as LoadCarPaintTextures() makes them.
|
inlineconstexpr |
Five console tracks and their five mirrored variants precede additional tracks.
|
inlineconstexpr |
PC-only track entries; Season Champion (gamewin) remains indexed but unavailable for ordinary selection.
|
inlineconstexpr |
The number of track entries before menu actions, including unavailable entries.
|
inlineconstexpr |
The loudest level of the options menu.
|
inlineconstexpr |
The loudest level of the race engine.