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

Work that saves a remix with its RemixInfo to a remix directory. More...

#include <mcsaveremixtask.h>

Inheritance diagram for MCSaveRemixTask:
Collaboration diagram for MCSaveRemixTask:

Public Member Functions

 ~MCSaveRemixTask () override=default
 Destroy the object.
 MCSaveRemixTask ()
 Construct the steps.
void Set (int nPort, const char *pszName, RemixInfo *pInfo, const void *pData, int nSize, int nOverwrite)
 Prepare the work, and serialise the description and the remix into g_pMemcardBuffer.
int GetNeeded ()
 Report the space a save that did not fit needed.
void OnSaveSpace (int nNeeded) override
 Prepare the directory and the file steps when the save fits, and otherwise fail the measurement.
Public Member Functions inherited from MemcardSerialTask
 ~MemcardSerialTask () override=default
 Destroy the object.
int GetResult ()
 Report the outcome of the work.
virtual void OnDirListed ()
 Learn that a directory listing step ended.
virtual void OnCardInfo ()
 Learn that a card information step ended.
virtual void OnFileLoaded ()
 Learn that a file load step ended.
Public Member Functions inherited from SerialTasks
 ~SerialTasks () override
 Release the list and every task in it.
void Add (Task *pTask)
 Append a task, which the list then manages.
Public Member Functions inherited from Task
 Task ()
 Construct an idle task.
virtual ~Task ()
 Release the task.
int Poll ()
 Report the state after giving a running task one poll.
void Start ()
 Enter the running state and call OnStart(), unless the task is already running.
void Stop ()
 Call OnStop() when the task is running, and return to the idle state.
void Finish (bool bSucceeded)
 End the task from outside its poll, and call OnStop() when it was running.
int GetState () const
 Report mState.

Additional Inherited Members

Public Types inherited from Task
enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...
Protected Member Functions inherited from MemcardSerialTask
void OnStop () override
 Record MemcardTask::sStatus in mResult.
Protected Member Functions inherited from SerialTasks
void OnStart () override
 Start the first task, or finish with success when the list is empty.
void OnStop () override
 Stop the task that runs now.
void OnPoll () override
 Poll the task that runs now, start the next one after it is done, and finish after the last one or after a failure.
const std::vector< std::unique_ptr< Task > > & GetTasks () const

Detailed Description

Work that saves a remix with its RemixInfo to a remix directory.

The RTTI records the class as deriving from MemcardSerialTask and from SaveSpaceUser at +0x20. The object is 0x50 bytes. The steps choose the directory and measure the space, create the directory, and save the file. A save that does not fit fails after the measurement, and GetNeeded() then reports the space it needed.

Constructor & Destructor Documentation

◆ ~MCSaveRemixTask()

MCSaveRemixTask::~MCSaveRemixTask ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x00353580
Ghidra address:
PAL: 0x003c0888

◆ MCSaveRemixTask()

MCSaveRemixTask::MCSaveRemixTask ( )

Construct the steps.

Ghidra address:
NTSC-U/C: 0x00161810
Ghidra address:
PAL: 0x00164520

Member Function Documentation

◆ Set()

void MCSaveRemixTask::Set ( int nPort,
const char * pszName,
RemixInfo * pInfo,
const void * pData,
int nSize,
int nOverwrite )

Prepare the work, and serialise the description and the remix into g_pMemcardBuffer.

Parameters
nPortThe memory card slot.
pszNameThe name of the remix file, without its extension.
pInfoThe description.
pDataThe remix.
nSizeThe size of the remix in bytes.
nOverwriteNon-zero when a saved remix of the name may be replaced.
Ghidra address:
NTSC-U/C: 0x001618f0
Ghidra address:
PAL: 0x00164600

◆ GetNeeded()

int MCSaveRemixTask::GetNeeded ( )

Report the space a save that did not fit needed.

Returns
The kilobytes, or zero.
Ghidra address:
NTSC-U/C: 0x001619d8
Ghidra address:
PAL: 0x001646e8

◆ OnSaveSpace()

void MCSaveRemixTask::OnSaveSpace ( int nNeeded)
overridevirtual

Prepare the directory and the file steps when the save fits, and otherwise fail the measurement.

The title of the directory is the remix_label and the last character of the directory's name.

Parameters
nNeededThe kilobytes the save needs.
Ghidra address:
NTSC-U/C: 0x001619e0
Ghidra address:
PAL: 0x001646f0

Implements SaveSpaceUser.


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