resonance 1.0.1
Loading...
Searching...
No Matches
memcardop.h
Go to the documentation of this file.
1#pragma once
2
4
6constexpr int kMemcardPortShift = 8;
7
9constexpr int kMemcardSlotMask = 0xff;
10
12constexpr int kMemcardOpNotIssued = 0;
13
15constexpr int kMemcardOpInFlight = 1;
16
45
64class MemcardOp {
65public:
77 MemcardOp(MemcardCBHandler *pHandler, int nPortSlot, int nCookie);
78
88 MemcardOp(MemcardCBHandler *pHandler, int nCookie);
89
99 virtual ~MemcardOp();
100
110 virtual void Execute();
111
121 virtual void NotifyDone();
122
129 virtual void InterpretResult();
130
142
151
160
169
170protected:
171 // The port shifted up by kMemcardPortShift with the slot in the low bits. Every Execute() body
172 // that addresses a card rather than an open descriptor unpacks this member. +0x00
174
175 // The receiver NotifyDone() reports to. +0x14
177};
Receiver notified once a queued memory-card operation has finished.
Definition memcardcbhandler.h:34
MemcardCBHandler * mHandler
Definition memcardop.h:176
virtual void NotifyDone()
Interpret the finished libmc call and report it to the handler.
MemcardOp(MemcardCBHandler *pHandler, int nPortSlot, int nCookie)
Construct an operation against one card slot, with no libmc call issued yet.
int mIssued
Zero until Execute() has run, then 1 while libmc is servicing the call.
Definition memcardop.h:150
MemcardOp(MemcardCBHandler *pHandler, int nCookie)
Construct an operation against an open descriptor alone.
int mResult
The libmc result, as sceMcSync() delivered it.
Definition memcardop.h:159
virtual void Execute()
Start the libmc call this operation stands for and record that it is in flight.
int mStatus
One of MemcardStatus, written by InterpretResult().
Definition memcardop.h:168
virtual void InterpretResult()
Map mResult to mStatus, and copy any result the call delivered out of it.
int mPortSlot
Definition memcardop.h:173
int mCookie
Ticket number Memcard::Cancel() matches on.
Definition memcardop.h:141
virtual ~MemcardOp()
Release the operation.
MemcardStatus
Abstract result a memory-card operation reports through MemcardOp::mStatus.
Definition memcardop.h:31
@ kMemcardStatusNoFile
Definition memcardop.h:41
@ kMemcardStatusTooManyOpen
Definition memcardop.h:38
@ kMemcardStatusDenied
Definition memcardop.h:37
@ kMemcardStatusWriteDenied
Definition memcardop.h:39
@ kMemcardStatusBadFile
Definition memcardop.h:36
@ kMemcardStatusNoDirectory
Definition memcardop.h:40
@ kMemcardStatusOk
Definition memcardop.h:32
@ kMemcardStatusUnknown
Definition memcardop.h:43
@ kMemcardStatusNoEntry
Definition memcardop.h:35
@ kMemcardStatusCardFull
Definition memcardop.h:34
@ kMemcardStatusNotFormatted
Definition memcardop.h:33
@ kMemcardStatusFailed
Definition memcardop.h:42
constexpr int kMemcardOpInFlight
MemcardOp::mIssued while libmc is servicing the call.
Definition memcardop.h:15
constexpr int kMemcardPortShift
Bits MemcardOp::mPortSlot shifts the controller port up by.
Definition memcardop.h:6
constexpr int kMemcardSlotMask
Bits of MemcardOp::mPortSlot that store the slot inside the port.
Definition memcardop.h:9
constexpr int kMemcardOpNotIssued
MemcardOp::mIssued before the libmc call has been started.
Definition memcardop.h:12