ps2sdk  1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
libcdvd-common.h File Reference
#include <tamtypes.h>
+ Include dependency graph for libcdvd-common.h:
+ This graph shows which files directly or indirectly include this file:

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)
 

Enumerations

enum  SCECdvdSectorType {
  SCECdSecS2048 =0 ,
  SCECdSecS2328 ,
  SCECdSecS2340 ,
  SCECdSecS2352 =0 ,
  SCECdSecS2368 ,
  SCECdSecS2448
}
 
enum  SCECdvdSpinValue {
  SCECdSpinMax =0 ,
  SCECdSpinStm =0 ,
  SCECdSpinDvdDL0 =0 ,
  SCECdSpinNom =1 ,
  SCECdSpinX1 ,
  SCECdSpinX2 ,
  SCECdSpinX4 ,
  SCECdSpinX12 ,
  SCECdSpinNm2 =10 ,
  SCECdSpin1p6 ,
  SCECdSpinMx =20
}
 
enum  SCECdvdMModeMediaType {
  SCECdMmodeCd =1 ,
  SCECdMmodeDvd
}
 
enum  SCECdvdErrorCode {
  SCECdErFAIL = -1 ,
  SCECdErNO = 0x00 ,
  SCECdErABRT ,
  SCECdErCMD = 0x10 ,
  SCECdErOPENS ,
  SCECdErNODISC ,
  SCECdErNORDY ,
  SCECdErCUD ,
  SCECdErIPI = 0x20 ,
  SCECdErILI ,
  SCECdErPRM ,
  SCECdErREAD = 0x30 ,
  SCECdErTRMOPN ,
  SCECdErEOM ,
  SCECdErSFRMTNG = 0x38 ,
  SCECdErREADCF = 0xFD ,
  SCECdErREADCFR
}
 
enum  SCECdvdMediaType {
  SCECdGDTFUNCFAIL = -1 ,
  SCECdNODISC = 0x00 ,
  SCECdDETCT ,
  SCECdDETCTCD ,
  SCECdDETCTDVDS ,
  SCECdDETCTDVDD ,
  SCECdUNKNOWN ,
  SCECdPSCD = 0x10 ,
  SCECdPSCDDA ,
  SCECdPS2CD ,
  SCECdPS2CDDA ,
  SCECdPS2DVD ,
  SCECdCDDA = 0xFD ,
  SCECdDVDV ,
  SCECdIllegalMedia
}
 
enum  SCECdvdInterruptCode {
  CdlNoIntr = 0x00 ,
  CdlDataReady ,
  SCECdComplete ,
  CdlAcknowledge ,
  CdlDataEnd ,
  CdlDiskError ,
  SCECdNotReady
}
 
enum  SCECdvdTrayReqMode {
  SCECdTrayOpen =0 ,
  SCECdTrayClose ,
  SCECdTrayCheck
}
 
enum  SCECdvdDriveState {
  SCECdStatStop = 0x00 ,
  SCECdStatShellOpen ,
  SCECdStatSpin ,
  SCECdStatRead = 0x06 ,
  SCECdStatPause = 0x0A ,
  SCECdStatSeek = 0x12 ,
  SCECdStatEmg = 0x20
}
 
enum  SCECdvdCallbackReason {
  SCECdFuncRead = 1 ,
  SCECdFuncReadCDDA ,
  SCECdFuncGetToc ,
  SCECdFuncSeek ,
  SCECdFuncStandby ,
  SCECdFuncStop ,
  SCECdFuncPause ,
  SCECdFuncBreak
}
 
enum  SCECdvdInitMode {
  SCECdINIT = 0x00 ,
  SCECdINoD ,
  SCECdEXIT = 0x05
}
 
enum  SCECdvdStreamMode {
  STMNBLK = 0 ,
  STMBLK
}
 

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)
 
sceCdlLOCCDsceCdIntToPos (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)
 

Detailed Description

Common definitions for libcdvd on the EE and IOP

Definition in file libcdvd-common.h.

Macro Definition Documentation

◆ btoi

#define btoi (   b)    ((b)/16*10 + (b)%16)

Definition at line 213 of file libcdvd-common.h.

◆ CdlMAXDIR

#define CdlMAXDIR   128

Maximum number of total directories.

Definition at line 249 of file libcdvd-common.h.

◆ CdlMAXFILE

#define CdlMAXFILE   64

Maximum number of files in a directory.

Definition at line 247 of file libcdvd-common.h.

◆ CdlMAXLEVEL

#define CdlMAXLEVEL   8

Maximum levels of directories.

Definition at line 251 of file libcdvd-common.h.

◆ CdlMAXTOC

#define CdlMAXTOC   100

max number of toc entries for sceCdGetToc()

Definition at line 220 of file libcdvd-common.h.

◆ itob

#define itob (   i)    ((i)/10*16 + (i)%10)

Definition at line 216 of file libcdvd-common.h.

◆ SCE_CdSTREAM

#define SCE_CdSTREAM   0x40000000

Open file for streaming

Definition at line 23 of file libcdvd-common.h.

◆ SCECdNoCheckReady

#define SCECdNoCheckReady   0x00000001

Definition at line 263 of file libcdvd-common.h.

◆ SCECdNoWriteBackDCache

#define SCECdNoWriteBackDCache   0x00000002

Definition at line 264 of file libcdvd-common.h.

Typedef Documentation

◆ sceCdCBFunc

typedef void(* sceCdCBFunc) (int reason)

sceCd callback function typedef for sceCdCallback()

Definition at line 234 of file libcdvd-common.h.

Enumeration Type Documentation

◆ SCECdvdCallbackReason

Enumerator
SCECdFuncRead 
SCECdFuncReadCDDA 
SCECdFuncGetToc 
SCECdFuncSeek 
SCECdFuncStandby 
SCECdFuncStop 
SCECdFuncPause 
SCECdFuncBreak 

Definition at line 222 of file libcdvd-common.h.

222  {
223  SCECdFuncRead = 1,
231 };
@ SCECdFuncReadCDDA
@ SCECdFuncPause
@ SCECdFuncStop
@ SCECdFuncRead
@ SCECdFuncBreak
@ SCECdFuncSeek
@ SCECdFuncStandby
@ SCECdFuncGetToc

◆ SCECdvdDriveState

Enumerator
SCECdStatStop 
SCECdStatShellOpen 
SCECdStatSpin 
SCECdStatRead 
SCECdStatPause 
SCECdStatSeek 
SCECdStatEmg 

Definition at line 155 of file libcdvd-common.h.

155  {
156  SCECdStatStop = 0x00,
159  SCECdStatRead = 0x06,
160  SCECdStatPause = 0x0A,
161  SCECdStatSeek = 0x12,
162  SCECdStatEmg = 0x20,
163 };
@ SCECdStatSpin
@ SCECdStatSeek
@ SCECdStatPause
@ SCECdStatRead
@ SCECdStatShellOpen
@ SCECdStatStop
@ SCECdStatEmg

◆ SCECdvdErrorCode

Enumerator
SCECdErFAIL 

Can't get error code

SCECdErNO 

No Error

SCECdErABRT 

Aborted

SCECdErCMD 

Unsupported command

SCECdErOPENS 

Tray is open

SCECdErNODISC 

No disc inserted

SCECdErNORDY 

Device not ready

SCECdErCUD 

Unsupported command for current disc

SCECdErIPI 

Illegal position/LSN

SCECdErILI 

Illegal length

SCECdErPRM 

Invalid parameter

SCECdErREAD 

Read error

SCECdErTRMOPN 

Tray was opened while reading

SCECdErEOM 

End Of Media

SCECdErSFRMTNG 
SCECdErREADCF 

Error setting command

SCECdErREADCFR 

Error setting command

Definition at line 69 of file libcdvd-common.h.

69  {
71  SCECdErFAIL = -1,
73  SCECdErNO = 0x00,
76 
78  SCECdErCMD = 0x10,
86  SCECdErCUD,
87 
89  SCECdErIPI = 0x20,
91  SCECdErILI,
93  SCECdErPRM,
94 
96  SCECdErREAD = 0x30,
100  SCECdErEOM,
101  SCECdErSFRMTNG = 0x38,
102 
104  SCECdErREADCF = 0xFD,
107 };
@ SCECdErOPENS
@ SCECdErEOM
@ SCECdErSFRMTNG
@ SCECdErIPI
@ SCECdErREAD
@ SCECdErILI
@ SCECdErNO
@ SCECdErABRT
@ SCECdErREADCF
@ SCECdErREADCFR
@ SCECdErNORDY
@ SCECdErTRMOPN
@ SCECdErCUD
@ SCECdErNODISC
@ SCECdErCMD
@ SCECdErFAIL
@ SCECdErPRM

◆ 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.

236  {
238  SCECdINIT = 0x00,
240  SCECdINoD,
242  SCECdEXIT = 0x05
243 };
@ SCECdEXIT
@ SCECdINoD
@ SCECdINIT

◆ SCECdvdInterruptCode

Enumerator
CdlNoIntr 

No interrupt

CdlDataReady 

Data Ready

SCECdComplete 

Command Complete

CdlAcknowledge 

Acknowledge (reserved)

CdlDataEnd 

End of Data Detected

CdlDiskError 

Error Detected

SCECdNotReady 

Drive Not Ready

Definition at line 129 of file libcdvd-common.h.

129  {
131  CdlNoIntr = 0x00,
133  CdlDataReady,
139  CdlDataEnd,
141  CdlDiskError,
144 
145 };
@ CdlNoIntr
@ CdlDiskError
@ CdlDataReady
@ CdlDataEnd
@ CdlAcknowledge
@ SCECdComplete
@ SCECdNotReady

◆ SCECdvdMediaType

Enumerator
SCECdGDTFUNCFAIL 
SCECdNODISC 
SCECdDETCT 
SCECdDETCTCD 
SCECdDETCTDVDS 
SCECdDETCTDVDD 
SCECdUNKNOWN 
SCECdPSCD 
SCECdPSCDDA 
SCECdPS2CD 
SCECdPS2CDDA 
SCECdPS2DVD 
SCECdCDDA 
SCECdDVDV 
SCECdIllegalMedia 

Definition at line 109 of file libcdvd-common.h.

109  {
110  SCECdGDTFUNCFAIL = -1,
111  SCECdNODISC = 0x00,
112  SCECdDETCT,
113  SCECdDETCTCD,
116  SCECdUNKNOWN,
117 
118  SCECdPSCD = 0x10,
119  SCECdPSCDDA,
120  SCECdPS2CD,
121  SCECdPS2CDDA,
122  SCECdPS2DVD,
123 
124  SCECdCDDA = 0xFD,
125  SCECdDVDV,
127 };
@ SCECdGDTFUNCFAIL
@ SCECdNODISC
@ SCECdIllegalMedia
@ SCECdPSCDDA
@ SCECdPSCD
@ SCECdUNKNOWN
@ SCECdDETCT
@ SCECdDVDV
@ SCECdDETCTDVDS
@ SCECdDETCTCD
@ SCECdPS2DVD
@ SCECdCDDA
@ SCECdPS2CDDA
@ SCECdDETCTDVDD
@ SCECdPS2CD

◆ SCECdvdMModeMediaType

Enumerator
SCECdMmodeCd 
SCECdMmodeDvd 

Definition at line 64 of file libcdvd-common.h.

64  {
65  SCECdMmodeCd=1,
67 };
@ SCECdMmodeDvd
@ SCECdMmodeCd

◆ SCECdvdSectorType

Enumerator
SCECdSecS2048 
SCECdSecS2328 
SCECdSecS2340 
SCECdSecS2352 
SCECdSecS2368 
SCECdSecS2448 

Definition at line 25 of file libcdvd-common.h.

25  {
26  /* Game CD and DVD sector types. */
27  SCECdSecS2048=0,
30 
31  /* CDDA sector types. */
32  SCECdSecS2352=0,
35 };
@ SCECdSecS2352
@ SCECdSecS2048
@ SCECdSecS2328
@ SCECdSecS2340
@ SCECdSecS2368
@ SCECdSecS2448

◆ SCECdvdSpinValue

Enumerator
SCECdSpinMax 

Spin at maximum speed

SCECdSpinStm 

Spins at the recommended speed for streaming data

SCECdSpinDvdDL0 

Spins at the DVD layer 0 speed

SCECdSpinNom 

Optimized speed. Starts reading at max speed, slows down as read errors occur.

SCECdSpinX1 

1x. For CDDA reading.

SCECdSpinX2 

2x

SCECdSpinX4 

4x

SCECdSpinX12 

12x

SCECdSpinNm2 

Optimized speed, based on current speed.

SCECdSpin1p6 

DVD x1.6 CLV

SCECdSpinMx 

Spin at maximum speed (Not sure what's the difference between this and SCECdSpinMax)

Definition at line 37 of file libcdvd-common.h.

37  {
39  SCECdSpinMax=0,
41  SCECdSpinStm=0,
44 
46  SCECdSpinNom=1,
49  //Note: These modes were taken from the PS2Linux libcdvd.h file, and they don't appear in any other Sony libcdvd.h file.
57  SCECdSpinNm2=10,
61  SCECdSpinMx=20,
62 };
@ SCECdSpinX1
@ SCECdSpinX2
@ SCECdSpin1p6
@ SCECdSpinDvdDL0
@ SCECdSpinNm2
@ SCECdSpinMax
@ SCECdSpinStm
@ SCECdSpinNom
@ SCECdSpinMx
@ SCECdSpinX12
@ SCECdSpinX4

◆ SCECdvdStreamMode

Enumerator
STMNBLK 

Stream without blocking.

STMBLK 

Stream, but block.

Definition at line 255 of file libcdvd-common.h.

255  {
257  STMNBLK = 0,
259  STMBLK
260 };
@ STMNBLK
@ STMBLK

◆ SCECdvdTrayReqMode

Enumerator
SCECdTrayOpen 
SCECdTrayClose 
SCECdTrayCheck 

Definition at line 148 of file libcdvd-common.h.

148  {
149  SCECdTrayOpen=0,
152 };
@ SCECdTrayCheck
@ SCECdTrayOpen
@ SCECdTrayClose

Function Documentation

◆ sceCdAutoAdjustCtrl()

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.

Parameters
modeMode
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdBlueLEDCtl()

int sceCdBlueLEDCtl ( u8  control,
u32 result 
)

blue led control

SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
controlcontrol value
resultresult
Returns
1 on success, 0 on failure.

◆ sceCdBootCertify()

int sceCdBootCertify ( const u8 romname)

Performs bootup certification. SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
romnameROM 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).
Returns
1 on success, 0 on failure.

◆ sceCdBreak()

int sceCdBreak ( void  )

'breaks' the currently executing command

Returns
1 on success, 0 on failure.

◆ sceCdCallback()

sceCdCBFunc sceCdCallback ( sceCdCBFunc  function)

set sceCd callback function

Parameters
functionpointer to new callback function
Returns
pointer to old function

◆ sceCdCancelPOffRdy()

int sceCdCancelPOffRdy ( u32 result)

cancel power off

SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
resultresult
Returns
1 on success, 0 on failure.

◆ sceCdChangeThreadPriority()

int sceCdChangeThreadPriority ( int  priority)

change libcdvd thread priority

SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
prioritypriority
Returns
1 on success, 0 on failure.

◆ sceCdCloseConfig()

int sceCdCloseConfig ( u32 result)

Closes the configuration block.

Parameters
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdCtrlADout()

int sceCdCtrlADout ( int  arg1,
u32 status 
)

Controls Audio Digital output.

Parameters
arg1Unknown
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdDecSet()

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.

Parameters
arg1Unknown
arg2Unknown
shiftShift amount
Returns
1 on success, 0 on failure.

◆ sceCdDiskReady()

int sceCdDiskReady ( int  mode)

checks if drive is ready

Parameters
modemode
Returns
SCECdComplete if ready, SCECdNotReady if busy

◆ sceCdForbidDVDP()

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.

Parameters
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdForbidRead()

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

Parameters
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdGetDiskType()

int sceCdGetDiskType ( void  )

gets the type of the currently inserted disc

Returns
disk type (SCECdvdMediaTypes)

◆ sceCdGetError()

int sceCdGetError ( void  )

gets the last error that occurred

Returns
error type (SCECdvdErrorCode)

◆ sceCdGetReadPos()

u32 sceCdGetReadPos ( void  )

get the current read position (when reading using sceCdRead)

◆ sceCdGetToc()

int sceCdGetToc ( u8 toc)

get toc from inserted disc

Parameters
tocbuffer to hold toc (1024 bytes)
Returns
1 on success, 0 on failure.

◆ sceCdInit()

int sceCdInit ( int  mode)

initializes libcdvd

Parameters
modemode (SCECdvdInitModes)
Returns
1 on success, 0 on failure.

◆ sceCdInitEeCB()

int sceCdInitEeCB ( int  priority,
void *  stackAddr,
int  stackSize 
)

initialise EE callback thread

Parameters
prioritycallback thread priority
stackAddrcallback thread stack address
stackSizecallback thread stack size
Returns
1 if initialised callback, 0 if only priority was changed

◆ sceCdIntToPos()

sceCdlLOCCD* sceCdIntToPos ( u32  i,
sceCdlLOCCD p 
)

convert from sector number to minute:second:frame

◆ sceCdLayerSearchFile()

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

Parameters
fpfile structure to get file info in
pathname of file to search for (no wildcard characters) (should be in the form '\SYSTEM.CNF;1')
layerlayer to search (0 for the first layer, 1 for the second layer)
Returns
1 on success, 0 on failure.

◆ sceCdMmode()

int sceCdMmode ( int  media)

set media mode

SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
mediamedia mode (SCECdvdMModeMediaTypes)
Returns
1 on success, 0 on failure.

◆ sceCdMV()

int sceCdMV ( u8 buffer,
u32 status 
)

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.

Parameters
bufferPointer to the buffer to store the version data in.
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdPause()

int sceCdPause ( void  )

pauses ps2 sceCd drive non-blocking, requires sceCdSync() call

Returns
1 on success, 0 on failure.

◆ sceCdPOffCallback()

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

Parameters
funcpointer of callback function to be called when power-off processing is activated
addran 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

◆ sceCdPosToInt()

u32 sceCdPosToInt ( sceCdlLOCCD p)

convert from minute:second:frame to sector number

◆ sceCdPowerOff()

int sceCdPowerOff ( u32 result)

power off

SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
resultresult
Returns
1 on success, 0 on failure.

◆ sceCdRcBypassCtl()

int sceCdRcBypassCtl ( int  mode,
u32 status 
)

Controls remote-control bypass SUPPORTED BY ONLY PSX CDVDMAN MODULES

Parameters
mode0 = Bypass, 1 = Normal
statusResult code.
Returns
1 on success, 0 on failure

◆ sceCdRE()

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

Parameters
lsnsector location to start from
sectorsamount to sectors to read
bufpointer to a buffer
modemode to read in
Returns
1 on success, 0 on failure.

◆ sceCdRead()

int sceCdRead ( u32  lbn,
u32  sectors,
void *  buffer,
sceCdRMode mode 
)

read data from disc non-blocking, requires sceCdSync() call

Parameters
lbnsector location to start reading from
sectorsnumber of sectors to read
bufferbuffer to read to
modemode to read as
Returns
1 on success, 0 on failure.

◆ sceCdReadCDDA()

int sceCdReadCDDA ( u32  lbn,
u32  sectors,
void *  buffer,
sceCdRMode mode 
)

◆ sceCdReadChain()

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

Parameters
tagpointer to an array of read chain data
moderead mode
Returns
1 on success, 0 on failure.

◆ sceCdReadClock()

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.

Parameters
clocktime/date struct
Returns
1 on success, 0 on failure.

◆ sceCdReadConfig()

int sceCdReadConfig ( void *  buffer,
u32 result 
)

Reads the configuration block(s) that was/were previously opened. Each block is 15 bytes long.

Parameters
bufferPointer to the buffer to store the configuration data in.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdReadConsoleID()

int sceCdReadConsoleID ( u8 buffer,
u32 result 
)

Reads the ID of the console. This is not the same as the i.Link ID.

Parameters
bufferPointer to the buffer that will contain the data read.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdReadDvdDualInfo()

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

Parameters
on_dualpointer to variable where type of DVD disc is returned
layer1_startpointer to variable where the address of the second layer of a dual-layer DVD disc is returned.
Returns
1 on success, 0 on failure.

◆ sceCdReadDVDV()

int sceCdReadDVDV ( u32  lbn,
u32  sectors,
void *  buffer,
sceCdRMode mode 
)

◆ sceCdReadFull()

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

Parameters
lsnsector location to start from
sectorsamount to sectors to read
bufpointer to a buffer
modemode to read in
Returns
1 on success, 0 on failure.

◆ sceCdReadKey()

int sceCdReadKey ( unsigned char  arg1,
unsigned char  arg2,
unsigned int  command,
unsigned char *  key 
)

Reads the requested key from the CD/DVD.

Parameters
arg1Unknown
arg2Unknown
commandCommand
keyBuffer to store the key in.
Returns
1 on success, 0 on failure.

◆ sceCdReadModelID()

int sceCdReadModelID ( unsigned long int *  id)

Reads the Model ID. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN DNAS IOPRP ONLY

Parameters
idinteger where the Model ID is stored.
Returns
1 on success, 0 on failure.

◆ sceCdReadNVM()

int sceCdReadNVM ( u32  address,
u16 data,
u8 result 
)

Reads a single word from the NVRAM storage.

Parameters
addressAddress in 2-byte words, of the word that will be read.
dataPointer to the buffer that will contain the data read.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdReadSUBQ()

int sceCdReadSUBQ ( void *  buffer,
u32 status 
)

Reads SUBQ data from the disc.

Parameters
bufferPointer to the buffer for storing the SUBQ data in.
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdRI()

int sceCdRI ( u8 buffer,
u32 result 
)

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.

Parameters
bufferPointer to the buffer that will contain the data read.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdRM()

int sceCdRM ( char *  buffer,
u32 status 
)

Reads the console's model "name": e.g. "SCPH-39000". SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY

Parameters
bufferPointer to the buffer for storing the model name in.
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdSearchFile()

int sceCdSearchFile ( sceCdlFILE file,
const char *  name 
)

search for a file on disc

Parameters
filefile structure to get file info in
namename of file to search for (no wildcard characters) (should be in the form '\SYSTEM.CNF;1')
Returns
1 on success, 0 on failure. (or no file found)

◆ sceCdSeek()

int sceCdSeek ( u32  lbn)

seek to given sector on disc non-blocking, requires sceCdSync() call

Parameters
lbnsector to seek to on disc
Returns
1 on success, 0 on failure.

◆ sceCdSetHDMode()

int sceCdSetHDMode ( u32  mode)

Sets the "HD mode", whatever that means.

Parameters
modemode
Returns
1 on success, 0 on failure.

◆ sceCdSetTimeout()

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

Parameters
paramthe timeout type to set
timeouta timeout value
Returns
1 on success, 0 on failure.

◆ sceCdStandby()

int sceCdStandby ( void  )

puts ps2 sceCd drive into standby mode non-blocking, requires sceCdSync() call

Returns
1 on success, 0 on failure.

◆ sceCdStatus()

int sceCdStatus ( void  )

gets the state of the drive

Returns
status (SCECdvdDriveStates)

◆ sceCdStatus2()

int sceCdStatus2 ( void  )

Returns the CD/DVD drive status. SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY

Returns
status

◆ sceCdStInit()

int sceCdStInit ( u32  bufmax,
u32  bankmax,
void *  buffer 
)

init streaming

Parameters
bufmaxstream buffer size
bankmaxnumber of ring buffers
bufferbuffer address on iop
Returns
1 on success, 0 on failure.

◆ sceCdStop()

int sceCdStop ( void  )

stops ps2 sceCd drive from spinning non-blocking, requires sceCdSync() call

Returns
1 on success, 0 on failure.

◆ sceCdStPause()

int sceCdStPause ( void  )

pause streaming

Returns
1 on success, 0 on failure.

◆ sceCdStRead()

int sceCdStRead ( u32  sectors,
u32 buffer,
u32  mode,
u32 error 
)

read stream data

Parameters
sectorsnumber of sectors to read
bufferread buffer address
modedata stream mode (STMNBLK or STMBLK)
errorerror value holder
Returns
number of sectors read if successful, 0 otherwise

◆ sceCdStResume()

int sceCdStResume ( void  )

continue streaming

Returns
1 on success, 0 on failure.

◆ sceCdStSeek()

int sceCdStSeek ( u32  lbn)

seek to a new stream position

Parameters
lbnsector location to start streaming from
Returns
1 on success, 0 on failure.

◆ sceCdStSeekF()

int sceCdStSeekF ( unsigned long int  lsn)

Seeks to a given position SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY

Parameters
lsnsector location to seek to
Returns
1 on success, 0 on failure.

◆ sceCdStStart()

int sceCdStStart ( u32  lbn,
sceCdRMode mode 
)

start streaming data

Parameters
lbnsector location to start streaming from
modemode to read in
Returns
1 on success, 0 on failure.

◆ sceCdStStat()

int sceCdStStat ( void  )

get stream read status

Returns
number of sectors read if successful, 0 otherwise

◆ sceCdStStop()

int sceCdStStop ( void  )

stop streaming

Returns
1 on success, 0 on failure.

◆ sceCdSync()

int sceCdSync ( int  mode)

waits/checks for completion of n-commands

Parameters
mode0 = wait for completion of command (blocking), 1 = check current status and return immediately
Returns
0 = completed, 1 = not completed

◆ sceCdTrayReq()

int sceCdTrayReq ( int  param,
u32 traychk 
)

open/close/check disk tray

Parameters
paramparam (SCECdvdTrayReqMode)
traychkaddress for returning tray state change
Returns
1 on success, 0 on failure.

◆ sceCdWI()

int sceCdWI ( const u8 buffer,
u32 result 
)

Writes a new i.Link ID for the console. Does not work on consoles starting from the SCPH-50000 ("Dragon" MECHACON):

Parameters
bufferPointer to the buffer that contains the new i.Link ID.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdWM()

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

Parameters
bufferPointer to a buffer containing the new model name.
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdWriteClock()

int sceCdWriteClock ( const sceCdCLOCK clock)

Sets the PlayStation 2 clock. (time value is in BCD)

Parameters
clocktime/date struct to set clocks time with
Returns
1 on success, 0 on failure.

◆ sceCdWriteConfig()

int sceCdWriteConfig ( const void *  buffer,
u32 result 
)

Writes to the configuration block(s) that was/were previously opened. Each block is 15 bytes long.

Parameters
bufferPointer to the buffer that contains the new configuration data.
resultResult code.
Returns
1 on success, 0 on failure.

◆ sceCdWriteConsoleID()

int sceCdWriteConsoleID ( const u8 buffer,
u32 status 
)

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):

Parameters
bufferPointer to the buffer that contains the new i.Link ID.
statusResult code.
Returns
1 on success, 0 on failure.

◆ sceCdWriteNVM()

int sceCdWriteNVM ( u32  address,
u16  data,
u8 result 
)

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.

Parameters
addressAddress in 2-byte words, of the word that will be written to.
dataPointer to the buffer that contains the new data.
resultResult code.
Returns
1 on success, 0 on failure.