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

Remove one saved remix from a card and rewrite the index it was listed in. More...

#include <deleteremixmct.h>

Inheritance diagram for DeleteRemixMCT:
Collaboration diagram for DeleteRemixMCT:

Public Member Functions

 DeleteRemixMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName)
 Construct an idle deletion.
virtual ~DeleteRemixMCT ()
void ListRemixDir ()
 List every remix save directory on the card.
void DeleteNextFile ()
 Run the deletion step mStep selects.
virtual void OnListDir (ListDirOp *pOp)
 Collect the listed directories and read the first one's index.
virtual void OnCheckInfo (CheckInfoOp *pOp)
 Start the listing unless the card reported that it cannot be read.
virtual void OnDeleteFile (DeleteFileOp *pOp)
 Advance the deletion, abandoning the task first when the deletion failed.
virtual void Finish ()
 Report the finished deletion through MemcardUser::OnRemixDeleted().
virtual void Execute ()
 Enquire about the card and start the deletion.
virtual void OnFileLoaded (int nStatus)
 Search one index for the remix.
virtual void OnFileSaved (int nStatus)
 Record the status of the index rewrite and advance to the next 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 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 OnRenameFile (RenameFileOp *pOp)
 Report a finished rename.
Public Member Functions inherited from MemcardUser
virtual ~MemcardUser ()
 Release the receiver.
virtual void OnConnectState (MemcardConnectState state, int nStatus)
 Report the state of one slot.
virtual void OnAllConnectStates ()
 Report that every slot has been enquired about.
virtual void OnMinimumSaveSpace (int nPortSlot, int nSpace)
 Report the space a save would need against the space a card has.
virtual void OnCardFormatted (int nPortSlot, int nStatus)
 Report a finished format.
virtual void OnCardUnformatted (int nPortSlot, int nStatus)
 Report a finished unformat.
virtual void OnPersonasSaved (int nPortSlot, int nStatus)
 Report a finished save of the FreQ roster.
virtual void OnRemixSaved (int nPortSlot, int nStatus)
 Report a finished save of one remix.
virtual void OnGlobalSettingsSaved (int nPortSlot, int nStatus)
 Report a finished save of the global settings.
virtual void OnJukeboxPlayListSaved (int nPortSlot, int nStatus)
 Report a finished save of a jukebox playlist.
virtual void OnRemixesListed (int nPortSlot, int nStatus)
 Report a finished listing of the saved remixes.
virtual void OnRemixLoaded (int nPortSlot, int nStatus)
 Report a finished load of one remix.
virtual void OnPersonasLoaded (int nPortSlot, int nStatus)
 Report a finished load of the FreQ roster.
virtual void OnGlobalSettingsLoaded (int nPortSlot, int nStatus)
 Report a finished load of the global settings.
virtual void OnJukeboxPlayListLoaded (int nPortSlot, int nStatus)
 Report a finished load of a jukebox playlist.
virtual void OnRemixDeleted (int nPortSlot, int nStatus)
 Report a finished deletion of one remix.
virtual void UnusedFirstReport (int nPortSlot, int nStatus)
 Do nothing.
virtual void UnusedSecondReport (int nPortSlot, int nStatus)
 Do nothing.

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

Remove one saved remix from a card and rewrite the index it was listed in.

Its RTTI descriptor is at 0x00902370. It has two public non-virtual bases, MemcardTask at offset 0 and MemcardUser at offset 28. Two vtables belong to the class, the 19-entry primary at 0x007da698 and the 21-entry MemcardUser table at 0x007da5e8, whose first two entries and whose slots 19 and 20 adjust this back by 28. Slot 20 needs a thunk here and not in LoadRemixMCT, because this class overrides it. An instance is 0x7c bytes, from the constructor's highest store at +0x78. No class derives from it. The size 0x7c is therefore a lower bound.

The task enquires about the card, lists /BASCUS-97125r*, reads each index to find the remix, deletes the payload file, and then saves the shortened index. It has two inner tasks, a LoadFileMCT at +0x50 and a SaveFileMCT at +0x54, and receives both reports as a MemcardUser. It therefore derives from both interfaces and is the only one of the four remix tasks that overrides OnFileSaved().

mStep is 1 while indexes are read, 2 once the remix is found, 3 once the shortened index is saved, and 4 once the payload file is deleted.

The method titles ListRemixDir(), DeleteNextFile(), Execute(), and Finish() are inferred. No string in the image identifies any of them.

Constructor & Destructor Documentation

◆ DeleteRemixMCT()

DeleteRemixMCT::DeleteRemixMCT ( MemcardUser * pUser,
Memcard * pCard,
int nPortSlot,
int nCookie,
const HxStr & remixName )

Construct an idle deletion.

mStatus and mStep are not written. A task that is read before it reports therefore exposes whatever those two words stored when the block was allocated.

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.
remixNameThe remix to remove.
Ghidra address:
NTSC-U/C: 0x0017ce08
Ghidra address:
PAL: 0x001814d0

◆ ~DeleteRemixMCT()

virtual DeleteRemixMCT::~DeleteRemixMCT ( )
virtual
Ghidra address:
NTSC-U/C: 0x001854e0
Ghidra address:
PAL: 0x0018ae48

Member Function Documentation

◆ ListRemixDir()

void DeleteRemixMCT::ListRemixDir ( )

List every remix save directory on the card.

Clears mStep first.

Ghidra address:
NTSC-U/C: 0x0017d098
Ghidra address:
PAL: 0x001817b0

◆ DeleteNextFile()

void DeleteRemixMCT::DeleteNextFile ( )

Run the deletion step mStep selects.

A failed step reports at once. In step 2 the index in mStream is parsed, the element whose FileName matches mFileName is erased (a missing one reports kMemcardStatusNoFile), the shortened index is written back into mStream, and a fresh SaveFileMCT saves it as <dir>/index under g_remixIconTitle plus the directory number, moving to step 3. In step 3 the payload <dir>/<mFileName> is deleted, moving to step 4. Step 4 reports. The European release gives the save the file name index, because its SaveFileMCT supplies the /.

Ghidra address:
NTSC-U/C: 0x0017dc68
Ghidra address:
PAL: 0x00182568

◆ OnListDir()

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

Collect the listed directories and read the first one's index.

The body is LoadRemixMCT::OnListDir()'s, except that mStream is rewound before the read.

Parameters
pOpThe finished listing.
Ghidra address:
NTSC-U/C: 0x0017d248
Ghidra address:
PAL: 0x001819d8

Reimplemented from MemcardCBHandler.

◆ OnCheckInfo()

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

Start the listing unless the card reported that it cannot be read.

Parameters
pOpThe finished enquiry.
Ghidra address:
NTSC-U/C: 0x00186cc0
Ghidra address:
PAL: 0x0018c498

Reimplemented from MemcardCBHandler.

◆ OnDeleteFile()

virtual void DeleteRemixMCT::OnDeleteFile ( DeleteFileOp * pOp)
virtual

Advance the deletion, abandoning the task first when the deletion failed.

The next step runs whether the deletion succeeded or not, because the abandon path is taken before the step call rather than instead of it.

Parameters
pOpThe finished deletion.
Ghidra address:
NTSC-U/C: 0x00186d40
Ghidra address:
PAL: 0x0018c518

Reimplemented from MemcardCBHandler.

◆ Finish()

virtual void DeleteRemixMCT::Finish ( )
virtual

Report the finished deletion through MemcardUser::OnRemixDeleted().

Ghidra address:
NTSC-U/C: 0x00186db8
Ghidra address:
PAL: 0x0018c590

Implements MemcardTask.

◆ Execute()

virtual void DeleteRemixMCT::Execute ( )
virtual

Enquire about the card and start the deletion.

Ghidra address:
NTSC-U/C: 0x00186c90
Ghidra address:
PAL: 0x0018c468

Implements MemcardTask.

◆ OnFileLoaded()

virtual void DeleteRemixMCT::OnFileLoaded ( int nStatus)
virtual

Search one index for the remix.

A failed read abandons the task, and the body then continues all the same. mStep becomes 1 and the index is parsed from mStream. The first element whose RemixName matches mRemixName records its FileName in mFileName, rewinds mStream for DeleteNextFile(), and moves to step 2. With no match the next directory's index is read, and with none left the task reports kMemcardStatusNoFile.

Parameters
nStatusThe inner read's status.
Ghidra address:
NTSC-U/C: 0x0017d690
Ghidra address:
PAL: 0x00181ef8

Reimplemented from MemcardUser.

◆ OnFileSaved()

virtual void DeleteRemixMCT::OnFileSaved ( int nStatus)
virtual

Record the status of the index rewrite and advance to the next step.

Parameters
nStatusOne of MemcardStatus.
Ghidra address:
NTSC-U/C: 0x00186d98
Ghidra address:
PAL: 0x0018c570

Reimplemented from MemcardUser.


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