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

Game-wide owner of the memory-card queue and of the tasks that drive it. More...

#include <memcardmanager.h>

Collaboration diagram for MemcardManager:

Public Member Functions

 MemcardManager ()
 Construct an empty manager that owns a new MemcardPS2.
 ~MemcardManager ()
 Delete the queue and release the task list.
void Update ()
 Advance the memory-card work by one frame.
void CreateGetConnectStateTask (int nPortSlot)
 Queue a GetConnectStateMCT for one slot.
void CreateGetAllConnectStatesTask (std::vector< MemcardConnectState > *pStates)
 Queue a GetAllConnectStatesMCT.
void CreateMinimumSaveSpaceTask (int nPortSlot)
 Queue a MinimumSaveSpaceMCT for one slot.
void CreateFormatTask (int nPortSlot)
 Queue a FormatCardMCT that formats one slot.
void CreateUnformatTask (int nPortSlot)
 Queue a FormatCardMCT that unformats one slot.
void CreateSavePersonasTask (int nPortSlot, const std::vector< MetPersonaData * > &roster)
 Queue a SavePersonasMCT, which serialises the roster at once.
void CreateSaveGlobalSettingsTask (int nPortSlot, GlobalSettings *pSettings)
 Queue a SaveGlobalSettingsMCT, which serialises the settings at once.
void CreateSaveJukeboxPlayListTask (int nPortSlot, JukeboxPlayList *pPlayList, int nIndex)
 Queue a SaveJukeboxPlayListMCT, which serialises the playlist at once.
void CreateLoadPersonasTask (int nPortSlot, std::vector< MetPersonaData * > *pRoster)
 Queue a LoadPersonasMCT.
void CreateLoadGlobalSettingsTask (int nPortSlot, GlobalSettings *pSettings)
 Queue a LoadGlobalSettingsMCT.
void CreateLoadJukeboxPlayListTask (int nPortSlot, JukeboxPlayList *pPlayList, int nIndex)
 Queue a LoadJukeboxPlayListMCT.
void CreateSaveRemixTask (int nPortSlot, const HxStr &remixName, const std::vector< FreqAppearance > &appearances, const HxStr &levelName, int nAlbumNum)
 Queue a SaveRemixMCT.
void CreateListRemixesTask (int nPortSlot, std::vector< MetRemixRecord > *pRecords)
 Queue a ListRemixesMCT.
void CreateLoadRemixTask (int nPortSlot, const HxStr &remixName)
 Queue a LoadRemixMCT.
void CreateDeleteRemixTask (int nPortSlot, const HxStr &remixName)
 Queue a DeleteRemixMCT.

Static Public Member Functions

static MemcardManager * shared ()
 Resolve the one instance, constructing it on first use.

Public Attributes

MemcardUser * mUser
 The receiver each new task reports to.

Detailed Description

Game-wide owner of the memory-card queue and of the tasks that drive it.

The class is not polymorphic, emits no RTTI, and has no embedded file path. The name is inferred from the task factory at 0x001f37f8. The one instance is the function-local static that shared() vends at 0x00891a80.

The fifteen routines from 0x001f2ae0 to 0x001f3b80 each build one MemcardTask subclass, stamp it with mUser, mCard, and the next ticket, and append it to mTasks. Update() starts the task at the front and retires it once it has finished.

Constructor & Destructor Documentation

◆ MemcardManager()

MemcardManager::MemcardManager ( )

Construct an empty manager that owns a new MemcardPS2.

Ghidra address:
NTSC-U/C: 0x001f2960
Ghidra address:
PAL: 0x001f9330

◆ ~MemcardManager()

MemcardManager::~MemcardManager ( )

Delete the queue and release the task list.

Ghidra address:
NTSC-U/C: 0x001f6210
Ghidra address:
PAL: 0x001fcc20

Member Function Documentation

◆ shared()

MemcardManager * MemcardManager::shared ( )
static

Resolve the one instance, constructing it on first use.

The guard word is at 0x00695698, and the destructor is registered to run at exit through 0x001f6530.

Returns
The manager.
Ghidra address:
NTSC-U/C: 0x001f61b8
Ghidra address:
PAL: 0x001fcbc8

◆ Update()

void MemcardManager::Update ( )

Advance the memory-card work by one frame.

With no task queued, only the queue is updated. Otherwise a front task whose state is kMemcardTaskFinished is deleted and dropped. When a task then remains, the front task is started if it is still idle, and the queue is updated. Dropping the last task therefore skips the queue's update for that frame. GameManagerImpl::DrawFrame() calls it once per frame while the front end is active. The title is inferred.

Ghidra address:
NTSC-U/C: 0x001f3cb0
Ghidra address:
PAL: 0x001fa698

◆ CreateGetConnectStateTask()

void MemcardManager::CreateGetConnectStateTask ( int nPortSlot)

Queue a GetConnectStateMCT for one slot.

Parameters
nPortSlotThe packed port and slot.
Ghidra address:
NTSC-U/C: 0x001f2ae0
Ghidra address:
PAL: 0x001f94b0

◆ CreateGetAllConnectStatesTask()

void MemcardManager::CreateGetAllConnectStatesTask ( std::vector< MemcardConnectState > * pStates)

Queue a GetAllConnectStatesMCT.

Parameters
pStatesWhere the answers are appended. Borrowed, not owned.
Ghidra address:
NTSC-U/C: 0x001f2c70
Ghidra address:
PAL: 0x001f9640

◆ CreateMinimumSaveSpaceTask()

void MemcardManager::CreateMinimumSaveSpaceTask ( int nPortSlot)

Queue a MinimumSaveSpaceMCT for one slot.

Parameters
nPortSlotThe packed port and slot.
Ghidra address:
NTSC-U/C: 0x001f2d78
Ghidra address:
PAL: 0x001f9748

◆ CreateFormatTask()

void MemcardManager::CreateFormatTask ( int nPortSlot)

Queue a FormatCardMCT that formats one slot.

Parameters
nPortSlotThe packed port and slot.
Ghidra address:
NTSC-U/C: 0x001f2e88
Ghidra address:
PAL: 0x001f9868

◆ CreateUnformatTask()

void MemcardManager::CreateUnformatTask ( int nPortSlot)

Queue a FormatCardMCT that unformats one slot.

Nothing in the image calls it.

Parameters
nPortSlotThe packed port and slot.
Ghidra address:
NTSC-U/C: 0x001f2f88
Ghidra address:
PAL: 0x001f9968

◆ CreateSavePersonasTask()

void MemcardManager::CreateSavePersonasTask ( int nPortSlot,
const std::vector< MetPersonaData * > & roster )

Queue a SavePersonasMCT, which serialises the roster at once.

Parameters
nPortSlotThe packed port and slot.
rosterThe personas to save.
Ghidra address:
NTSC-U/C: 0x001f3090
Ghidra address:
PAL: 0x001f9a70

◆ CreateSaveGlobalSettingsTask()

void MemcardManager::CreateSaveGlobalSettingsTask ( int nPortSlot,
GlobalSettings * pSettings )

Queue a SaveGlobalSettingsMCT, which serialises the settings at once.

Parameters
nPortSlotThe packed port and slot.
pSettingsThe settings to save.
Ghidra address:
NTSC-U/C: 0x001f3328
Ghidra address:
PAL: 0x001f9d08

◆ CreateSaveJukeboxPlayListTask()

void MemcardManager::CreateSaveJukeboxPlayListTask ( int nPortSlot,
JukeboxPlayList * pPlayList,
int nIndex )

Queue a SaveJukeboxPlayListMCT, which serialises the playlist at once.

Parameters
nPortSlotThe packed port and slot.
pPlayListThe playlist to save.
nIndexThe playlist number the file name carries.
Ghidra address:
NTSC-U/C: 0x001f3458
Ghidra address:
PAL: 0x001f9e38

◆ CreateLoadPersonasTask()

void MemcardManager::CreateLoadPersonasTask ( int nPortSlot,
std::vector< MetPersonaData * > * pRoster )

Queue a LoadPersonasMCT.

Parameters
nPortSlotThe packed port and slot.
pRosterWhere the loaded personas are appended.
Ghidra address:
NTSC-U/C: 0x001f37f8
Ghidra address:
PAL: 0x001fa1d8

◆ CreateLoadGlobalSettingsTask()

void MemcardManager::CreateLoadGlobalSettingsTask ( int nPortSlot,
GlobalSettings * pSettings )

Queue a LoadGlobalSettingsMCT.

Parameters
nPortSlotThe packed port and slot.
pSettingsThe settings to fill.
Ghidra address:
NTSC-U/C: 0x001f3910
Ghidra address:
PAL: 0x001fa2f8

◆ CreateLoadJukeboxPlayListTask()

void MemcardManager::CreateLoadJukeboxPlayListTask ( int nPortSlot,
JukeboxPlayList * pPlayList,
int nIndex )

Queue a LoadJukeboxPlayListMCT.

Parameters
nPortSlotThe packed port and slot.
pPlayListThe playlist to fill.
nIndexThe playlist number the file name carries.
Ghidra address:
NTSC-U/C: 0x001f3a40
Ghidra address:
PAL: 0x001fa428

◆ CreateSaveRemixTask()

void MemcardManager::CreateSaveRemixTask ( int nPortSlot,
const HxStr & remixName,
const std::vector< FreqAppearance > & appearances,
const HxStr & levelName,
int nAlbumNum )

Queue a SaveRemixMCT.

Parameters
nPortSlotThe packed port and slot.
remixNameThe remix's name.
appearancesThe players' appearances.
levelNameThe level the remix was built over.
nAlbumNumThe album number the index entry records.
Ghidra address:
NTSC-U/C: 0x001f31c8
Ghidra address:
PAL: 0x001f9ba8

◆ CreateListRemixesTask()

void MemcardManager::CreateListRemixesTask ( int nPortSlot,
std::vector< MetRemixRecord > * pRecords )

Queue a ListRemixesMCT.

Parameters
nPortSlotThe packed port and slot.
pRecordsThe collection the listing fills.
Ghidra address:
NTSC-U/C: 0x001f3598
Ghidra address:
PAL: 0x001f9f78

◆ CreateLoadRemixTask()

void MemcardManager::CreateLoadRemixTask ( int nPortSlot,
const HxStr & remixName )

Queue a LoadRemixMCT.

Parameters
nPortSlotThe packed port and slot.
remixNameThe remix to read.
Ghidra address:
NTSC-U/C: 0x001f36c8
Ghidra address:
PAL: 0x001fa0a8

◆ CreateDeleteRemixTask()

void MemcardManager::CreateDeleteRemixTask ( int nPortSlot,
const HxStr & remixName )

Queue a DeleteRemixMCT.

Parameters
nPortSlotThe packed port and slot.
remixNameThe remix to remove.
Ghidra address:
NTSC-U/C: 0x001f3b80
Ghidra address:
PAL: 0x001fa568

Member Data Documentation

◆ mUser

MemcardUser* MemcardManager::mUser

The receiver each new task reports to.

Every task factory copies it into the task. +0x00

Public because MetRemixManager's remix loaders at 0x00361418 and 0x00361480, and MetSaveRemix::OnRemixSaved(), OnRemixesListed(), and OnMsgScreenDismissed(), store themselves here directly before queueing a task, and the image has no setter for it.


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