wavelength 1.0.0
Loading...
Searching...
No Matches
MCManager Class Reference

Front end of the memory card work. More...

#include <mcmanager.h>

Public Member Functions

 MCManager ()
 Construct a manager with no task running.
void Init ()
 Read the memory card configuration and build the tasks.
void Terminate ()
 Destroy the tasks Init() built, and release the configuration buffers.
void InitialCheck (MemcardUser *pUser, int nSlot)
 Start checking a card at startup.
void GetCardStatus (MemcardUser *pUser, int nSlot)
 Start learning whether a usable card is in a slot.
void SaveFreq (MemcardUser *pUser, int nSlot, Campaign *pProfile, const char *pszOldName, int nOverwrite)
 Start saving the Freq of a profile.
void LoadFreqs (MemcardUser *pUser, int nSlot)
 Start loading every saved Freq into mProfiles.
void DeleteFreq (MemcardUser *pUser, int nSlot, const char *pszName)
 Start deleting a saved Freq.
void SaveRemix (MemcardUser *pUser, int nSlot, RemixInfo *pInfo, const void *pData, int nOverwrite)
 Start saving a remix.
void LoadRemix (MemcardUser *pUser, int nSlot, const char *pszName, void *pBuffer, int nSize)
 Start loading a saved remix.
void ListRemixes (MemcardUser *pUser, int nSlot)
 Start reading the descriptions of the saved remixes into mRemixInfos.
void DeleteRemix (MemcardUser *pUser, int nSlot, const char *pszName)
 Start deleting a saved remix.
void SaveSettings (MemcardUser *pUser, int nSlot, GameOptions *pSettings, int nOverwrite)
 Start saving the settings.
void LoadSettings (MemcardUser *pUser, int nSlot)
 Start loading the settings into mSettings.
void ListNetConfigs (MemcardUser *pUser, int nSlot)
 Start listing the network configurations.
void FormatCard (MemcardUser *pUser, int nSlot)
 Start formatting an unformatted card.
void SaveFile (MemcardUser *pUser, int nSlot, const char *pszName, const void *pData, int nSize, bool bReserved)
 Start saving a block of memory to a file.
void Poll ()
 Report the end of the running task to its user, and stop the task.
const char * GetSlotName (int nSlot)
 Report the localised name of a memory card slot.
const std::vector< Campaign > & GetProfiles () const
const std::vector< RemixInfo > & GetRemixInfos () const
const GameOptions & GetSettings () const

Detailed Description

Front end of the memory card work.

It runs one piece of work at a time on behalf of a MemcardUser.

The class is not polymorphic and has no RTTI. The name is inferred from the tasks it runs. The object is 0x90 bytes. Each starting routine prepares one task and makes it the running task. Poll() reports the end of the running task to its user through the MemcardUser method for the task, together with the results the manager retains.

Constructor & Destructor Documentation

◆ MCManager()

MCManager::MCManager ( )
inline

Construct a manager with no task running.

The task objects are built by Init().

Member Function Documentation

◆ Init()

void MCManager::Init ( )

Read the memory card configuration and build the tasks.

Metagame::Init() calls it.

Ghidra address:
NTSC-U/C: 0x0015c400
Ghidra address:
PAL: 0x0015dbf0

◆ Terminate()

void MCManager::Terminate ( )

Destroy the tasks Init() built, and release the configuration buffers.

Ghidra address:
NTSC-U/C: 0x0015c550
Ghidra address:
PAL: 0x0015dd40

◆ InitialCheck()

void MCManager::InitialCheck ( MemcardUser * pUser,
int nSlot )

Start checking a card at startup.

MemcardUser::OnInitialCheck() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015c758
Ghidra address:
PAL: 0x0015df48

◆ GetCardStatus()

void MCManager::GetCardStatus ( MemcardUser * pUser,
int nSlot )

Start learning whether a usable card is in a slot.

MemcardUser::OnCardStatus() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015c7a0
Ghidra address:
PAL: 0x0015df90

◆ SaveFreq()

void MCManager::SaveFreq ( MemcardUser * pUser,
int nSlot,
Campaign * pProfile,
const char * pszOldName,
int nOverwrite )

Start saving the Freq of a profile.

MemcardUser::OnFreqSaved() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pProfileThe profile, saved under its name.
pszOldNameThe name the Freq was saved under before. A different name has its file deleted.
nOverwriteNon-zero when a saved Freq of the name may be replaced.
Ghidra address:
NTSC-U/C: 0x0015c7e8
Ghidra address:
PAL: 0x0015dfd8

◆ LoadFreqs()

void MCManager::LoadFreqs ( MemcardUser * pUser,
int nSlot )

Start loading every saved Freq into mProfiles.

MemcardUser::OnFreqsLoaded() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015c840
Ghidra address:
PAL: 0x0015e030

◆ DeleteFreq()

void MCManager::DeleteFreq ( MemcardUser * pUser,
int nSlot,
const char * pszName )

Start deleting a saved Freq.

MemcardUser::OnFreqDeleted() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pszNameThe Freq's name.
Ghidra address:
NTSC-U/C: 0x0015c8a0
Ghidra address:
PAL: 0x0015e090

◆ SaveRemix()

void MCManager::SaveRemix ( MemcardUser * pUser,
int nSlot,
RemixInfo * pInfo,
const void * pData,
int nOverwrite )

Start saving a remix.

MemcardUser::OnRemixSaved() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pInfoThe description of the remix. Its name and size are those of the file and of the remix.
pDataThe remix.
nOverwriteNon-zero when a saved remix of the name may be replaced.
Ghidra address:
NTSC-U/C: 0x0015c8f0
Ghidra address:
PAL: 0x0015e0e0

◆ LoadRemix()

void MCManager::LoadRemix ( MemcardUser * pUser,
int nSlot,
const char * pszName,
void * pBuffer,
int nSize )

Start loading a saved remix.

MemcardUser::OnRemixLoaded() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pszNameThe name of the remix.
pBufferReceives the remix. The caller retains it.
nSizeThe number of bytes to read.
Ghidra address:
NTSC-U/C: 0x0015c948
Ghidra address:
PAL: 0x0015e138

◆ ListRemixes()

void MCManager::ListRemixes ( MemcardUser * pUser,
int nSlot )

Start reading the descriptions of the saved remixes into mRemixInfos.

MemcardUser::OnRemixesListed() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015c9a0
Ghidra address:
PAL: 0x0015e190

◆ DeleteRemix()

void MCManager::DeleteRemix ( MemcardUser * pUser,
int nSlot,
const char * pszName )

Start deleting a saved remix.

MemcardUser::OnRemixDeleted() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pszNameThe name of the remix.
Ghidra address:
NTSC-U/C: 0x0015c9f0
Ghidra address:
PAL: 0x0015e1e0

◆ SaveSettings()

void MCManager::SaveSettings ( MemcardUser * pUser,
int nSlot,
GameOptions * pSettings,
int nOverwrite )

Start saving the settings.

MemcardUser::OnSettingsSaved() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pSettingsThe settings.
nOverwriteNon-zero when saved settings may be replaced.
Ghidra address:
NTSC-U/C: 0x0015ca40
Ghidra address:
PAL: 0x0015e230

◆ LoadSettings()

void MCManager::LoadSettings ( MemcardUser * pUser,
int nSlot )

Start loading the settings into mSettings.

MemcardUser::OnSettingsLoaded() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015ca90
Ghidra address:
PAL: 0x0015e280

◆ ListNetConfigs()

void MCManager::ListNetConfigs ( MemcardUser * pUser,
int nSlot )

Start listing the network configurations.

MemcardUser::OnNetConfigsListed() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015cae0
Ghidra address:
PAL: 0x0015e2d0

◆ FormatCard()

void MCManager::FormatCard ( MemcardUser * pUser,
int nSlot )

Start formatting an unformatted card.

MemcardUser::OnCardFormatted() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
Ghidra address:
NTSC-U/C: 0x0015cb28
Ghidra address:
PAL: 0x0015e318

◆ SaveFile()

void MCManager::SaveFile ( MemcardUser * pUser,
int nSlot,
const char * pszName,
const void * pData,
int nSize,
bool bReserved )

Start saving a block of memory to a file.

MemcardUser::OnFileSaved() learns the outcome.

Parameters
pUserThe user to report to.
nSlotThe memory card slot.
pszNameThe name of the file.
pDataThe data.
nSizeThe number of bytes.
bReservedPassed by every caller. The body does not read it.
Ghidra address:
NTSC-U/C: 0x0015cb70
Ghidra address:
PAL: 0x0015e360

◆ Poll()

void MCManager::Poll ( )

Report the end of the running task to its user, and stop the task.

Metagame::Update() calls it every frame. A running task that none of the tasks matches is reported as ERROR: bad task!!!.

Ghidra address:
NTSC-U/C: 0x0015ccd8
Ghidra address:
PAL: 0x0015e4c8

◆ GetSlotName()

const char * MCManager::GetSlotName ( int nSlot)

Report the localised name of a memory card slot.

Parameters
nSlotThe memory card slot.
Returns
The name, or an empty string for a slot without a name.
Ghidra address:
NTSC-U/C: 0x0015d050
Ghidra address:
PAL: 0x0015e840

◆ GetProfiles()

const std::vector< Campaign > & MCManager::GetProfiles ( ) const
inline
Returns
The profiles LoadFreqs() loads.

◆ GetRemixInfos()

const std::vector< RemixInfo > & MCManager::GetRemixInfos ( ) const
inline
Returns
The descriptions ListRemixes() reads.

◆ GetSettings()

const GameOptions & MCManager::GetSettings ( ) const
inline
Returns
The settings LoadSettings() loads.

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