ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <tamtypes.h>
Go to the source code of this file.
Data Structures | |
struct | sceCdCLOCK |
struct | sceCdlFILE |
struct | sceCdlLOCCD |
struct | sceCdRMode |
struct | sceCdRChain |
Macros | |
#define | SCE_CdSTREAM 0x40000000 |
#define | btoi(b) ((b)/16*10 + (b)%16) |
#define | itob(i) ((i)/10*16 + (i)%10) |
#define | CdlMAXTOC 100 |
#define | CdlMAXFILE 64 |
#define | CdlMAXDIR 128 |
#define | CdlMAXLEVEL 8 |
#define | SCECdNoCheckReady 0x00000001 |
#define | SCECdNoWriteBackDCache 0x00000002 |
Typedefs | |
typedef void(* | sceCdCBFunc) (int reason) |
Functions | |
int | sceCdRead (u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode) |
int | sceCdReadDVDV (u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode) |
int | sceCdReadCDDA (u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode) |
int | sceCdGetToc (u8 *toc) |
int | sceCdSeek (u32 lbn) |
int | sceCdStandby (void) |
int | sceCdStop (void) |
int | sceCdPause (void) |
int | sceCdReadChain (sceCdRChain *tag, sceCdRMode *mode) |
int | sceCdReadClock (sceCdCLOCK *clock) |
int | sceCdWriteClock (const sceCdCLOCK *clock) |
int | sceCdGetDiskType (void) |
int | sceCdGetError (void) |
int | sceCdTrayReq (int param, u32 *traychk) |
int | sceCdStatus (void) |
int | sceCdBreak (void) |
int | sceCdCancelPOffRdy (u32 *result) |
int | sceCdBlueLEDCtl (u8 control, u32 *result) |
int | sceCdPowerOff (u32 *result) |
int | sceCdMmode (int media) |
int | sceCdChangeThreadPriority (int priority) |
int | sceCdStStart (u32 lbn, sceCdRMode *mode) |
int | sceCdStRead (u32 sectors, u32 *buffer, u32 mode, u32 *error) |
int | sceCdStStop (void) |
int | sceCdStSeek (u32 lbn) |
int | sceCdStInit (u32 bufmax, u32 bankmax, void *buffer) |
int | sceCdStStat (void) |
int | sceCdStPause (void) |
int | sceCdStResume (void) |
int | sceCdInit (int mode) |
int | sceCdSync (int mode) |
int | sceCdSearchFile (sceCdlFILE *file, const char *name) |
int | sceCdDiskReady (int mode) |
sceCdlLOCCD * | sceCdIntToPos (u32 i, sceCdlLOCCD *p) |
u32 | sceCdPosToInt (sceCdlLOCCD *p) |
u32 | sceCdGetReadPos (void) |
int | sceCdInitEeCB (int priority, void *stackAddr, int stackSize) |
sceCdCBFunc | sceCdCallback (sceCdCBFunc function) |
int | sceCdReadSUBQ (void *buffer, u32 *status) |
int | sceCdForbidDVDP (u32 *result) |
int | sceCdAutoAdjustCtrl (int mode, u32 *result) |
int | sceCdDecSet (unsigned char arg1, unsigned char arg2, unsigned char shift) |
int | sceCdReadKey (unsigned char arg1, unsigned char arg2, unsigned int command, unsigned char *key) |
int | sceCdSetHDMode (u32 mode) |
int | sceCdCloseConfig (u32 *result) |
int | sceCdReadConfig (void *buffer, u32 *result) |
int | sceCdWriteConfig (const void *buffer, u32 *result) |
int | sceCdReadNVM (u32 address, u16 *data, u8 *result) |
int | sceCdWriteNVM (u32 address, u16 data, u8 *result) |
int | sceCdRI (u8 *buffer, u32 *result) |
int | sceCdWI (const u8 *buffer, u32 *result) |
int | sceCdReadConsoleID (u8 *buffer, u32 *result) |
int | sceCdWriteConsoleID (const u8 *buffer, u32 *status) |
int | sceCdCtrlADout (int arg1, u32 *status) |
int | sceCdMV (u8 *buffer, u32 *status) |
int | sceCdBootCertify (const u8 *romname) |
int | sceCdRM (char *buffer, u32 *status) |
int | sceCdWM (const char *buffer, u32 *status) |
int | sceCdForbidRead (u32 *result) |
int | sceCdReadFull (unsigned long int lsn, unsigned long int sectors, void *buf, sceCdRMode *mode) |
int | sceCdStSeekF (unsigned long int lsn) |
void * | sceCdPOffCallback (void(*func)(void *), void *addr) |
int | sceCdSetTimeout (int param, int timeout) |
int | sceCdReadModelID (unsigned long int *id) |
int | sceCdReadDvdDualInfo (int *on_dual, unsigned long int *layer1_start) |
int | sceCdLayerSearchFile (sceCdlFILE *fp, const char *path, int layer) |
int | sceCdStatus2 (void) |
int | sceCdRE (unsigned long int lsn, unsigned long int sectors, void *buf, sceCdRMode *mode) |
int | sceCdRcBypassCtl (int mode, u32 *status) |
Common definitions for libcdvd on the EE and IOP
Definition in file libcdvd-common.h.
#define btoi | ( | b | ) | ((b)/16*10 + (b)%16) |
Definition at line 213 of file libcdvd-common.h.
#define CdlMAXDIR 128 |
Maximum number of total directories.
Definition at line 249 of file libcdvd-common.h.
#define CdlMAXFILE 64 |
Maximum number of files in a directory.
Definition at line 247 of file libcdvd-common.h.
#define CdlMAXLEVEL 8 |
Maximum levels of directories.
Definition at line 251 of file libcdvd-common.h.
#define CdlMAXTOC 100 |
max number of toc entries for sceCdGetToc()
Definition at line 220 of file libcdvd-common.h.
#define itob | ( | i | ) | ((i)/10*16 + (i)%10) |
Definition at line 216 of file libcdvd-common.h.
#define SCE_CdSTREAM 0x40000000 |
Open file for streaming
Definition at line 23 of file libcdvd-common.h.
#define SCECdNoCheckReady 0x00000001 |
Definition at line 263 of file libcdvd-common.h.
#define SCECdNoWriteBackDCache 0x00000002 |
Definition at line 264 of file libcdvd-common.h.
typedef void(* sceCdCBFunc) (int reason) |
sceCd callback function typedef for sceCdCallback()
Definition at line 234 of file libcdvd-common.h.
Enumerator | |
---|---|
SCECdFuncRead | |
SCECdFuncReadCDDA | |
SCECdFuncGetToc | |
SCECdFuncSeek | |
SCECdFuncStandby | |
SCECdFuncStop | |
SCECdFuncPause | |
SCECdFuncBreak |
Definition at line 222 of file libcdvd-common.h.
enum SCECdvdDriveState |
Enumerator | |
---|---|
SCECdStatStop | |
SCECdStatShellOpen | |
SCECdStatSpin | |
SCECdStatRead | |
SCECdStatPause | |
SCECdStatSeek | |
SCECdStatEmg |
Definition at line 155 of file libcdvd-common.h.
enum SCECdvdErrorCode |
Definition at line 69 of file libcdvd-common.h.
enum SCECdvdInitMode |
Enumerator | |
---|---|
SCECdINIT | Initializes library and waits until commands can be sent. |
SCECdINoD | Initialize only the library. |
SCECdEXIT | Deinitialize library. |
Definition at line 236 of file libcdvd-common.h.
enum SCECdvdInterruptCode |
Definition at line 129 of file libcdvd-common.h.
enum SCECdvdMediaType |
Definition at line 109 of file libcdvd-common.h.
enum SCECdvdSectorType |
Enumerator | |
---|---|
SCECdSecS2048 | |
SCECdSecS2328 | |
SCECdSecS2340 | |
SCECdSecS2352 | |
SCECdSecS2368 | |
SCECdSecS2448 |
Definition at line 25 of file libcdvd-common.h.
enum SCECdvdSpinValue |
Definition at line 37 of file libcdvd-common.h.
enum SCECdvdStreamMode |
Enumerator | |
---|---|
STMNBLK | Stream without blocking. |
STMBLK | Stream, but block. |
Definition at line 255 of file libcdvd-common.h.
enum SCECdvdTrayReqMode |
Enumerator | |
---|---|
SCECdTrayOpen | |
SCECdTrayClose | |
SCECdTrayCheck |
Definition at line 148 of file libcdvd-common.h.
int sceCdAutoAdjustCtrl | ( | int | mode, |
u32 * | result | ||
) |
Controls automatic adjustment of the CD/DVD drive. This also causes the auto-tilt motor (on units that have one) to be activated.
mode | Mode |
result | Result code. |
blue led control
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
control | control value |
result | result |
int sceCdBootCertify | ( | const u8 * | romname | ) |
Performs bootup certification. SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
romname | ROM version - The ROM "name" of the console in this format: romname[0] - ROM major version number (In decimal). romname[1] - ROM minor version number (In decimal). romname[2] - ROM region. romname[3] - Console type (E.g. C, D or T). |
int sceCdBreak | ( | void | ) |
'breaks' the currently executing command
sceCdCBFunc sceCdCallback | ( | sceCdCBFunc | function | ) |
set sceCd callback function
function | pointer to new callback function |
int sceCdCancelPOffRdy | ( | u32 * | result | ) |
cancel power off
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
result | result |
int sceCdChangeThreadPriority | ( | int | priority | ) |
change libcdvd thread priority
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
priority | priority |
int sceCdCloseConfig | ( | u32 * | result | ) |
Closes the configuration block.
result | Result code. |
int sceCdCtrlADout | ( | int | arg1, |
u32 * | status | ||
) |
Controls Audio Digital output.
arg1 | Unknown |
status | Result code. |
int sceCdDecSet | ( | unsigned char | arg1, |
unsigned char | arg2, | ||
unsigned char | shift | ||
) |
Controls on-the-fly (hardware) data decryption. Setting all options to 0 will disable decryption. This is used for decrypting encrypted sectors like the PlayStation 2 logo.
arg1 | Unknown |
arg2 | Unknown |
shift | Shift amount |
int sceCdDiskReady | ( | int | mode | ) |
checks if drive is ready
mode | mode |
int sceCdForbidDVDP | ( | u32 * | result | ) |
Disables (Forbids) the DVD READ N-command, so that DVD video disc sectors cannot be read. Support for the DVD READ N-command is re-enabled when a DVD player is loaded.
result | Result code. |
int sceCdForbidRead | ( | u32 * | result | ) |
Disables (Forbids) the READ N-command, so that disc sectors cannot be read. Support for the READ N-command is re-enabled when the disc is replaced. SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
result | Result code. |
int sceCdGetDiskType | ( | void | ) |
gets the type of the currently inserted disc
int sceCdGetError | ( | void | ) |
gets the last error that occurred
u32 sceCdGetReadPos | ( | void | ) |
get the current read position (when reading using sceCdRead)
int sceCdGetToc | ( | u8 * | toc | ) |
get toc from inserted disc
toc | buffer to hold toc (1024 bytes) |
int sceCdInit | ( | int | mode | ) |
initializes libcdvd
mode | mode (SCECdvdInitModes) |
int sceCdInitEeCB | ( | int | priority, |
void * | stackAddr, | ||
int | stackSize | ||
) |
initialise EE callback thread
priority | callback thread priority |
stackAddr | callback thread stack address |
stackSize | callback thread stack size |
sceCdlLOCCD* sceCdIntToPos | ( | u32 | i, |
sceCdlLOCCD * | p | ||
) |
convert from sector number to minute:second:frame
int sceCdLayerSearchFile | ( | sceCdlFILE * | fp, |
const char * | path, | ||
int | layer | ||
) |
Retrieves basic information about a file on CD or the specified layer of DVD media. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
fp | file structure to get file info in |
path | name of file to search for (no wildcard characters) (should be in the form '\SYSTEM.CNF;1') |
layer | layer to search (0 for the first layer, 1 for the second layer) |
int sceCdMmode | ( | int | media | ) |
set media mode
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
media | media mode (SCECdvdMModeMediaTypes) |
Reads MECHACON version data (RR MM mm TT): RR = Magicgate region, MM = major, mm = minor, TT = system type (00 = PS2, 01 = PSX) Magicgate region codes are: 00 = Japan, 01 = USA, 02 = Europe, 03 = Oceania, 04 = Asia, 05 = Russia, 06 = China, and 07 = Mexico.
NOTE: The old CDVDMAN module only returns MM mm TT instead. The region byte is made up of the lower 7 bits of the status/result code.
buffer | Pointer to the buffer to store the version data in. |
status | Result code. |
int sceCdPause | ( | void | ) |
pauses ps2 sceCd drive non-blocking, requires sceCdSync() call
void* sceCdPOffCallback | ( | void(*)(void *) | func, |
void * | addr | ||
) |
Sets a handler for the power-off event which will be called before the console switches off. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
func | pointer of callback function to be called when power-off processing is activated |
addr | an argument which will be passed to the callback function returns: a pointer to the previous handler function, or a null pointer if nothing has been set eariler |
u32 sceCdPosToInt | ( | sceCdlLOCCD * | p | ) |
convert from minute:second:frame to sector number
int sceCdPowerOff | ( | u32 * | result | ) |
power off
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
result | result |
int sceCdRcBypassCtl | ( | int | mode, |
u32 * | status | ||
) |
Controls remote-control bypass SUPPORTED BY ONLY PSX CDVDMAN MODULES
mode | 0 = Bypass, 1 = Normal |
status | Result code. |
int sceCdRE | ( | unsigned long int | lsn, |
unsigned long int | sectors, | ||
void * | buf, | ||
sceCdRMode * | mode | ||
) |
Reads sectors from CD or DVD disc. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
lsn | sector location to start from |
sectors | amount to sectors to read |
buf | pointer to a buffer |
mode | mode to read in |
int sceCdRead | ( | u32 | lbn, |
u32 | sectors, | ||
void * | buffer, | ||
sceCdRMode * | mode | ||
) |
read data from disc non-blocking, requires sceCdSync() call
lbn | sector location to start reading from |
sectors | number of sectors to read |
buffer | buffer to read to |
mode | mode to read as |
int sceCdReadCDDA | ( | u32 | lbn, |
u32 | sectors, | ||
void * | buffer, | ||
sceCdRMode * | mode | ||
) |
int sceCdReadChain | ( | sceCdRChain * | tag, |
sceCdRMode * | mode | ||
) |
do a 'chain' of reads with one command last chain value must be all 0xFFFFFFFF (max of 64 reads can be set at once) non-blocking, requires sceCdSync() call
SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
tag | pointer to an array of read chain data |
mode | read mode |
int sceCdReadClock | ( | sceCdCLOCK * | clock | ) |
Reads the PlayStation clock. (time value is in BCD)
NOTE: For the old CDVDMAN module, the month field will not have its most significant bit automatically filed off.
clock | time/date struct |
int sceCdReadConfig | ( | void * | buffer, |
u32 * | result | ||
) |
Reads the configuration block(s) that was/were previously opened. Each block is 15 bytes long.
buffer | Pointer to the buffer to store the configuration data in. |
result | Result code. |
Reads the ID of the console. This is not the same as the i.Link ID.
buffer | Pointer to the buffer that will contain the data read. |
result | Result code. |
int sceCdReadDvdDualInfo | ( | int * | on_dual, |
unsigned long int * | layer1_start | ||
) |
Reads the information about DVD disk. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
on_dual | pointer to variable where type of DVD disc is returned |
layer1_start | pointer to variable where the address of the second layer of a dual-layer DVD disc is returned. |
int sceCdReadDVDV | ( | u32 | lbn, |
u32 | sectors, | ||
void * | buffer, | ||
sceCdRMode * | mode | ||
) |
int sceCdReadFull | ( | unsigned long int | lsn, |
unsigned long int | sectors, | ||
void * | buf, | ||
sceCdRMode * | mode | ||
) |
Reads sectors to a buffer SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
lsn | sector location to start from |
sectors | amount to sectors to read |
buf | pointer to a buffer |
mode | mode to read in |
int sceCdReadKey | ( | unsigned char | arg1, |
unsigned char | arg2, | ||
unsigned int | command, | ||
unsigned char * | key | ||
) |
Reads the requested key from the CD/DVD.
arg1 | Unknown |
arg2 | Unknown |
command | Command |
key | Buffer to store the key in. |
int sceCdReadModelID | ( | unsigned long int * | id | ) |
Reads the Model ID. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN DNAS IOPRP ONLY
id | integer where the Model ID is stored. |
Reads a single word from the NVRAM storage.
address | Address in 2-byte words, of the word that will be read. |
data | Pointer to the buffer that will contain the data read. |
result | Result code. |
int sceCdReadSUBQ | ( | void * | buffer, |
u32 * | status | ||
) |
Reads SUBQ data from the disc.
buffer | Pointer to the buffer for storing the SUBQ data in. |
status | Result code. |
Reads the i.Link ID of the console. All consoles have an i.Link ID, including those that do not have a physical i.Link port.
buffer | Pointer to the buffer that will contain the data read. |
result | Result code. |
int sceCdRM | ( | char * | buffer, |
u32 * | status | ||
) |
Reads the console's model "name": e.g. "SCPH-39000". SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
buffer | Pointer to the buffer for storing the model name in. |
status | Result code. |
int sceCdSearchFile | ( | sceCdlFILE * | file, |
const char * | name | ||
) |
search for a file on disc
file | file structure to get file info in |
name | name of file to search for (no wildcard characters) (should be in the form '\SYSTEM.CNF;1') |
int sceCdSeek | ( | u32 | lbn | ) |
seek to given sector on disc non-blocking, requires sceCdSync() call
lbn | sector to seek to on disc |
int sceCdSetHDMode | ( | u32 | mode | ) |
Sets the "HD mode", whatever that means.
mode | mode |
int sceCdSetTimeout | ( | int | param, |
int | timeout | ||
) |
Sets the timeout lengths for the certain CDVDMAN's operations. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
param | the timeout type to set |
timeout | a timeout value |
int sceCdStandby | ( | void | ) |
puts ps2 sceCd drive into standby mode non-blocking, requires sceCdSync() call
int sceCdStatus | ( | void | ) |
gets the state of the drive
int sceCdStatus2 | ( | void | ) |
Returns the CD/DVD drive status. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
init streaming
bufmax | stream buffer size |
bankmax | number of ring buffers |
buffer | buffer address on iop |
int sceCdStop | ( | void | ) |
stops ps2 sceCd drive from spinning non-blocking, requires sceCdSync() call
int sceCdStPause | ( | void | ) |
pause streaming
read stream data
sectors | number of sectors to read |
buffer | read buffer address |
mode | data stream mode (STMNBLK or STMBLK) |
error | error value holder |
int sceCdStResume | ( | void | ) |
continue streaming
int sceCdStSeek | ( | u32 | lbn | ) |
seek to a new stream position
lbn | sector location to start streaming from |
int sceCdStSeekF | ( | unsigned long int | lsn | ) |
Seeks to a given position SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY
lsn | sector location to seek to |
int sceCdStStart | ( | u32 | lbn, |
sceCdRMode * | mode | ||
) |
start streaming data
lbn | sector location to start streaming from |
mode | mode to read in |
int sceCdStStat | ( | void | ) |
get stream read status
int sceCdStStop | ( | void | ) |
stop streaming
int sceCdSync | ( | int | mode | ) |
waits/checks for completion of n-commands
mode | 0 = wait for completion of command (blocking), 1 = check current status and return immediately |
int sceCdTrayReq | ( | int | param, |
u32 * | traychk | ||
) |
open/close/check disk tray
param | param (SCECdvdTrayReqMode) |
traychk | address for returning tray state change |
Writes a new i.Link ID for the console. Does not work on consoles starting from the SCPH-50000 ("Dragon" MECHACON):
buffer | Pointer to the buffer that contains the new i.Link ID. |
result | Result code. |
int sceCdWM | ( | const char * | buffer, |
u32 * | status | ||
) |
Sets the console's model name. Does not work on consoles starting from the SCPH-50000 ("Dragon" MECHACON). SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY
buffer | Pointer to a buffer containing the new model name. |
status | Result code. |
int sceCdWriteClock | ( | const sceCdCLOCK * | clock | ) |
Sets the PlayStation 2 clock. (time value is in BCD)
clock | time/date struct to set clocks time with |
int sceCdWriteConfig | ( | const void * | buffer, |
u32 * | result | ||
) |
Writes to the configuration block(s) that was/were previously opened. Each block is 15 bytes long.
buffer | Pointer to the buffer that contains the new configuration data. |
result | Result code. |
Writes a new ID for the console. This is not the same as the i.Link ID. Does not work on consoles starting from the SCPH-50000 ("Dragon" MECHACON):
buffer | Pointer to the buffer that contains the new i.Link ID. |
status | Result code. |
Writes a single word to the NVRAM storage. Does not fully work on consoles starting from the SCPH-50000 ("Dragon" MECHACON): Some parts, like those containing the console IDs, cannot be overwritten.
address | Address in 2-byte words, of the word that will be written to. |
data | Pointer to the buffer that contains the new data. |
result | Result code. |