|
resonance 1.0.1
|
One queued memory-card operation. More...
#include <memcardop.h>


Public Member Functions | |
| MemcardOp (MemcardCBHandler *pHandler, int nPortSlot, int nCookie) | |
| Construct an operation against one card slot, with no libmc call issued yet. | |
| MemcardOp (MemcardCBHandler *pHandler, int nCookie) | |
| Construct an operation against an open descriptor alone. | |
| virtual | ~MemcardOp () |
| Release the operation. | |
| virtual void | Execute () |
| Start the libmc call this operation stands for and record that it is in flight. | |
| virtual void | NotifyDone () |
| Interpret the finished libmc call and report it to the handler. | |
| virtual void | InterpretResult () |
| Map mResult to mStatus, and copy any result the call delivered out of it. | |
Public Attributes | |
| int | mCookie |
| Ticket number Memcard::Cancel() matches on. | |
| int | mIssued |
| Zero until Execute() has run, then 1 while libmc is servicing the call. | |
| int | mResult |
| The libmc result, as sceMcSync() delivered it. | |
| int | mStatus |
| One of MemcardStatus, written by InterpretResult(). | |
Protected Attributes | |
| int | mPortSlot |
| MemcardCBHandler * | mHandler |
One queued memory-card operation.
Its RTTI descriptor is at 0x0086f608. It has no base class. The vptr therefore sits after the data at offset 0x18 rather than at offset 0. An instance is 0x1c bytes and the vtable is at 0x0082c050.
Fourteen classes derive from this one, one per libmc entry point, and each of them supplies the three virtuals below. Memcard owns the queue, constructs an operation on the heap for every request, and drives it through Execute(), then NotifyDone(), then destruction.
The three method titles are inferred from the bodies. No string in the image identifies any of them. The base bodies at 0x0055f310, 0x0055f318 and 0x0055f320 are each a single jr ra, so all three virtuals are declared with an empty body rather than as pure virtuals.
Neither mResult nor mStatus is written by either constructor. An operation that libmc has not finished therefore reports whatever those two words stored when the block was allocated.
| MemcardOp::MemcardOp | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nCookie ) |
Construct an operation against one card slot, with no libmc call issued yet.
Every derived constructor writes these four members itself rather than delegating, because the compiler inlined this body into all twelve of the operations that address a card. No address of its own survives.
| pHandler | The receiver NotifyDone() reports to. |
| nPortSlot | The port shifted up by kMemcardPortShift, with the slot in the low bits. |
| nCookie | The tag Memcard::Cancel() matches on. |
| MemcardOp::MemcardOp | ( | MemcardCBHandler * | pHandler, |
| int | nCookie ) |
Construct an operation against an open descriptor alone.
mPortSlot is not written. SeekOp and CloseOp are the two operations that use this form, and neither reads mPortSlot.
| pHandler | The receiver NotifyDone() reports to. |
| nCookie | The tag Memcard::Cancel() matches on. |
|
virtual |
Release the operation.
The body is empty. MemcardPS2::Update() destroys an operation through this slot as soon as NotifyDone() has returned.
|
virtual |
Start the libmc call this operation stands for and record that it is in flight.
Every derived body ends by writing 1 to mIssued, which is what moves the operation from the queue head into the polling state.
Reimplemented in CheckInfoOp, CloseOp, CreateDirOp, DeleteFileOp, EntSpaceOp, FormatOp, ListDirOp, OpenReadOp, OpenWriteOp, ReadOp, RenameFileOp, SeekOp, UnformatOp, and WriteOp.
|
virtual |
Interpret the finished libmc call and report it to the handler.
Each derived body calls InterpretResult() on itself and then the one MemcardCBHandler method that matches the operation's type.
Reimplemented in CheckInfoOp, CloseOp, CreateDirOp, DeleteFileOp, EntSpaceOp, FormatOp, ListDirOp, OpenReadOp, OpenWriteOp, ReadOp, RenameFileOp, SeekOp, UnformatOp, and WriteOp.
|
virtual |
Map mResult to mStatus, and copy any result the call delivered out of it.
Reimplemented in CheckInfoOp, CloseOp, CreateDirOp, DeleteFileOp, EntSpaceOp, FormatOp, ListDirOp, OpenReadOp, OpenWriteOp, ReadOp, RenameFileOp, SeekOp, UnformatOp, and WriteOp.
| int MemcardOp::mCookie |
Ticket number Memcard::Cancel() matches on.
Public because Memcard::Cancel() compares this member against its argument directly, and the image exposes no accessor. Every MemcardTask passes its own ticket, which MemcardManager's task factories draw by pre-incrementing MemcardManager::mTicket. Cancelling a task therefore abandons exactly the operations that task queued.
+0x04
| int MemcardOp::mIssued |
Zero until Execute() has run, then 1 while libmc is servicing the call.
Public because MemcardPS2::Update() reads it directly.
+0x08
| int MemcardOp::mResult |
The libmc result, as sceMcSync() delivered it.
Public because MemcardPS2::Update() writes it directly.
+0x0c
| int MemcardOp::mStatus |
One of MemcardStatus, written by InterpretResult().
Public because every MemcardCBHandler implementation reads it directly.
+0x10
|
protected |
|
protected |