|
sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
|
#include <tamtypes.h>#include <kernel.h>#include <sifrpc.h>#include <string.h>#include <iopcontrol.h>#include "libmc.h"Go to the source code of this file.
Classes | |
| struct | libmc_name_param_stru |
| union | libmc_name_desc_param_unio |
| union | libmc_rdata_param_unio |
| struct | libmc_page_read_align_data_stru |
| union | libmc_extra_send_recv_unio |
| struct | mcExtraEndParam_ |
| struct | libmc_interface_data_stru |
| struct | libmc_internal_data_ |
| struct | libmc_target_desc_ |
Macros | |
| #define | LIBMC_PRE_CHECK_FLAG_ONLY_TYPE 1 |
| #define | LIBMC_PRE_RPC(target, flags, only_type) |
Typedefs | |
| typedef struct mcExtraEndParam_ | mcExtraEndParam_t |
| typedef struct libmc_internal_data_ | libmc_internal_data_t |
| typedef struct libmc_target_desc_ | libmc_target_desc_t |
Functions | |
| 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) |
| int | xfromInit (int type) |
| int | xfromGetInfo (int port, int slot, int *type, int *free, int *format) |
| int | xfromOpen (int port, int slot, const char *name, int mode) |
| int | xfromClose (int fd) |
| int | xfromSeek (int fd, int offset, int origin) |
| int | xfromRead (int fd, void *buffer, int size) |
| int | xfromWrite (int fd, const void *buffer, int size) |
| int | xfromFlush (int fd) |
| int | xfromMkDir (int port, int slot, const char *name) |
| int | xfromChdir (int port, int slot, const char *newDir, char *currentDir) |
| int | xfromGetDir (int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir *table) |
| int | xfromSetFileInfo (int port, int slot, const char *name, const sceMcTblGetDir *info, unsigned flags) |
| int | xfromDelete (int port, int slot, const char *name) |
| int | xfromFormat (int port, int slot) |
| int | xfromUnformat (int port, int slot) |
| int | xfromGetEntSpace (int port, int slot, const char *path) |
| int | xfromRename (int port, int slot, const char *oldName, const char *newName) |
| int | xfromEraseBlock (int port, int slot, int block, int mode) |
| int | xfromReadPage (int port, int slot, unsigned int page, void *buffer) |
| int | xfromWritePage (int port, int slot, int page, const void *buffer) |
| int | xfromChangeThreadPriority (int level) |
| int | xfromSync (int mode, int *cmd, int *result) |
| int | xfromReset (void) |
Function defenitions for mclib.
Definition in file libmc.c.
| #define LIBMC_PRE_RPC | ( | target, | |
| flags, | |||
| only_type ) |
| int mcChangeThreadPriority | ( | int | level | ) |
| int mcChdir | ( | int | port, |
| int | slot, | ||
| const char * | newDir, | ||
| char * | currentDir ) |
| int mcClose | ( | int | fd | ) |
| int mcDelete | ( | int | port, |
| int | slot, | ||
| const char * | name ) |
| 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 mcFlush | ( | int | fd | ) |
| int mcFormat | ( | int | port, |
| int | slot ) |
| 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 mcGetEntSpace | ( | int | port, |
| int | slot, | ||
| const char * | path ) |
| 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 mcInit | ( | int | type | ) |
| int mcMkDir | ( | int | port, |
| int | slot, | ||
| const char * | name ) |
| int mcOpen | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| int | mode ) |
| int mcRead | ( | int | fd, |
| void * | buffer, | ||
| int | size ) |
| 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 mcRename | ( | int | port, |
| int | slot, | ||
| const char * | oldName, | ||
| const char * | newName ) |
| int mcReset | ( | void | ) |
| int mcSeek | ( | int | fd, |
| int | offset, | ||
| int | origin ) |
| int mcSetFileInfo | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| const sceMcTblGetDir * | info, | ||
| unsigned | flags ) |
| 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 mcUnformat | ( | int | port, |
| int | slot ) |
| int mcWrite | ( | int | fd, |
| const void * | buffer, | ||
| int | size ) |
| 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 xfromChangeThreadPriority | ( | int | level | ) |
| int xfromChdir | ( | int | port, |
| int | slot, | ||
| const char * | newDir, | ||
| char * | currentDir ) |
| int xfromClose | ( | int | fd | ) |
| int xfromDelete | ( | int | port, |
| int | slot, | ||
| const char * | name ) |
| int xfromEraseBlock | ( | int | port, |
| int | slot, | ||
| int | block, | ||
| int | mode ) |
Erases a block on the external flash ROM. Note: The current implementation of xfromserv does not support this. xfromSync 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 xfromWritePage is used to fill in its contents later on), 0 for normal operation. |
| int xfromFlush | ( | int | fd | ) |
| int xfromFormat | ( | int | port, |
| int | slot ) |
| int xfromGetDir | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| unsigned | mode, | ||
| int | maxent, | ||
| sceMcTblGetDir * | table ) |
get external flash ROM filelist xfromSync result: 0 or more = number of file entries obtained (success) -2 = unformatted external flash ROM -4 = dirname error
| port | port number of external flash ROM |
| slot | slot number of external flash ROM |
| 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 | external flash ROM table array |
| int xfromGetEntSpace | ( | int | port, |
| int | slot, | ||
| const char * | path ) |
| int xfromGetInfo | ( | int | port, |
| int | slot, | ||
| int * | type, | ||
| int * | free, | ||
| int * | format ) |
get external flash ROM state xfromSync result: 0 = same external flash ROM as last getInfo call -1 = formatted external flash ROM inserted since last getInfo call -2 = unformatted external flash ROM inserted since last getInfo call < -2 = external flash ROM access error (could be due to accessing psx external flash ROM)
| port | port number |
| slot | slot number |
| type | pointer to get external flash ROM type |
| free | pointer to get number of free clusters |
| format | pointer to get whether or not the external flash ROM is formatted |
| int xfromInit | ( | int | type | ) |
| int xfromMkDir | ( | int | port, |
| int | slot, | ||
| const char * | name ) |
| int xfromOpen | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| int | mode ) |
| int xfromRead | ( | int | fd, |
| void * | buffer, | ||
| int | size ) |
| int xfromReadPage | ( | int | port, |
| int | slot, | ||
| unsigned int | page, | ||
| void * | buffer ) |
Reads a page from the external flash ROM. Note: The current implementation of xfromserv does not support this. xfromSync 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 xfromRename | ( | int | port, |
| int | slot, | ||
| const char * | oldName, | ||
| const char * | newName ) |
| int xfromReset | ( | void | ) |
| int xfromSeek | ( | int | fd, |
| int | offset, | ||
| int | origin ) |
| int xfromSetFileInfo | ( | int | port, |
| int | slot, | ||
| const char * | name, | ||
| const sceMcTblGetDir * | info, | ||
| unsigned | flags ) |
| int xfromSync | ( | int | mode, |
| int * | cmd, | ||
| int * | result ) |
wait for external flash ROM 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 xfromUnformat | ( | int | port, |
| int | slot ) |
| int xfromWrite | ( | int | fd, |
| const void * | buffer, | ||
| int | size ) |
| int xfromWritePage | ( | int | port, |
| int | slot, | ||
| int | page, | ||
| const void * | buffer ) |
Writes a page to the external flash ROM. (The block which the page resides on must be erased first!) Note: The current implementation of xfromserv does not support this. xfromSync 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. |