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

Measure the kilobytes a SaveFileMCT's files need beyond the space they occupy on the card now. More...

#include <savespacecheckermct.h>

Inheritance diagram for SaveSpaceCheckerMCT:
Collaboration diagram for SaveSpaceCheckerMCT:

Public Member Functions

 SaveSpaceCheckerMCT (SaveFileMCT *pOwner, const std::vector< SaveFileEntry > *pFiles, const HxStr &dirName, Memcard *pCard, int nPortSlot, int nCookie)
 Construct the check and list the save directory.
virtual ~SaveSpaceCheckerMCT ()
virtual void OnListDir (ListDirOp *pOp)
 Measure the files against the listing and report to the owner.
virtual void Finish ()
 Do nothing.
virtual void Execute ()
 Write a diagnostic with the routine's name to cout.
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 OnCheckInfo (CheckInfoOp *pOp)
 Report a finished card enquiry.
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 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

Measure the kilobytes a SaveFileMCT's files need beyond the space they occupy on the card now.

The European release added the class, and the North American release has no counterpart. Its RTTI type name is SaveSpaceCheckerMCT. It has single inheritance from MemcardTask at offset

  1. An instance is 0x2c bytes, from the allocation in SaveFileMCT::StartSpaceCheck(), and the vtable is at 0x0081ed00.

SaveFileMCT constructs the task directly instead of queueing it through MemcardManager. The task has no MemcardUser, and Execute() never runs. The constructor lists the save directory at once, and OnListDir() reports the measurement directly to the SaveFileMCT that started it, through SaveFileMCT::OnSpaceChecked(). A file already in the directory costs the kilobytes it grows by, a missing file costs its full size, and a missing directory costs two kilobytes more. Each pair of new files, rounding up, costs one kilobyte of directory entries. A kilobyte here is one card cluster.

The owner deletes the task when it creates the directory.

Constructor & Destructor Documentation

◆ SaveSpaceCheckerMCT()

SaveSpaceCheckerMCT::SaveSpaceCheckerMCT ( SaveFileMCT * pOwner,
const std::vector< SaveFileEntry > * pFiles,
const HxStr & dirName,
Memcard * pCard,
int nPortSlot,
int nCookie )

Construct the check and list the save directory.

The listing covers every entry of dirName, through the wildcard *.

Parameters
pOwnerThe save the measurement is for.
pFilesThe files the save writes. The vector stays in pOwner and is not copied.
dirNameThe save directory. The task stores a copy.
pCardThe queue the task submits operations to.
nPortSlotThe packed port and slot.
nCookieThe tag that abandons exactly this task's operations.
Ghidra address:
PAL: 0x0017ae70

◆ ~SaveSpaceCheckerMCT()

virtual SaveSpaceCheckerMCT::~SaveSpaceCheckerMCT ( )
virtual
Ghidra address:
PAL: 0x00189ac0

Member Function Documentation

◆ OnListDir()

virtual void SaveSpaceCheckerMCT::OnListDir ( ListDirOp * pOp)
virtual

Measure the files against the listing and report to the owner.

A failed listing other than kMemcardStatusNoDirectory abandons the task's operations and still reports to the owner, with a measurement of zero.

Parameters
pOpThe finished listing.
Ghidra address:
PAL: 0x0017b050

Reimplemented from MemcardCBHandler.

◆ Finish()

virtual void SaveSpaceCheckerMCT::Finish ( )
virtual

Do nothing.

Ghidra address:
PAL: 0x00189828

Implements MemcardTask.

◆ Execute()

virtual void SaveSpaceCheckerMCT::Execute ( )
virtual

Write a diagnostic with the routine's name to cout.

The routine is never called.

Ghidra address:
PAL: 0x00189830

Implements MemcardTask.


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