resonance 1.0.1
Loading...
Searching...
No Matches
albumcache.h File Reference
#include "os/hxstr.h"
Include dependency graph for albumcache.h:

Go to the source code of this file.

Functions

int IsAlbumLevel (const HxStr &name)
 Report whether a level counts toward the campaign album.
int GetAlbumLevelStage (const HxStr &name)
 Report the stage a level belongs to, reading it once and caching it.
int GetAlbumLevelValue (int nLevel, int nDifficulty)
 Report one value of configuration code 0x27d for a level and difficulty, cached.
int GetAlbumJukeboxValue ()
 Report the value of configuration code 0x514, cached.
void ClearAlbumCache ()
 Empty all three caches.

Function Documentation

◆ IsAlbumLevel()

int IsAlbumLevel ( const HxStr & name)

Report whether a level counts toward the campaign album.

The body returns 1 whatever the name. CampaignStats calls it for every level name while it rebuilds and resets its level records, and skips a level on 0, a branch the shipped body never takes. Every routine in this unit is a free function over file-scope caches, and the unit's name is inferred from the script function clear_album_cache that empties them. The title is inferred.

Parameters
nameThe level's name, which the body does not read.
Returns
1.
Ghidra address:
NTSC-U/C: 0x003f7a30
Ghidra address:
PAL: 0x00430240

◆ GetAlbumLevelStage()

int GetAlbumLevelStage ( const HxStr & name)

Report the stage a level belongs to, reading it once and caching it.

The first request for a name reads configuration code 0x25d for it and stores the result in a file-scope std::map<HxStr, int>; later requests read the map. CampaignStats is the caller. The title is inferred.

Parameters
nameThe level's name.
Returns
The stage.
Ghidra address:
NTSC-U/C: 0x003f7a38
Ghidra address:
PAL: 0x00430248

◆ GetAlbumLevelValue()

int GetAlbumLevelValue ( int nLevel,
int nDifficulty )

Report one value of configuration code 0x27d for a level and difficulty, cached.

The cache is a file-scope vector of 30 words, three difficulties for each of ten levels, filled with -2 until an entry is first read. CampaignStats is the caller. The title is inferred.

Parameters
nLevelThe level, counted from 0.
nDifficultyThe difficulty, 0 through 2.
Returns
The value.
Ghidra address:
NTSC-U/C: 0x003f7a58
Ghidra address:
PAL: 0x00430268

◆ GetAlbumJukeboxValue()

int GetAlbumJukeboxValue ( )

Report the value of configuration code 0x514, cached.

MetJukeboxBaseScreen is the caller. The title is inferred.

Returns
The value.
Ghidra address:
NTSC-U/C: 0x003f7ad8
Ghidra address:
PAL: 0x004302e8

◆ ClearAlbumCache()

void ClearAlbumCache ( )

Empty all three caches.

The map of level stages is emptied, every word of the level-value cache is reset to -2, and the jukebox value is reset to -2. The image lists no direct caller. The script function clear_album_cache at 0x003f6860 repeats the same three steps inline. The file-scope RegisterCFunction at 0x00892370 registers the script function.

Ghidra address:
NTSC-U/C: 0x003f79a8
Ghidra address:
PAL: 0x004301b8