Jazz2::AssetPacker::N64Content class

Turns a converted content tree into the formats the Nintendo 64 plays natively.

The console streams its audio from the cartridge through libdragon's RSP mixer and plays its cinematics with libdragon's RSP-assisted video decoder, and all three of those read formats of libdragon's own. They are produced here with libdragon's converters (audioconv64, videoconv64, which needs ffmpeg), so a tree made for this console is exactly what goes into the ROM:

  • Every sound effect leaves the package and becomes a .wav64 file of its own under Animations/, VADPCM the mixer streams from the cartridge and decodes on the RSP while it plays - nothing is decoded into the console's RAM.
  • Music in the game's own Galaxy format is translated into XM (see ModuleConverter) and then into .xm64, whose instruments stream from the cartridge as well; an XM track goes straight to .xm64. Tracks in the other tracker formats are rendered with libopenmpt, where the tool was built with it, into a looping ULC-compressed .wav64.
  • The cinematics become MPEG-1 video with their music and sound effects mixed into one audio track.

Public types

struct Tools
libdragon's converters

Public static functions

static auto FindTools(StringView hint, Tools& tools) -> bool
Locates libdragon's converters.
static auto SplitPackage(StringView sourcePak, Death::IO::PakWriter& target, StringView outputPath, StringView tempPath, const Tools& tools) -> bool
Copies a package into target, except for its sound samples, which become loose .wav64 files.
static void ConvertMusic(StringView musicPath, StringView tempPath, const Tools& tools)
Replaces every track in musicPath with its .xm64 or .wav64 equivalent.
static auto ConvertCinematic(StringView name, StringView originalsPath, StringView outputPath, StringView sourcePak, StringView musicPath, StringView tempPath, const Tools& tools) -> bool
Encodes the cinematics as full-motion video into Cinematics/ of outputPath.

Constructors, destructors, conversion operators

N64Content() deleted

Function documentation

static bool Jazz2::AssetPacker::N64Content::FindTools(StringView hint, Tools& tools)

Locates libdragon's converters.

Parameters
hint A libdragon toolchain prefix or its bin directory, or empty to use N64_INST
tools

static bool Jazz2::AssetPacker::N64Content::SplitPackage(StringView sourcePak, Death::IO::PakWriter& target, StringView outputPath, StringView tempPath, const Tools& tools)

Copies a package into target, except for its sound samples, which become loose .wav64 files.

Parameters
sourcePak A package written with a name index, so its contents can be listed
target
outputPath The content tree the .wav64 files are written into, under Animations/
tempPath Scratch directory
tools

static bool Jazz2::AssetPacker::N64Content::ConvertCinematic(StringView name, StringView originalsPath, StringView outputPath, StringView sourcePak, StringView musicPath, StringView tempPath, const Tools& tools)

Encodes the cinematics as full-motion video into Cinematics/ of outputPath.

Parameters
name
originalsPath Where the original .j2v files are
outputPath
sourcePak The name-indexed package the sound effects and playlists are read from
musicPath Where the cinematics' music (intro.j2b, ending.j2b) is, before conversion
tempPath
tools
Returns false for a cinematic that could not be encoded, which is then left for the caller to deploy in the engine's own format instead