resonance 1.0.1
Loading...
Searching...
No Matches
RemixDirInfo Class Reference

Summary of one remix save directory, parsed out of the index file inside it. More...

#include <remixdirinfo.h>

Collaboration diagram for RemixDirInfo:

Public Member Functions

 RemixDirInfo (const HxStr &dirName, unsigned int nEntryCount)
 Record a directory the listing found, with no file number seen yet.

Static Public Member Functions

static void RaiseHighestFileNumber (std::vector< RemixDirInfo > &infos, const HxStr &dirName, unsigned int nFileNumber)
 Raise the highest file number of the first record named after a directory.
static HxStr NextPayloadFileName (const std::vector< RemixDirInfo > &infos)
 Name the payload file a new remix takes.

Public Attributes

HxStr name
unsigned int dirNumber
unsigned int entryCount
unsigned int highestFileNumber

Detailed Description

Summary of one remix save directory, parsed out of the index file inside it.

SaveRemixMCT builds a std::vector of these records at +0x3c, one per directory the listing of /BASCUS-97125r* found, and then chooses the directory the save lands in from the vector. The record is not polymorphic and emits no RTTI descriptor. No __FILE__ path is present for its translation unit, and no literal in the image identifies it. Neither the class name nor any of the four field names is attested. Every one of the four fields is recovered from the disassembly.

The record is a class with public members. SaveRemixMCT::AppendDirInfo copies a stack temporary into the vector through the implicit copy constructor.

Three routines fix the layout between them. SaveRemixMCT::AppendDirInfo at 0x00179c28 writes name, dirNumber, and entryCount and zeroes highestFileNumber. SaveRemixMCT::OnFileLoaded at 0x0017ad70 compares name against the directory being read, raises highestFileNumber to the largest file number the directory's index lists, and tests entryCount against kMaxRemixesPerDirectory. SaveRemixMCT::ChooseTargetDir at 0x00179d60 reads entryCount and dirNumber. Every comparison of the three counts is an unsigned one.

The constructor and the two static members are inline. Their out-of-line copies at 0x00186828, 0x001868b8, and 0x00186978 have no caller.

Constructor & Destructor Documentation

◆ RemixDirInfo()

RemixDirInfo::RemixDirInfo ( const HxStr & dirName,
unsigned int nEntryCount )
inline

Record a directory the listing found, with no file number seen yet.

The body assigns the number, because the image parses it after storing the entry count.

Parameters
dirNameThe directory name.
nEntryCountElements the directory's index file lists.
Ghidra address:
NTSC-U/C: 0x00186828
Ghidra address:
PAL: 0x0018c120

Member Function Documentation

◆ RaiseHighestFileNumber()

void RemixDirInfo::RaiseHighestFileNumber ( std::vector< RemixDirInfo > & infos,
const HxStr & dirName,
unsigned int nFileNumber )
inlinestatic

Raise the highest file number of the first record named after a directory.

SaveRemixMCT::OnFileLoaded() expands it once per index element.

Parameters
infosThe records.
dirNameThe directory the file number came from.
nFileNumberThe file number.
Ghidra address:
NTSC-U/C: 0x001868b8
Ghidra address:
PAL: 0x0018c1c0

◆ NextPayloadFileName()

HxStr RemixDirInfo::NextPayloadFileName ( const std::vector< RemixDirInfo > & infos)
inlinestatic

Name the payload file a new remix takes.

One past the highest file number of the first directory with room, or kFirstRemixPayloadFileName when no directory has room. SaveRemixMCT::OnListDir() and OnFileLoaded() expand it.

Parameters
infosThe records.
Returns
The file name.
Ghidra address:
NTSC-U/C: 0x00186978
Ghidra address:
PAL: 0x0018c280

Member Data Documentation

◆ name

HxStr RemixDirInfo::name

Directory name, as the card listing reported it. +0x00

◆ dirNumber

unsigned int RemixDirInfo::dirNumber

Parsed out of name at kRemixDirNumberOffset. +0x08

◆ entryCount

unsigned int RemixDirInfo::entryCount

Elements the directory's index file lists. +0x0c

◆ highestFileNumber

unsigned int RemixDirInfo::highestFileNumber

Largest decimal file name among the elements. +0x10


The documentation for this class was generated from the following file: