|
wavelength 1.0.0
|

Go to the source code of this file.
Functions | |
| void | MemcardInit () |
| Start the memory card library and give slot 0 to port 0 and slot 1 to port 1. | |
| void | MemcardTerminate () |
| Stop the memory card library. | |
| void | MemcardAssignSlots (bool bPort0Multitap, bool bPort1Multitap) |
| Give the memory card slots to the controller ports. | |
| void | MemcardPoll () |
| Advance the memory card command in flight. | |
| void | MemcardGetInfo (MemcardCBHandler *pHandler, int nPort, int *pnType, int *pnFree, int *pnFormat) |
| Start reading the type, the free space, and the format of a card. | |
| void | MemcardOpen (MemcardCBHandler *pHandler, int nPort, const char *pszName, int nMode) |
| Start opening a file. | |
| void | MemcardClose (MemcardCBHandler *pHandler, int nFd) |
| Start closing a file. | |
| void | MemcardRead (MemcardCBHandler *pHandler, int nFd, void *pBuffer, int nSize) |
| Start reading a file. | |
| void | MemcardWrite (MemcardCBHandler *pHandler, int nFd, const void *pData, int nSize) |
| Start writing a file. | |
| void | MemcardSeek (MemcardCBHandler *pHandler, int nFd, int nOffset, int nMode) |
| Start moving the position of a file. | |
| void | MemcardMkdir (MemcardCBHandler *pHandler, int nPort, const char *pszName) |
| Start creating a directory. | |
| void | MemcardGetDir (MemcardCBHandler *pHandler, int nPort, const char *pszName, int nMaxEntries, int nMode) |
| Start listing the entries that match a name. | |
| void | MemcardDelete (MemcardCBHandler *pHandler, int nPort, const char *pszName) |
| Start deleting a file or an empty directory. | |
| void | MemcardFormat (MemcardCBHandler *pHandler, int nPort) |
| Start formatting a card. | |
| void | MemcardUnformat (MemcardCBHandler *pHandler, int nPort) |
| Start unformatting a card. | |
| const char * | MemcardGetSlotName (int nPort) |
| Report the localisation token of the name of a memory card slot. | |
Variables | |
| constexpr int | kMemcardSlotCount = 4 |
| The number of memory card slots, four multitap slots of the first port. | |
| void MemcardInit | ( | ) |
Start the memory card library and give slot 0 to port 0 and slot 1 to port 1.
| void MemcardTerminate | ( | ) |
Stop the memory card library.
| void MemcardAssignSlots | ( | bool | bPort0Multitap, |
| bool | bPort1Multitap ) |
Give the memory card slots to the controller ports.
With bPort0Multitap set, slots 0 to 3 are the four multitap slots of port 0. Otherwise slot 0 is port 0, slot 1 is port 1 unless bPort1Multitap is set, and the other slots are unused.
| bPort0Multitap | Whether a multitap is connected to port 0. |
| bPort1Multitap | Whether a multitap is connected to port 1. |
| void MemcardPoll | ( | ) |
Advance the memory card command in flight.
Without waiting, the routine queries the library whether the command finished. A finished command reports its result to the handler that issued it, through the handler method for the command. A command the routine does not know is reported as Bad memcard func: d.
| void MemcardGetInfo | ( | MemcardCBHandler * | pHandler, |
| int | nPort, | ||
| int * | pnType, | ||
| int * | pnFree, | ||
| int * | pnFormat ) |
Start reading the type, the free space, and the format of a card.
MemcardCBHandler::OnGetInfo() receives the result.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| pnType | Receives the card type. |
| pnFree | Receives the free space in kilobytes. |
| pnFormat | Receives non-zero for a formatted card. |
| void MemcardOpen | ( | MemcardCBHandler * | pHandler, |
| int | nPort, | ||
| const char * | pszName, | ||
| int | nMode ) |
Start opening a file.
MemcardCBHandler::OnOpen() receives the file descriptor or the error.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| pszName | The file. |
| nMode | The library's open mode bits. |
| void MemcardClose | ( | MemcardCBHandler * | pHandler, |
| int | nFd ) |
Start closing a file.
MemcardCBHandler::OnClose() receives the result.
| pHandler | The handler of the result. |
| nFd | The file descriptor. |
| void MemcardRead | ( | MemcardCBHandler * | pHandler, |
| int | nFd, | ||
| void * | pBuffer, | ||
| int | nSize ) |
Start reading a file.
MemcardCBHandler::OnRead() receives the result.
| pHandler | The handler of the result. |
| nFd | The file descriptor. |
| pBuffer | Receives the bytes. |
| nSize | The number of bytes. |
| void MemcardWrite | ( | MemcardCBHandler * | pHandler, |
| int | nFd, | ||
| const void * | pData, | ||
| int | nSize ) |
Start writing a file.
MemcardCBHandler::OnWrite() receives the result.
| pHandler | The handler of the result. |
| nFd | The file descriptor. |
| pData | The bytes. |
| nSize | The number of bytes. |
| void MemcardSeek | ( | MemcardCBHandler * | pHandler, |
| int | nFd, | ||
| int | nOffset, | ||
| int | nMode ) |
Start moving the position of a file.
MemcardCBHandler::OnSeek() receives the result.
| pHandler | The handler of the result. |
| nFd | The file descriptor. |
| nOffset | The offset. |
| nMode | The origin of the offset. |
| void MemcardMkdir | ( | MemcardCBHandler * | pHandler, |
| int | nPort, | ||
| const char * | pszName ) |
Start creating a directory.
MemcardCBHandler::OnMkdir() receives the result.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| pszName | The directory. |
| void MemcardGetDir | ( | MemcardCBHandler * | pHandler, |
| int | nPort, | ||
| const char * | pszName, | ||
| int | nMaxEntries, | ||
| int | nMode ) |
Start listing the entries that match a name.
At most 20 entries are listed, whatever nMaxEntries requests. MemcardCBHandler::OnGetDir() receives the count and the entries.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| pszName | The name. It may include wildcards. |
| nMaxEntries | The number of entries requested. |
| nMode | The library's listing mode. |
| void MemcardDelete | ( | MemcardCBHandler * | pHandler, |
| int | nPort, | ||
| const char * | pszName ) |
Start deleting a file or an empty directory.
MemcardCBHandler::OnDelete() receives the result.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| pszName | The file or directory. |
| void MemcardFormat | ( | MemcardCBHandler * | pHandler, |
| int | nPort ) |
Start formatting a card.
MemcardCBHandler::OnFormat() receives the result.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| void MemcardUnformat | ( | MemcardCBHandler * | pHandler, |
| int | nPort ) |
Start unformatting a card.
MemcardCBHandler::OnUnformat() receives the result.
| pHandler | The handler of the result. |
| nPort | The memory card slot. |
| const char * MemcardGetSlotName | ( | int | nPort | ) |
Report the localisation token of the name of a memory card slot.
| nPort | The memory card slot. |
|
constexpr |
The number of memory card slots, four multitap slots of the first port.