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

Read one file from a card into a caller-supplied buffer. More...

#include <loadfilemct.h>

Inheritance diagram for LoadFileMCT:
Collaboration diagram for LoadFileMCT:

Public Member Functions

 LoadFileMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie)
 Construct an idle load task.
virtual ~LoadFileMCT ()
void Load (const HxStr &path, void *pBuffer, int nLength)
 Record what to read and start the sequence.
void RunStep ()
 Run the step mState selects and advance to the state after it.
void SetState (int nState)
 Record the next state.
virtual void OnCheckInfo (CheckInfoOp *pOp)
virtual void OnRead (ReadOp *pOp)
virtual void OnOpenRead (OpenReadOp *pOp)
virtual void OnClose (CloseOp *pOp)
virtual void Finish ()
virtual void Execute ()
Public Member Functions inherited from MemcardTask
 MemcardTask (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie)
 Construct an idle task against one card slot.
 MemcardTask (MemcardUser *pUser, Memcard *pCard, int nCookie)
 Construct an idle task that does not address a single card slot.
virtual void UnusedHook ()
 Do nothing.
Public Member Functions inherited from MemcardCBHandler
virtual ~MemcardCBHandler ()
 Release the receiver.
virtual void OnEntSpace (EntSpaceOp *pOp)
 Report a finished free-entry enquiry.
virtual void OnFormat (FormatOp *pOp)
 Report a finished format.
virtual void OnUnformat (UnformatOp *pOp)
 Report a finished unformat.
virtual void OnCreateDir (CreateDirOp *pOp)
 Report a finished directory creation.
virtual void OnListDir (ListDirOp *pOp)
 Report a finished directory listing.
virtual void OnWrite (WriteOp *pOp)
 Report a finished write.
virtual void OnOpenWrite (OpenWriteOp *pOp)
 Report a finished open for writing.
virtual void OnSeek (SeekOp *pOp)
 Report a finished seek.
virtual void OnDeleteFile (DeleteFileOp *pOp)
 Report a finished file deletion.
virtual void OnRenameFile (RenameFileOp *pOp)
 Report a finished rename.

Public Attributes

int mBytesRead
 Bytes the read transferred, valid once the task has reported kMemcardStatusOk.

Protected Attributes

int mState
void * mBuffer
int mLength
HxStr mPath
int mFile
Protected Attributes inherited from MemcardTask
MemcardUser * mUser
Memcard * mCard
int mCookie
int mPortSlot
int mState
int mStatus

Additional Inherited Members

Protected Member Functions inherited from MemcardTask
void HandleError ()
 Abandon the task when the last operation reported a failure.

Detailed Description

Read one file from a card into a caller-supplied buffer.

Its RTTI descriptor is at 0x0090e2b0. It has single inheritance from MemcardTask at offset 0. An instance is 0x38 bytes and the vtable is at 0x007dae38.

The task enquires about the card, opens the file, reads it, and closes it, advancing one step per operation report. Three subclasses exist, LoadPersonasMCT, LoadGlobalSettingsMCT and LoadJukeboxPlayListMCT. LoadRemixMCT and ListRemixesMCT instead own one of these tasks and receive its report as a MemcardUser.

The enquiry tolerates every status except kMemcardStatusUnknown, so a load from an unformatted card still proceeds to the open and fails there instead.

The method titles Load(), RunStep() and SetState() are inferred. No string in the image identifies any of them.

Constructor & Destructor Documentation

◆ LoadFileMCT()

LoadFileMCT::LoadFileMCT ( MemcardUser * pUser,
Memcard * pCard,
int nPortSlot,
int nCookie )

Construct an idle load task.

The compiler inlined this body into all three subclass constructors, so no address of its own survives.

Parameters
pUserThe receiver Finish() reports to.
pCardThe queue the task submits operations to.
nPortSlotThe packed port and slot.
nCookieThe tag that abandons exactly this task's operations.

◆ ~LoadFileMCT()

virtual LoadFileMCT::~LoadFileMCT ( )
virtual
Ghidra address:
NTSC-U/C: 0x001847e0
Ghidra address:
PAL: 0x00189cd8

Member Function Documentation

◆ Load()

void LoadFileMCT::Load ( const HxStr & path,
void * pBuffer,
int nLength )

Record what to read and start the sequence.

Parameters
pathThe file to read.
pBufferThe destination.
nLengthThe number of bytes to read.
Ghidra address:
NTSC-U/C: 0x00185e20
Ghidra address:
PAL: 0x0018b8d8

◆ RunStep()

void LoadFileMCT::RunStep ( )

Run the step mState selects and advance to the state after it.

Ghidra address:
NTSC-U/C: 0x00185f08
Ghidra address:
PAL: 0x0018b9c0

◆ SetState()

void LoadFileMCT::SetState ( int nState)

Record the next state.

The body is a single store. It survives as one out-of-line copy because this compiler emits an inline member into every translation unit that needs it, and the copy the linker retained came from another unit.

Parameters
nStateOne of LoadFileState.
Ghidra address:
NTSC-U/C: 0x001f61b0
Ghidra address:
PAL: 0x001fcbc0

◆ OnCheckInfo()

virtual void LoadFileMCT::OnCheckInfo ( CheckInfoOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00185db8
Ghidra address:
PAL: 0x0018b870

Reimplemented from MemcardCBHandler.

◆ OnRead()

virtual void LoadFileMCT::OnRead ( ReadOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00185d00
Ghidra address:
PAL: 0x0018b7b8

Reimplemented from MemcardCBHandler.

◆ OnOpenRead()

virtual void LoadFileMCT::OnOpenRead ( OpenReadOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00185ca0
Ghidra address:
PAL: 0x0018b758

Reimplemented from MemcardCBHandler.

◆ OnClose()

virtual void LoadFileMCT::OnClose ( CloseOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00185d58
Ghidra address:
PAL: 0x0018b810

Reimplemented from MemcardCBHandler.

◆ Finish()

virtual void LoadFileMCT::Finish ( )
virtual
Ghidra address:
NTSC-U/C: 0x00185ec0
Ghidra address:
PAL: 0x0018b978

Implements MemcardTask.

Reimplemented in LoadGlobalSettingsMCT, LoadJukeboxPlayListMCT, and LoadPersonasMCT.

◆ Execute()

virtual void LoadFileMCT::Execute ( )
virtual
Ghidra address:
NTSC-U/C: 0x00185e80
Ghidra address:
PAL: 0x0018b938

Implements MemcardTask.

Reimplemented in LoadGlobalSettingsMCT, LoadJukeboxPlayListMCT, and LoadPersonasMCT.

Member Data Documentation

◆ mBytesRead

int LoadFileMCT::mBytesRead

Bytes the read transferred, valid once the task has reported kMemcardStatusOk.

Public because the derived tasks and the screens that own them read it directly, and the image exposes no accessor.

+0x34

◆ mState

int LoadFileMCT::mState
protected

◆ mBuffer

void* LoadFileMCT::mBuffer
protected

◆ mLength

int LoadFileMCT::mLength
protected

◆ mPath

HxStr LoadFileMCT::mPath
protected

◆ mFile

int LoadFileMCT::mFile
protected

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