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

Write to an open memory-card file. More...

#include <writeop.h>

Inheritance diagram for WriteOp:
Collaboration diagram for WriteOp:

Public Member Functions

 WriteOp (MemcardCBHandler *pHandler, int nPortSlot, int nFile, const void *pBuffer, int nLength, int nCookie)
 Construct a write against an open descriptor.
virtual ~WriteOp ()
virtual void Execute ()
virtual void NotifyDone ()
virtual void InterpretResult ()
 Record the transferred byte count, or map the failure through a jump table.
Public Member Functions inherited from MemcardOp
 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.

Public Attributes

int mBytesTransferred
 Bytes transferred, valid once mStatus is kMemcardStatusOk.
int mFile
 The descriptor to write to.
const void * mBuffer
 The source.
int mLength
 The number of bytes to write.
Public Attributes inherited from MemcardOp
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().

Additional Inherited Members

Protected Attributes inherited from MemcardOp
int mPortSlot
MemcardCBHandler * mHandler

Detailed Description

Write to an open memory-card file.

Its RTTI descriptor is at 0x008f4840. It has single inheritance from MemcardOp at offset 0. An instance is 0x2c bytes and the vtable is at 0x0082bd30.

Execute() addresses the descriptor rather than the card. MemcardOp::mPortSlot is therefore recorded and never read.

Constructor & Destructor Documentation

◆ WriteOp()

WriteOp::WriteOp ( MemcardCBHandler * pHandler,
int nPortSlot,
int nFile,
const void * pBuffer,
int nLength,
int nCookie )

Construct a write against an open descriptor.

Parameters
pHandlerThe receiver NotifyDone() reports to.
nPortSlotThe packed port and slot, which Execute() does not use.
nFileThe descriptor OpenWriteOp delivered.
pBufferThe source.
nLengthThe number of bytes to write.
nCookieThe tag Memcard::Cancel() matches on.
Ghidra address:
NTSC-U/C: 0x0055e9b8
Ghidra address:
PAL: 0x0059fc88

◆ ~WriteOp()

virtual WriteOp::~WriteOp ( )
virtual
Ghidra address:
NTSC-U/C: 0x0055dab0
Ghidra address:
PAL: 0x0059ed28

Member Function Documentation

◆ Execute()

virtual void WriteOp::Execute ( )
virtual
Ghidra address:
NTSC-U/C: 0x0055e9e8
Ghidra address:
PAL: 0x0059fcb8

Reimplemented from MemcardOp.

◆ NotifyDone()

virtual void WriteOp::NotifyDone ( )
virtual
Ghidra address:
NTSC-U/C: 0x0055dae0
Ghidra address:
PAL: 0x0059ed58

Reimplemented from MemcardOp.

◆ InterpretResult()

virtual void WriteOp::InterpretResult ( )
virtual

Record the transferred byte count, or map the failure through a jump table.

The table at 0x0082bfd0 covers the seven libmc codes from sceMcResFailReplace up to sceMcResNoFormat, indexed by the result plus eight. This is the only operation that produces kMemcardStatusWriteDenied.

Ghidra address:
NTSC-U/C: 0x0055ea20
Ghidra address:
PAL: 0x0059fcf0

Reimplemented from MemcardOp.

Member Data Documentation

◆ mBytesTransferred

int WriteOp::mBytesTransferred

Bytes transferred, valid once mStatus is kMemcardStatusOk.

+0x1c

◆ mFile

int WriteOp::mFile

The descriptor to write to.

+0x20

◆ mBuffer

const void* WriteOp::mBuffer

The source.

+0x24

◆ mLength

int WriteOp::mLength

The number of bytes to write.

+0x28


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