coastline 0.0.4
Loading...
Searching...
No Matches
ghostnote.h
Go to the documentation of this file.
1#pragma once
2
15
16#include <cstddef>
17#include <filesystem>
18#include <optional>
19#include <span>
20#include <vector>
21
22#include "common/types.h"
23
24namespace coastline {
25
27inline constexpr std::size_t GHOST_NOTE_SIZE = 0x3A00;
28
30inline constexpr std::size_t GHOST_RECORDING_CAPACITY = 0xDE5C;
31
41
50
59
70 std::span<const u8> recording);
71
81 std::span<const u8> recording,
82 std::span<const u8> frames);
83
94 std::span<const u8> recording);
95
96} // namespace coastline
Definition assetimport.h:11
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.
constexpr std::size_t GHOST_NOTE_SIZE
The size of the note of a ghost car, 58 pages.
Definition ghostnote.h:27
constexpr std::size_t GHOST_RECORDING_CAPACITY
The capacity of the recording of the console, its header included.
Definition ghostnote.h:30
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().
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...
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::optional< std::vector< u8 > > UnpackGhostNote(std::span< const u8 > note)
Expand the note of a ghost car into its recording.
The integer and floating-point types of the console, for headers shared with Windows.