UMD Kernel Library


Data Structures

struct  pspUmdInfo
 UMD Info struct. More...

Typedefs

typedef int(* UmdCallback )(int unknown, int event)
 UMD Callback function.

Enumerations

enum  pspUmdTypes { PSP_UMD_TYPE_GAME = 0x10, PSP_UMD_TYPE_VIDEO = 0x20, PSP_UMD_TYPE_AUDIO = 0x40 }
 Enumeration for UMD types. More...
enum  pspUmdState {
  PSP_UMD_NOT_PRESENT = 0x01, PSP_UMD_PRESENT = 0x02, PSP_UMD_CHANGED = 0x04, PSP_UMD_INITING = 0x08,
  PSP_UMD_INITED = 0x10, PSP_UMD_READY = 0x20
}
 Enumeration for UMD drive state. More...
enum  UmdDriveStat { UMD_WAITFORDISC = PSP_UMD_PRESENT, UMD_WAITFORINIT = PSP_UMD_READY }
 Enumeration for UMD stats (legacy). More...

Functions

int sceUmdCheckMedium (void)
 Check whether there is a disc in the UMD drive.
int sceUmdGetDiscInfo (pspUmdInfo *info)
 Get the disc info.
int sceUmdActivate (int unit, const char *drive)
 Activates the UMD drive.
int sceUmdDeactivate (int unit, const char *drive)
 Deativates the UMD drive.
int sceUmdWaitDriveStat (int stat)
 Wait for the UMD drive to reach a certain state.
int sceUmdWaitDriveStatWithTimer (int stat, unsigned int timeout)
 Wait for the UMD drive to reach a certain state.
int sceUmdWaitDriveStatCB (int stat, unsigned int timeout)
 Wait for the UMD drive to reach a certain state (plus callback).
int sceUmdCancelWaitDriveStat (void)
 Cancel a sceUmdWait* call.
int sceUmdGetDriveStat (void)
 Get (poll) the current state of the UMD drive.
int sceUmdGetErrorStat (void)
 Get the error code associated with a failed event.
int sceUmdRegisterUMDCallBack (int cbid)
 Register a callback for the UMD drive.
int sceUmdUnRegisterUMDCallBack (int cbid)
 Un-register a callback for the UMD drive.
int sceUmdReplacePermit (void)
 Permit UMD disc being replaced.
int sceUmdReplaceProhibit (void)
 Prohibit UMD disc being replaced.


Typedef Documentation

typedef int(* UmdCallback)(int unknown, int event)

UMD Callback function.


Enumeration Type Documentation

Enumeration for UMD drive state.

Enumerator:
PSP_UMD_NOT_PRESENT 
PSP_UMD_PRESENT 
PSP_UMD_CHANGED 
PSP_UMD_INITING 
PSP_UMD_INITED 
PSP_UMD_READY 

Enumeration for UMD types.

Enumerator:
PSP_UMD_TYPE_GAME 
PSP_UMD_TYPE_VIDEO 
PSP_UMD_TYPE_AUDIO 

Enumeration for UMD stats (legacy).

Enumerator:
UMD_WAITFORDISC  Wait for disc to be inserted.
UMD_WAITFORINIT  Wait for the UMD to be initialised so it can be accessed from the mapped drive.


Function Documentation

int sceUmdActivate ( int  unit,
const char *  drive 
)

Activates the UMD drive.

Parameters:
unit - The unit to initialise (probably). Should be set to 1.
drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
Returns:
< 0 on error
Example:
 // Wait for disc and mount to filesystem
 int i;
 i = sceUmdCheckMedium();
 if(i == 0)
 {
    sceUmdWaitDriveStat(PSP_UMD_PRESENT);
 }
 sceUmdActivate(1, "disc0:"); // Mount UMD to disc0: file system
 sceUmdWaitDriveStat(PSP_UMD_READY);
 // Now you can access the UMD using standard sceIo functions

int sceUmdCancelWaitDriveStat ( void   ) 

Cancel a sceUmdWait* call.

Returns:
< 0 on error

int sceUmdCheckMedium ( void   ) 

Check whether there is a disc in the UMD drive.

Returns:
0 if no disc present, anything else indicates a disc is inserted.

int sceUmdDeactivate ( int  unit,
const char *  drive 
)

Deativates the UMD drive.

Parameters:
unit - The unit to initialise (probably). Should be set to 1.
drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
Returns:
< 0 on error

int sceUmdGetDiscInfo ( pspUmdInfo info  ) 

Get the disc info.

Parameters:
info - A pointer to a pspUmdInfo struct
Returns:
< 0 on error

int sceUmdGetDriveStat ( void   ) 

Get (poll) the current state of the UMD drive.

Returns:
< 0 on error, one or more of pspUmdState on success

int sceUmdGetErrorStat ( void   ) 

Get the error code associated with a failed event.

Returns:
< 0 on error, the error code on success

int sceUmdRegisterUMDCallBack ( int  cbid  ) 

Register a callback for the UMD drive.

Note:
Callback is of type UmdCallback
Parameters:
cbid - A callback ID created from sceKernelCreateCallback
Returns:
< 0 on error
Example:
 int umd_callback(int unknown, int event)
 {
      //do something
 }     
 int cbid = sceKernelCreateCallback("UMD Callback", umd_callback, NULL);
 sceUmdRegisterUMDCallBack(cbid);

int sceUmdReplacePermit ( void   ) 

Permit UMD disc being replaced.

Returns:
< 0 on error

int sceUmdReplaceProhibit ( void   ) 

Prohibit UMD disc being replaced.

Returns:
< 0 on error

int sceUmdUnRegisterUMDCallBack ( int  cbid  ) 

Un-register a callback for the UMD drive.

Parameters:
cbid - A callback ID created from sceKernelCreateCallback
Returns:
< 0 on error

int sceUmdWaitDriveStat ( int  stat  ) 

Wait for the UMD drive to reach a certain state.

Parameters:
stat - One or more of pspUmdState
Returns:
< 0 on error

int sceUmdWaitDriveStatCB ( int  stat,
unsigned int  timeout 
)

Wait for the UMD drive to reach a certain state (plus callback).

Parameters:
stat - One or more of pspUmdState
timeout - Timeout value in microseconds
Returns:
< 0 on error

int sceUmdWaitDriveStatWithTimer ( int  stat,
unsigned int  timeout 
)

Wait for the UMD drive to reach a certain state.

Parameters:
stat - One or more of pspUmdState
timeout - Timeout value in microseconds
Returns:
< 0 on error


Generated on Thu Sep 9 07:01:14 2010 for pspsdk-1.0+beta2 by  doxygen 1.5.6