|
resonance 1.0.1
|
Receiver that streams a BD sound bank into the sound driver one chunk at a time. More...
#include <callbackxferbdtoiop.h>


Public Member Functions | |
| CallbackXferBdToIop (int nFile, char *pReadBuffer, int nDest, int nChunkLength, int nLength) | |
| Prepare a transfer of a bank already measured. | |
| virtual void | Done (int nHandle, int nFile, void *pBuffer, int nLength, int nStatus) |
| Move the chunk that has just been read and queue the next one. | |
| void | Resume () |
| Pick a deferred transfer back up. | |
| Public Member Functions inherited from AsyncCallback | |
| virtual | ~AsyncCallback () |
| Release the receiver. | |
Public Attributes | |
| int | mRequestId |
| int | mRemaining |
Receiver that streams a BD sound bank into the sound driver one chunk at a time.
Its RTTI descriptor is at 0x008eeed8. It has AsyncCallback as its one public base at offset 0. The vtable at 0x0081cf10 has the base's three slots and no more. The class does not add a virtual or declare a destructor; slot 1 addresses a copy of the base destructor. An instance is 0x20 bytes. The allocation at 0x00462018 measures that size, and the field range does not imply it.
The transfer is a loop of asynchronous reads of at most 0x2000 bytes. Each completion moves the chunk just read into a staging buffer on the IOP, submits it to the driver, and queues the read for the next chunk. The last chunk releases the read buffer, closes the file, and tells the driver the bank is complete.
The object registers itself with the one static CallbackXferHdToIop so that an HD transfer finishing can resume a BD transfer that deferred to it.
| CallbackXferBdToIop::CallbackXferBdToIop | ( | int | nFile, |
| char * | pReadBuffer, | ||
| int | nDest, | ||
| int | nChunkLength, | ||
| int | nLength ) |
Prepare a transfer of a bank already measured.
The transfer starts idle. StartBdBankXfer() queues the first read straight afterwards, with the same chunk length it passes here, which is why the length is a parameter rather than being derived from nLength inside.
The constructor is inlined into its one caller, which is why the vptr store and all seven field stores appear there as one run rather than as a call. It has no address of its own.
| nFile | The bank, positioned at its start. |
| pReadBuffer | The staging buffer every chunk is read into, aligned by the caller. |
| nDest | Where the driver writes the bank. |
| nChunkLength | The first chunk, which is the whole bank when it fits within kBankChunkSize. |
| nLength | The bank's length. |
|
virtual |
Move the chunk that has just been read and queue the next one.
Reports BD bank loading returned async error d for a positive status and then continues regardless. Marks the transfer busy before testing whether an HD transfer holds the shared command block, and returns with the transfer still marked busy when one does. Resume() is what picks the transfer back up.
| nHandle | The identifier the read was queued under. |
| nFile | The file the read was issued against. |
| pBuffer | The destination the read filled. |
| nLength | The number of bytes the read requested. |
| nStatus | Zero once the data is in place, or a positive failure code. |
Implements AsyncCallback.
| void CallbackXferBdToIop::Resume | ( | ) |
Pick a deferred transfer back up.
CallbackXferHdToIop::Done() is the only caller. Performs no work while an HD transfer still holds the shared command block, or while this transfer is not marked busy.
| int CallbackXferBdToIop::mRequestId |
| int CallbackXferBdToIop::mRemaining |
< Bytes of the bank still to move. Public because IsBankXferBusy() at 0x00464628 tests it through g_pBdXfer, and the image has no accessor for it. +0x18