PSPSDK 2025-03-30
Loading...
Searching...
No Matches
UMD Kernel Library

This module contains the imports for UMD drive. More...

Data Structures

struct  pspUmdInfo
 UMD Info struct. More...
 

Typedefs

typedef struct pspUmdInfo pspUmdInfo
 UMD Info struct.
 
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.
 

Detailed Description

This module contains the imports for UMD drive.

Typedef Documentation

◆ pspUmdInfo

typedef struct pspUmdInfo pspUmdInfo

UMD Info struct.

◆ UmdCallback

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

UMD Callback function.

Enumeration Type Documentation

◆ pspUmdState

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 

◆ pspUmdTypes

Enumeration for UMD types.

Enumerator
PSP_UMD_TYPE_GAME 
PSP_UMD_TYPE_VIDEO 
PSP_UMD_TYPE_AUDIO 

◆ UmdDriveStat

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

◆ sceUmdActivate()

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;
if(i == 0)
{
}
sceUmdActivate(1, "disc0:"); // Mount UMD to disc0: file system
// Now you can access the UMD using standard sceIo functions
int sceUmdCheckMedium(void)
Check whether there is a disc in the UMD drive.
int sceUmdActivate(int unit, const char *drive)
Activates the UMD drive.
int sceUmdWaitDriveStat(int stat)
Wait for the UMD drive to reach a certain state.
@ PSP_UMD_PRESENT
Definition pspumd.h:49
@ PSP_UMD_READY
Definition pspumd.h:53
int i[4]
Definition psptypes.h:4

◆ sceUmdCancelWaitDriveStat()

int sceUmdCancelWaitDriveStat ( void )

Cancel a sceUmdWait* call.

Returns
< 0 on error

◆ sceUmdCheckMedium()

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.

◆ sceUmdDeactivate()

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

◆ sceUmdGetDiscInfo()

int sceUmdGetDiscInfo ( pspUmdInfo * info)

Get the disc info.

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

◆ sceUmdGetDriveStat()

int sceUmdGetDriveStat ( void )

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

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

◆ sceUmdGetErrorStat()

int sceUmdGetErrorStat ( void )

Get the error code associated with a failed event.

Returns
< 0 on error, the error code on success

◆ sceUmdRegisterUMDCallBack()

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);
int sceKernelCreateCallback(const char *name, SceKernelCallbackFunction func, void *arg)
Create callback.
int sceUmdRegisterUMDCallBack(int cbid)
Register a callback for the UMD drive.
#define NULL
Definition psptypes.h:31

◆ sceUmdReplacePermit()

int sceUmdReplacePermit ( void )

Permit UMD disc being replaced.

Returns
< 0 on error

◆ sceUmdReplaceProhibit()

int sceUmdReplaceProhibit ( void )

Prohibit UMD disc being replaced.

Returns
< 0 on error

◆ sceUmdUnRegisterUMDCallBack()

int sceUmdUnRegisterUMDCallBack ( int cbid)

Un-register a callback for the UMD drive.

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

◆ sceUmdWaitDriveStat()

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

◆ sceUmdWaitDriveStatCB()

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

◆ sceUmdWaitDriveStatWithTimer()

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