coastline 0.0.4
Loading...
Searching...
No Matches
controllerpak.h File Reference

The Controller Pak of the first controller of the console as a directory of the game, a file for each note, named after the note. More...

#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <optional>
#include <span>
#include <string>
#include <vector>
#include "savefile.h"
Include dependency graph for controllerpak.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  coastline::PakNote
 A note of a Controller Pak. More...
class  coastline::ControllerPak
 The notes of a Controller Pak, stored in a directory, with the settings note in another. More...

Namespaces

namespace  coastline

Enumerations

enum class  coastline::PakRelease { coastline::Usa , coastline::Eur , coastline::Jpn }
 The release of the cartridge whose game code and company code the notes of an image take. More...

Functions

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.
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.

Variables

constexpr std::size_t coastline::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 coastline::PAK_PAGES = 123
 The pages of a Controller Pak free for notes.
constexpr std::size_t coastline::PAK_NOTES = 16
 The notes a Controller Pak has room for.
constexpr std::string_view coastline::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 coastline::PAK_IMAGE_BYTES = 0x8000
 The bytes of the image of a Controller Pak, as emulators and the tools of a pak store one.

Detailed Description

The Controller Pak of the first controller of the console as a directory of the game, a file for each note, named after the note.

Internal files include a verified integrity header; native Controller Pak images retain their original format during import and export.