|
PS2SDK
PS2 Homebrew Libraries
|
#include <libmc-common.h>
Include dependency graph for libmc.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | mcIcon |
| struct | _sceMcTblGetDir |
| struct | mcTable |
| struct | mcTable._create |
| struct | mcTable._modify |
Macros | |
| #define | MC_WAIT 0 |
| #define | MC_NOWAIT 1 |
| #define | MC_TYPE_PSX sceMcTypePS1 |
| #define | MC_TYPE_PS2 sceMcTypePS2 |
| #define | MC_TYPE_POCKET sceMcTypePDA |
| #define | MC_TYPE_NONE sceMcTypeNoCard |
| #define | MC_FORMATTED 1 |
| #define | MC_UNFORMATTED 0 |
| #define | MC_ATTR_READABLE sceMcFileAttrReadable |
| #define | MC_ATTR_WRITEABLE sceMcFileAttrWriteable |
| #define | MC_ATTR_EXECUTABLE sceMcFileAttrExecutable |
| #define | MC_ATTR_PROTECTED sceMcFileAttrDupProhibit |
| #define | MC_ATTR_FILE sceMcFileAttrFile |
| #define | MC_ATTR_SUBDIR sceMcFileAttrSubdir |
| #define | MC_ATTR_OBJECT (sceMcFileAttrFile|sceMcFileAttrSubdir) |
| #define | MC_ATTR_CLOSED sceMcFileAttrClosed |
| #define | MC_ATTR_PDAEXEC sceMcFileAttrPDAExec |
| #define | MC_ATTR_PSX sceMcFileAttrPS1 |
| #define | MC_ATTR_HIDDEN sceMcFileAttrHidden |
| #define | MC_TYPE_MC 0 |
| #define | MC_TYPE_XMC 1 |
Typedefs | |
| typedef int | iconIVECTOR[4] |
| typedef float | iconFVECTOR[4] |
Enumerations | |
| enum | MC_FUNC_NUMBERS { MC_FUNC_NONE = 0x00, MC_FUNC_GET_INFO, MC_FUNC_OPEN, MC_FUNC_CLOSE, MC_FUNC_SEEK, MC_FUNC_READ, MC_FUNC_WRITE, MC_FUNC_FLUSH = 0x0A, MC_FUNC_MK_DIR, MC_FUNC_CH_DIR, MC_FUNC_GET_DIR, MC_FUNC_SET_INFO, MC_FUNC_DELETE, MC_FUNC_FORMAT, MC_FUNC_UNFORMAT, MC_FUNC_GET_ENT, MC_FUNC_RENAME, MC_FUNC_CHG_PRITY, MC_FUNC_ERASE_BLOCK = 0x5A, MC_FUNC_READ_PAGE, MC_FUNC_WRITE_PAGE } |
| enum | MCICON_TYPES { MCICON_TYPE_SAVED_DATA = 0, MCICON_TYPE_SOFTWARE_PS2, MCICON_TYPE_SOFTWARE_PKT, MCICON_TYPE_SETTINGS_DATA, MCICON_TYPE_SYSTEM_DRIVER } |
Functions | |
| struct _sceMcTblGetDir | __attribute__ ((aligned(64))) |
| aligned (64))) | |
| int | mcInit (int type) |
| int | mcGetInfo (int port, int slot, int *type, int *free, int *format) |
| int | mcOpen (int port, int slot, const char *name, int mode) |
| int | mcClose (int fd) |
| int | mcSeek (int fd, int offset, int origin) |
| int | mcRead (int fd, void *buffer, int size) |
| int | mcWrite (int fd, const void *buffer, int size) |
| int | mcFlush (int fd) |
| int | mcMkDir (int port, int slot, const char *name) |
| int | mcChdir (int port, int slot, const char *newDir, char *currentDir) |
| int | mcGetDir (int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir *table) |
| int | mcSetFileInfo (int port, int slot, const char *name, const sceMcTblGetDir *info, unsigned flags) |
| int | mcDelete (int port, int slot, const char *name) |
| int | mcFormat (int port, int slot) |
| int | mcUnformat (int port, int slot) |
| int | mcGetEntSpace (int port, int slot, const char *path) |
| int | mcRename (int port, int slot, const char *oldName, const char *newName) |
| int | mcEraseBlock (int port, int slot, int block, int mode) |
| int | mcReadPage (int port, int slot, unsigned int page, void *buffer) |
| int | mcWritePage (int port, int slot, int page, const void *buffer) |
| int | mcChangeThreadPriority (int level) |
| int | mcSync (int mode, int *cmd, int *result) |
| int | mcReset (void) |
Variables | |
| sceMcStDateTime | _Create |
| sceMcStDateTime | _Modify |
| u32 | FileSizeByte |
| u16 | AttrFile |
| u16 | Reserve1 |
| u32 | Reserve2 |
| u32 | PdaAplNo |
| unsigned char | EntryName [32] |
Macros, structures & function prototypes for mclib.
Definition in file libmc.h.
| struct mcIcon |
| struct _sceMcTblGetDir |
Collaboration diagram for _sceMcTblGetDir:| Data Fields | ||
|---|---|---|
| sceMcStDateTime | _Create | |
| sceMcStDateTime | _Modify | |
| u32 | FileSizeByte | |
| u16 | AttrFile | |
| u16 | Reserve1 | |
| u32 | Reserve2 | |
| u32 | PdaAplNo | |
| unsigned char | EntryName[32] | |
| char | EntryName[32] | |
| struct mcTable |
| struct mcTable._create |
| struct mcTable._modify |
| #define MC_ATTR_OBJECT (sceMcFileAttrFile|sceMcFileAttrSubdir) |
| #define MC_ATTR_HIDDEN sceMcFileAttrHidden |
| enum MC_FUNC_NUMBERS |
| enum MCICON_TYPES |
| int mcInit | ( | int | type | ) |
| int mcGetInfo | ( | int | port, |
| int | slot, | ||
| int * | type, | ||
| int * | free, | ||
| int * | format | ||
| ) |
get memcard state mcSync result: 0 = same card as last getInfo call -1 = formatted card inserted since last getInfo call -2 = unformatted card inserted since last getInfo call < -2 = memcard access error (could be due to accessing psx memcard)
| port | port number |
| slot | slot number |
| type | pointer to get memcard type |
| free | pointer to get number of free clusters |
| format | pointer to get whether or not the card is formatted (Note: Originally, sceMcGetInfo didn't have a 5th argument for returning the format status. As this is emulated based on the return value of sceMcSync() when rom0:MCSERV is used, please keep track of the return value from sceMcSync instead!) |
| int mcOpen | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| int | mode | ||
| ) |
| int mcClose | ( | int | fd | ) |
| int mcSeek | ( | int | fd, |
| int | offset, | ||
| int | origin | ||
| ) |
| int mcRead | ( | int | fd, |
| void * | buffer, | ||
| int | size | ||
| ) |
| int mcWrite | ( | int | fd, |
| const void * | buffer, | ||
| int | size | ||
| ) |
| int mcFlush | ( | int | fd | ) |
| int mcMkDir | ( | int | port, |
| int | slot, | ||
| const char * | name | ||
| ) |
| int mcChdir | ( | int | port, |
| int | slot, | ||
| const char * | newDir, | ||
| char * | currentDir | ||
| ) |
change current dir (can also get current dir) mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
| newDir | new dir to change to |
| currentDir | buffer to get current dir (use 0 if not needed) |
Definition at line 573 of file libmc.c.
References g_currentCmd, and g_mclibInited.
| int mcGetDir | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| unsigned | mode, | ||
| int | maxent, | ||
| sceMcTblGetDir * | table | ||
| ) |
get memcard filelist mcSync result: 0 or more = number of file entries obtained (success) -2 = unformatted card -4 = dirname error
| port | port number of memcard |
| slot | slot number of memcard |
| name | filename to search for (can use wildcard and relative dirs) |
| mode | mode: 0 = first call, otherwise = followup call |
| maxext | maximum number of entries to be written to filetable in 1 call |
| table | mc table array |
| int mcSetFileInfo | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| const sceMcTblGetDir * | info, | ||
| unsigned | flags | ||
| ) |
| int mcDelete | ( | int | port, |
| int | slot, | ||
| const char * | name | ||
| ) |
| int mcFormat | ( | int | port, |
| int | slot | ||
| ) |
format memory card mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
Definition at line 681 of file libmc.c.
References g_currentCmd, and g_mclibInited.
| int mcUnformat | ( | int | port, |
| int | slot | ||
| ) |
unformat memory card mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
Definition at line 703 of file libmc.c.
References g_currentCmd, and g_mclibInited.
| int mcGetEntSpace | ( | int | port, |
| int | slot, | ||
| const char * | path | ||
| ) |
| int mcRename | ( | int | port, |
| int | slot, | ||
| const char * | oldName, | ||
| const char * | newName | ||
| ) |
rename file or dir on memcard Note: rom0:MCSERV does not support this. mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
| oldName | name of file/dir to rename |
| newName | new name to give to file/dir |
Definition at line 749 of file libmc.c.
References g_mclibInited, and g_mcType.
| int mcEraseBlock | ( | int | port, |
| int | slot, | ||
| int | block, | ||
| int | mode | ||
| ) |
Erases a block on the memory card. Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
| block | Block number of the block to be erased. |
| mode | Mode: -1 to inhibit ECC recalculation of the erased block's pages (useful if sceMcWritePage is used to fill in its contents later on), 0 for normal operation. |
| int mcReadPage | ( | int | port, |
| int | slot, | ||
| unsigned int | page, | ||
| void * | buffer | ||
| ) |
Reads a page from the memory card. Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
| page | Page number of the page to be read. |
| buffer | Pointer to buffer that will contain the read data. |
| int mcWritePage | ( | int | port, |
| int | slot, | ||
| int | page, | ||
| const void * | buffer | ||
| ) |
Writes a page to the memory card. (The block which the page resides on must be erased first!) Note: rom0:XMCSERV does not support this. mcSync returns: 0 if ok < 0 if error
| port | port number |
| slot | slot number |
| page | Page number of the page to be written. |
| buffer | Pointer to buffer containing data to be written. |
| int mcChangeThreadPriority | ( | int | level | ) |
change mcserv thread priority (I don't think this is implemented properly) Note: rom0:MCSERV does not support this. mcSync returns: 0 if ok < 0 if error
| level | thread priority |
Definition at line 875 of file libmc.c.
References g_mclibInited, and g_mcType.
| int mcSync | ( | int | mode, |
| int * | cmd, | ||
| int * | result | ||
| ) |
wait for mc functions to finish or check if they have finished yet
| mode | mode 0=wait till function finishes, 1=check function status |
| cmd | pointer for storing the number of the currenlty processing function |
| result | pointer for storing result of function if it finishes |
| int mcReset | ( | void | ) |
Reset (force deinit) of library
Definition at line 940 of file libmc.c.
References g_mclibInited.