resonance 1.0.1
Loading...
Searching...
No Matches
metsonglists.h File Reference
#include <vector>
#include "memcard/memcardconnectstate.h"
#include "os/hxstr.h"
Include dependency graph for metsonglists.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StageListEntry
 One level in a stage's list. More...
struct  ArenaListEntry
 One arena in the solo or the local arena table. More...

Functions

bool operator< (const StageListEntry &left, const StageListEntry &right)
 Order two stage entries by mOrder.
bool operator< (const ArenaListEntry &left, const ArenaListEntry &right)
 Order two arena entries by mOrder.
HxStr DifficultyName (int nDifficulty)
 Report the display name of a difficulty.
void RebuildStageLists ()
 Rebuild the per-stage level lists from the configuration.
void RebuildArenaLists ()
 Rebuild the solo and local arena tables from the configuration.
std::vector< HxStr > & GetLevelNames ()
 Report the level names RebuildStageLists() last read.
std::vector< StageListEntry > * GetStageList (int nStage)
 Report one stage's level list.
std::vector< ArenaListEntry > * GetArenaList ()
 Report the arena table for the current game mode.
MemcardConnectState NextCardSlot (const MemcardConnectState &slot)
 Report the memory-card location that follows another.
HxStr FirstCardSlotName ()
 Report the name of the first memory-card location found, or 1 when there is none.

Function Documentation

◆ operator<() [1/2]

bool operator< ( const StageListEntry & left,
const StageListEntry & right )
inline

Order two stage entries by mOrder.

Inline. The sort routines at 0x003cec08 and 0x003ced70 compare the two words at +0x08 with slt and call nothing.

Parameters
leftThe first entry.
rightThe second entry.
Returns
Whether the first entry sorts first.

◆ operator<() [2/2]

bool operator< ( const ArenaListEntry & left,
const ArenaListEntry & right )
inline

Order two arena entries by mOrder.

Inline, for the same reason as the StageListEntry overload.

Parameters
leftThe first entry.
rightThe second entry.
Returns
Whether the first entry sorts first.

◆ DifficultyName()

HxStr DifficultyName ( int nDifficulty)

Report the display name of a difficulty.

The routine reads configuration code 0x258 with the key ms_easy, ms_normal, or ms_expert for difficulties 0, 1, and 2, and reports an empty string for any other value. The front end's stage and statistics screens call it. Every routine in this unit is a free function over file-scope data, and the unit's name is inferred. The European release looks the three names up in the current language instead.

Parameters
nDifficultyThe difficulty.
Returns
The name.
Ghidra address:
NTSC-U/C: 0x003cc498
Ghidra address:
PAL: 0x00403d48

◆ RebuildStageLists()

void RebuildStageLists ( )

Rebuild the per-stage level lists from the configuration.

The routine reads the level names under configuration code 0x276 into GetLevelNames(), empties every stage list, appends each level to the list of the stage configuration code 0x25d reports for it, and sorts each list by mOrder. The MetRenderer and MetNullRenderer constructors and MetExpansionPakScreen call it.

Ghidra address:
NTSC-U/C: 0x003cc7a0
Ghidra address:
PAL: 0x004040a8

◆ RebuildArenaLists()

void RebuildArenaLists ( )

Rebuild the solo and local arena tables from the configuration.

The routine reads the names under configuration code 0x27a for solo and then for local, rebuilds each table with mOrder from configuration code 0x25f, and sorts both. The MetRenderer constructor and MetExpansionPakScreen call it.

Ghidra address:
NTSC-U/C: 0x003ccab0
Ghidra address:
PAL: 0x004043e8

◆ GetLevelNames()

std::vector< HxStr > & GetLevelNames ( )

Report the level names RebuildStageLists() last read.

The list is a function-local static of a file-local routine, which this accessor forwards to. CampaignStats rebuilds and merges its level records from it.

Returns
The names.
Ghidra address:
NTSC-U/C: 0x003d06b8
Ghidra address:
PAL: 0x00408478

◆ GetStageList()

std::vector< StageListEntry > * GetStageList ( int nStage)

Report one stage's level list.

Parameters
nStageThe stage, counted from 1.
Returns
The list.
Ghidra address:
NTSC-U/C: 0x003d06d8
Ghidra address:
PAL: 0x00408498

◆ GetArenaList()

std::vector< ArenaListEntry > * GetArenaList ( )

Report the arena table for the current game mode.

The local table in kGameModeLocal and the solo table otherwise. MetArenasScreen, the tutorial, the solo-stages, and the remix-load screens read it.

Returns
The table.
Ghidra address:
NTSC-U/C: 0x003d06f8
Ghidra address:
PAL: 0x004084b8

◆ NextCardSlot()

MemcardConnectState NextCardSlot ( const MemcardConnectState & slot)

Report the memory-card location that follows another.

Port 1 without a multitap is followed by port 2, port 2 by port 1, slot 1-A by slot 1-B, and slot 1-B by slot 1-A. Any other location gives the default MemcardConnectState. The memory-card screens call it to cycle the selected card.

Parameters
slotThe current location.
Returns
The next location.
Ghidra address:
NTSC-U/C: 0x003d0a40
Ghidra address:
PAL: 0x00408818

◆ FirstCardSlotName()

HxStr FirstCardSlotName ( )

Report the name of the first memory-card location found, or 1 when there is none.

The body reads GlobalSettings::mCardSlots and copies the slot name of its first entry. The front end's character, remix, and Freq-maker screens call it. The European release copies the name only when the first entry is the first slot of port 1, and reports 1 otherwise.

Returns
The name.
Ghidra address:
NTSC-U/C: 0x003d0b98
Ghidra address:
PAL: 0x00408990