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

Measure the space a full save would need on one card. More...

#include <minimumsavespacemct.h>

Inheritance diagram for MinimumSaveSpaceMCT:
Collaboration diagram for MinimumSaveSpaceMCT:

Public Member Functions

 MinimumSaveSpaceMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie)
 Construct an idle measurement.
virtual ~MinimumSaveSpaceMCT ()
void RunStep ()
 Run the step mStep selects and advance to the step after it.
virtual void OnCheckInfo (CheckInfoOp *pOp)
 Ignore the finished enquiry and run the next step.
virtual void OnOpenRead (OpenReadOp *pOp)
virtual void OnClose (CloseOp *pOp)
virtual void Finish ()
 Report mSpace through MemcardUser::OnMinimumSaveSpace().
virtual void Execute ()
 Build both paths, seed the measurement, and run the first step.
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 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 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 space a full save would need on one card.

Its RTTI descriptor is at 0x008ef280. It has single inheritance from MemcardTask at offset 0. An instance is 0x38 bytes and the vtable is at 0x007dac58. In the European release an instance is 0x40 bytes and the vtable is at 0x0081eaa0.

The task probes rather than counts. It tries to open the roster file and the settings file in turn and charges kMinimumSaveSpaceExistingFile for each one that opens and kMinimumSaveSpaceNewFile for each one that does not, starting from a base the game supplies. The total goes to the user through MemcardUser::OnMinimumSaveSpace(), the only notification that receives a measurement rather than a status.

The task never reads the card's free-cluster count. Its OnCheckInfo() ignores the finished enquiry entirely, not even reading its status. SaveRemixMCT is the only task in the subsystem that reads CheckInfoOp::mFree. The asymmetry matches the shipped program.

Both paths are built from the file-scope string globals at 0x00888940 onward. The roster path is /BASCUS-97125 plus gen plus /pers.dat and the settings path is /BASCUS-97125 plus glo plus /globset.dat.

Constructor & Destructor Documentation

◆ MinimumSaveSpaceMCT()

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

Construct an idle measurement.

The constructor is inlined at every site and the image has no out-of-line copy.

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.

◆ ~MinimumSaveSpaceMCT()

virtual MinimumSaveSpaceMCT::~MinimumSaveSpaceMCT ( )
virtual
Ghidra address:
NTSC-U/C: 0x00184c18
Ghidra address:
PAL: 0x0018a140

Member Function Documentation

◆ RunStep()

void MinimumSaveSpaceMCT::RunStep ( )

Run the step mStep selects and advance to the step after it.

Ghidra address:
NTSC-U/C: 0x00178660
Ghidra address:
PAL: 0x0017bd20

◆ OnCheckInfo()

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

Ignore the finished enquiry and run the next step.

The body does not read the operation, not even its status. The free-cluster count therefore plays no part in the measurement.

Ghidra address:
NTSC-U/C: 0x00186200
Ghidra address:
PAL: 0x0018bcc0

Reimplemented from MemcardCBHandler.

◆ OnOpenRead()

virtual void MinimumSaveSpaceMCT::OnOpenRead ( OpenReadOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00186220
Ghidra address:
PAL: 0x0018bce0

Reimplemented from MemcardCBHandler.

◆ OnClose()

virtual void MinimumSaveSpaceMCT::OnClose ( CloseOp * pOp)
virtual
Ghidra address:
NTSC-U/C: 0x00186250
Ghidra address:
PAL: 0x0018bd10

Reimplemented from MemcardCBHandler.

◆ Finish()

virtual void MinimumSaveSpaceMCT::Finish ( )
virtual

Report mSpace through MemcardUser::OnMinimumSaveSpace().

The European release also passes mSkipWarning and mCampaign.

Ghidra address:
NTSC-U/C: 0x001861c0
Ghidra address:
PAL: 0x0018bc78

Implements MemcardTask.

◆ Execute()

virtual void MinimumSaveSpaceMCT::Execute ( )
virtual

Build both paths, seed the measurement, and run the first step.

The body seeds mSpace from GlobalSettings::mRequiredSaveSpace less 100, builds both paths, clears mStep, and runs RunStep(). The European release subtracts 87 instead, and puts a / between each directory and its file name.

Ghidra address:
NTSC-U/C: 0x00178328
Ghidra address:
PAL: 0x0017b740

Implements MemcardTask.


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