wavelength 1.0.0
Loading...
Searching...
No Matches
memcardsync.h File Reference
Include dependency graph for memcardsync.h:

Go to the source code of this file.

Enumerations

enum  MemcardOpenFlags { kMemcardOpenRead = 0x0001 , kMemcardOpenWrite = 0x0002 , kMemcardOpenCreate = 0x0200 }
 Flags of MemcardOpenAndWait(). More...

Functions

int MemcardGetInfoAndWait (int nDevice, int *pnType, int *pnFree, int *pnFormat)
 Report the state of the memory card of a device, waiting for the result.
int MemcardOpenAndWait (int nDevice, const char *pszPath, int nFlags)
 Open a file of the memory card of a device, waiting for the result.
int MemcardCloseAndWait (int nFile)
 Close a file of a memory card, waiting for the result.
int MemcardWriteAndWait (int nFile, const void *pData, int nBytes)
 Write to a file of a memory card, waiting for the result.
int MemcardGetDirAndWait (int nDevice, const char *pszName, int nMaxEntries, int nMode, MemcardDirEntry **ppEntries)
 List the entries of the memory card of a device that match a name, waiting for the result.

Enumeration Type Documentation

◆ MemcardOpenFlags

Flags of MemcardOpenAndWait().

Enumerator
kMemcardOpenRead 

Open for reading.

kMemcardOpenWrite 

Open for writing.

kMemcardOpenCreate 

Create the file when it does not exist.

Function Documentation

◆ MemcardGetInfoAndWait()

int MemcardGetInfoAndWait ( int nDevice,
int * pnType,
int * pnFree,
int * pnFormat )

Report the state of the memory card of a device, waiting for the result.

The name is inferred. The device selects a port and a slot from a table.

Parameters
nDeviceThe device.
pnTypeReceives the card type, or null.
pnFreeReceives the free clusters, or null.
pnFormatReceives whether the card is formatted, or null.
Returns
The result of the request.
Ghidra address:
NTSC-U/C: 0x0028bcd8
Ghidra address:
PAL: 0x002954d8

◆ MemcardOpenAndWait()

int MemcardOpenAndWait ( int nDevice,
const char * pszPath,
int nFlags )

Open a file of the memory card of a device, waiting for the result.

The name is inferred.

Parameters
nDeviceThe device.
pszPathThe path of the file.
nFlagsA set of MemcardOpenFlags.
Returns
The descriptor of the file, or a negative error.
Ghidra address:
NTSC-U/C: 0x0028bd50
Ghidra address:
PAL: 0x00295550

◆ MemcardCloseAndWait()

int MemcardCloseAndWait ( int nFile)

Close a file of a memory card, waiting for the result.

The name is inferred.

Parameters
nFileThe descriptor of the file.
Returns
The result of the request.
Ghidra address:
NTSC-U/C: 0x0028bdb8
Ghidra address:
PAL: 0x002955b8

◆ MemcardWriteAndWait()

int MemcardWriteAndWait ( int nFile,
const void * pData,
int nBytes )

Write to a file of a memory card, waiting for the result.

The name is inferred.

Parameters
nFileThe descriptor of the file.
pDataThe bytes.
nBytesThe number of bytes.
Returns
The bytes written, or a negative error.
Ghidra address:
NTSC-U/C: 0x0028be18
Ghidra address:
PAL: 0x00295618

◆ MemcardGetDirAndWait()

int MemcardGetDirAndWait ( int nDevice,
const char * pszName,
int nMaxEntries,
int nMode,
MemcardDirEntry ** ppEntries )

List the entries of the memory card of a device that match a name, waiting for the result.

The name is inferred. At most 20 entries are listed. The listing callback records the entries and not the count, and the call therefore always returns -1.

Parameters
nDeviceThe device.
pszNameThe path, optionally ending in a wildcard.
nMaxEntriesThe most entries to list.
nModeZero to start a listing, nonzero to continue it.
ppEntriesReceives the entries.
Returns
-1.
Ghidra address:
NTSC-U/C: 0x0028be90
Ghidra address:
PAL: 0x00295690