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

Format or unformat the card in one slot. More...

#include <formatcardmct.h>

Inheritance diagram for FormatCardMCT:
Collaboration diagram for FormatCardMCT:

Public Member Functions

 FormatCardMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, int bUnformat)
 Construct an idle format task.
virtual ~FormatCardMCT ()
void IssueFormat ()
 Queue the format or the unformat, whichever mUnformat selects.
virtual void OnCheckInfo (CheckInfoOp *pOp)
 Refuse a formatted card, and otherwise queue the format.
virtual void OnFormat (FormatOp *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 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 OnRead (ReadOp *pOp)
 Report a finished read.
virtual void OnWrite (WriteOp *pOp)
 Report a finished write.
virtual void OnOpenWrite (OpenWriteOp *pOp)
 Report a finished open for writing.
virtual void OnOpenRead (OpenReadOp *pOp)
 Report a finished open for reading.
virtual void OnClose (CloseOp *pOp)
 Report a finished close.
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.

Additional Inherited Members

Protected Member Functions inherited from MemcardTask
void HandleError ()
 Abandon the task when the last operation reported a failure.
Protected Attributes inherited from MemcardTask
MemcardUser * mUser
Memcard * mCard
int mCookie
int mPortSlot
int mState
int mStatus

Detailed Description

Format or unformat the card in one slot.

Its RTTI descriptor is at 0x008ef290. It has single inheritance from MemcardTask at offset 0. An instance is 0x20 bytes and the vtable is at 0x007dabb8. The accessor at 0x00184c90 belongs to this class rather than to MemcardTask. The descriptor it guards on at entry establishes the owning class.

The task enquires first and refuses to act on a card that reports itself formatted, which is what kMemcardStatusAlreadyFormatted is for. Otherwise it queues a format, or an unformat when mUnformat is set, and reports through whichever MemcardUser method matches the direction.

One asymmetry is faithful and looks like an oversight in the original. The class overrides OnFormat() but not OnUnformat(), so an unformat's completion arrives at the empty default body of MemcardCBHandler and the task never finishes. Only the format direction is observed.

Constructor & Destructor Documentation

◆ FormatCardMCT()

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

Construct an idle format task.

The constructor is inlined at its two sites, MemcardManager::CreateFormatTask() at 0x001f2e88, which passes 0, and MemcardManager::CreateUnformatTask() at 0x001f2f88, which passes 1. 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.
bUnformatNon-zero to unformat rather than format.

◆ ~FormatCardMCT()

virtual FormatCardMCT::~FormatCardMCT ( )
virtual
Ghidra address:
NTSC-U/C: 0x00184d68
Ghidra address:
PAL: 0x0018a2b8

Member Function Documentation

◆ IssueFormat()

void FormatCardMCT::IssueFormat ( )

Queue the format or the unformat, whichever mUnformat selects.

A second copy of this dispatch survives at 0x00186348 with no caller, which is one of this compiler's unfolded per-unit emissions.

Ghidra address:
NTSC-U/C: 0x00186348
Ghidra address:
PAL: 0x0018be08

◆ OnCheckInfo()

virtual void FormatCardMCT::OnCheckInfo ( CheckInfoOp * pOp)
virtual

Refuse a formatted card, and otherwise queue the format.

A card reporting itself formatted yields kMemcardStatusAlreadyFormatted and the task abandons its work. kMemcardStatusUnknown abandons it as well. Any other status proceeds.

Ghidra address:
NTSC-U/C: 0x00186390
Ghidra address:
PAL: 0x0018be50

Reimplemented from MemcardCBHandler.

◆ OnFormat()

virtual void FormatCardMCT::OnFormat ( FormatOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00186438
Ghidra address:
PAL: 0x0018bef8

Reimplemented from MemcardCBHandler.

◆ Finish()

virtual void FormatCardMCT::Finish ( )
virtual
Ghidra address:
NTSC-U/C: 0x001862b0
Ghidra address:
PAL: 0x0018bd70

Implements MemcardTask.

◆ Execute()

virtual void FormatCardMCT::Execute ( )
virtual
Ghidra address:
NTSC-U/C: 0x00186318
Ghidra address:
PAL: 0x0018bdd8

Implements MemcardTask.


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