RetroArch
Classes | Macros | Typedefs | Functions | Variables
dvd.h File Reference

DVD subsystem. More...

#include <gctypes.h>
#include <ogc/lwp_queue.h>
#include <ogc/disc_io.h>
Include dependency graph for dvd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _dvddiskid
 
struct  _dvdcmdblk
 
struct  _dvddrvinfo
 
struct  _dvdfileinfo
 

Macros

#define DVD_STATE_FATAL_ERROR   -1
 
#define DVD_STATE_END   0
 
#define DVD_STATE_BUSY   1
 
#define DVD_STATE_WAITING   2
 
#define DVD_STATE_COVER_CLOSED   3
 
#define DVD_STATE_NO_DISK   4
 
#define DVD_STATE_COVER_OPEN   5
 
#define DVD_STATE_WRONG_DISK   6
 
#define DVD_STATE_MOTOR_STOPPED   7
 
#define DVD_STATE_IGNORED   8
 
#define DVD_STATE_CANCELED   10
 
#define DVD_STATE_RETRY   11
 
#define DVD_ERROR_OK   0
 
#define DVD_ERROR_FATAL   -1
 
#define DVD_ERROR_IGNORED   -2
 
#define DVD_ERROR_CANCELED   -3
 
#define DVD_ERROR_COVER_CLOSED   -4
 
#define DVD_RESETHARD   0
 
#define DVD_RESETSOFT   1
 
#define DVD_RESETNONE   2
 
#define DVD_SPINMOTOR_DOWN   0x00000000
 
#define DVD_SPINMOTOR_UP   0x00000100
 
#define DVD_SPINMOTOR_ACCEPT   0x00004000
 
#define DVD_SPINMOTOR_CHECKDISK   0x00008000
 
#define DVD_SetUserData(block, data)   ((block)->usrdata = (data))
 
#define DVD_GetUserData(block)   ((block)->usrdata)
 
#define DEVICE_TYPE_GAMECUBE_DVD   (('G'<<24)|('D'<<16)|('V'<<8)|'D')
 

Typedefs

typedef struct _dvddiskid dvddiskid
 forward typedef for struct _dvddiskid More...
 
typedef struct _dvdcmdblk dvdcmdblk
 forward typedef for struct _dvdcmdblk More...
 
typedef void(* dvdcbcallback) (s32 result, dvdcmdblk *block)
 function pointer typedef for the user's operations callback More...
 
typedef struct _dvddrvinfo dvddrvinfo
 forward typedef for struct _dvddrvinfo More...
 
typedef struct _dvdfileinfo dvdfileinfo
 forward typedef for struct _dvdfileinfo More...
 
typedef void(* dvdcallback) (s32 result, dvdfileinfo *info)
 function pointer typedef for the user's DVD operation callback More...
 

Functions

void DVD_Init ()
 Initializes the DVD subsystem. More...
 
void DVD_Pause ()
 
void DVD_Reset (u32 reset_mode)
 Performs a reset of the drive and FW respectively. More...
 
s32 DVD_Mount ()
 Mounts the DVD drive. More...
 
s32 DVD_GetDriveStatus ()
 
s32 DVD_MountAsync (dvdcmdblk *block, dvdcbcallback cb)
 Mounts the DVD drive. More...
 
s32 DVD_ControlDrive (dvdcmdblk *block, u32 cmd)
 Controls the drive's motor and behavior. More...
 
s32 DVD_ControlDriveAsync (dvdcmdblk *block, u32 cmd, dvdcbcallback cb)
 Controls the drive's motor and behavior. More...
 
s32 DVD_SetGCMOffset (dvdcmdblk *block, s64 offset)
 
s32 DVD_SetGCMOffsetAsync (dvdcmdblk *block, s64 offset, dvdcbcallback cb)
 
s32 DVD_GetCmdBlockStatus (dvdcmdblk *block)
 
s32 DVD_SpinUpDrive (dvdcmdblk *block)
 
s32 DVD_SpinUpDriveAsync (dvdcmdblk *block, dvdcbcallback cb)
 
s32 DVD_Inquiry (dvdcmdblk *block, dvddrvinfo *info)
 
s32 DVD_InquiryAsync (dvdcmdblk *block, dvddrvinfo *info, dvdcbcallback cb)
 
s32 DVD_ReadPrio (dvdcmdblk *block, void *buf, u32 len, s64 offset, s32 prio)
 
s32 DVD_ReadAbsAsyncPrio (dvdcmdblk *block, void *buf, u32 len, s64 offset, dvdcbcallback cb, s32 prio)
 
s32 DVD_ReadAbsAsyncForBS (dvdcmdblk *block, void *buf, u32 len, s64 offset, dvdcbcallback cb)
 
s32 DVD_SeekPrio (dvdcmdblk *block, s64 offset, s32 prio)
 
s32 DVD_SeekAbsAsyncPrio (dvdcmdblk *block, s64 offset, dvdcbcallback cb, s32 prio)
 
s32 DVD_CancelAllAsync (dvdcbcallback cb)
 
s32 DVD_StopStreamAtEndAsync (dvdcmdblk *block, dvdcbcallback cb)
 
s32 DVD_StopStreamAtEnd (dvdcmdblk *block)
 
s32 DVD_ReadDiskID (dvdcmdblk *block, dvddiskid *id, dvdcbcallback cb)
 
u32 DVD_SetAutoInvalidation (u32 auto_inv)
 
dvddiskidDVD_GetCurrentDiskID ()
 
dvddrvinfoDVD_GetDriveInfo ()
 

Variables

const DISC_INTERFACE __io_gcdvd
 

Detailed Description

DVD subsystem.

Macro Definition Documentation

◆ DEVICE_TYPE_GAMECUBE_DVD

#define DEVICE_TYPE_GAMECUBE_DVD   (('G'<<24)|('D'<<16)|('V'<<8)|'D')

◆ DVD_GetUserData

#define DVD_GetUserData (   block)    ((block)->usrdata)

◆ DVD_SetUserData

#define DVD_SetUserData (   block,
  data 
)    ((block)->usrdata = (data))

Typedef Documentation

◆ dvdcallback

void(* dvdcallback)(s32 result, dvdfileinfo *info)

function pointer typedef for the user's DVD operation callback

Parameters
[in]resulterror code of last operation
[in]infopointer to user's file info strucutre

◆ dvdcbcallback

void(* dvdcbcallback)(s32 result, dvdcmdblk *block)

function pointer typedef for the user's operations callback

◆ dvdcmdblk

forward typedef for struct _dvdcmdblk

   This structure is used internally to control the requested operation.

◆ dvddiskid

forward typedef for struct _dvddiskid

   This structure holds the game vendors copyright informations.<br>
   Additionally it holds certain parameters for audiocontrol and<br>
   multidisc support.
Parameters
gamename[4]vendors game key
company[2]vendors company key
disknumnumber of disc when multidisc support is used.
gameverversion of game
streamingflag to control audio streaming
streambufsizesize of buffer used for audio streaming
pad[22]padding

◆ dvddrvinfo

forward typedef for struct _dvddrvinfo

   This structure structure holds the drive version infromation.<br>
  Use DVD_Inquiry() to retrieve this information.
Parameters
rev_leverevision level
dev_codedevice code
rel_daterelease date
pad[24]padding

◆ dvdfileinfo

forward typedef for struct _dvdfileinfo

   This structure is used internally to control the requested file operation.

Function Documentation

◆ DVD_CancelAllAsync()

s32 DVD_CancelAllAsync ( dvdcbcallback  cb)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_ControlDrive()

s32 DVD_ControlDrive ( dvdcmdblk block,
u32  cmd 
)

Controls the drive's motor and behavior.

   This is a synchronous version of DVD_ControlDriveAsync().
Parameters
[in]blockpointer to a dvdcmdblk structure used to process the operation
[in]cmdcommand to control the drive.
Returns
none
Here is the call graph for this function:

◆ DVD_ControlDriveAsync()

s32 DVD_ControlDriveAsync ( dvdcmdblk block,
u32  cmd,
dvdcbcallback  cb 
)

Controls the drive's motor and behavior.

Parameters
[in]blockpointer to a dvdcmdblk structure used to process the operation
[in]cmdcommand to control the drive.
[in]cbcallback to be invoked upon completion of operation.
Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_GetCmdBlockStatus()

s32 DVD_GetCmdBlockStatus ( dvdcmdblk block)
Here is the caller graph for this function:

◆ DVD_GetCurrentDiskID()

dvddiskid* DVD_GetCurrentDiskID ( )

◆ DVD_GetDriveInfo()

dvddrvinfo* DVD_GetDriveInfo ( )

◆ DVD_GetDriveStatus()

s32 DVD_GetDriveStatus ( )
Here is the call graph for this function:

◆ DVD_Init()

void DVD_Init ( )

Initializes the DVD subsystem.

   You must call this function before calling any other DVD function
Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_Inquiry()

s32 DVD_Inquiry ( dvdcmdblk block,
dvddrvinfo info 
)
Here is the call graph for this function:

◆ DVD_InquiryAsync()

s32 DVD_InquiryAsync ( dvdcmdblk block,
dvddrvinfo info,
dvdcbcallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_Mount()

s32 DVD_Mount ( )

Mounts the DVD drive.

   This is a synchronous version of DVD_MountAsync().
Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_MountAsync()

s32 DVD_MountAsync ( dvdcmdblk block,
dvdcbcallback  cb 
)

Mounts the DVD drive.

   You <b>must</b> call this function in order to access the DVD.

   Following tasks are performed:
 - Issue a hard reset to the drive.
 - Turn on drive's debug mode.
 - Patch drive's FW.
 - Enable extensions.
 - Read disc ID

   The patch code and procedure was taken from the gc-linux DVD device driver.
Parameters
[in]blockpointer to a dvdcmdblk structure used to process the operation
[in]cbcallback to be invoked upon completion of operation
Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_Pause()

void DVD_Pause ( )
Here is the caller graph for this function:

◆ DVD_ReadAbsAsyncForBS()

s32 DVD_ReadAbsAsyncForBS ( dvdcmdblk block,
void buf,
u32  len,
s64  offset,
dvdcbcallback  cb 
)
Here is the call graph for this function:

◆ DVD_ReadAbsAsyncPrio()

s32 DVD_ReadAbsAsyncPrio ( dvdcmdblk block,
void buf,
u32  len,
s64  offset,
dvdcbcallback  cb,
s32  prio 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_ReadDiskID()

s32 DVD_ReadDiskID ( dvdcmdblk block,
dvddiskid id,
dvdcbcallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_ReadPrio()

s32 DVD_ReadPrio ( dvdcmdblk block,
void buf,
u32  len,
s64  offset,
s32  prio 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_Reset()

void DVD_Reset ( u32  reset_mode)

Performs a reset of the drive and FW respectively.

Parameters
[in]reset_modetype of reset
Returns
none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_SeekAbsAsyncPrio()

s32 DVD_SeekAbsAsyncPrio ( dvdcmdblk block,
s64  offset,
dvdcbcallback  cb,
s32  prio 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_SeekPrio()

s32 DVD_SeekPrio ( dvdcmdblk block,
s64  offset,
s32  prio 
)
Here is the call graph for this function:

◆ DVD_SetAutoInvalidation()

u32 DVD_SetAutoInvalidation ( u32  auto_inv)

◆ DVD_SetGCMOffset()

s32 DVD_SetGCMOffset ( dvdcmdblk block,
s64  offset 
)
Here is the call graph for this function:

◆ DVD_SetGCMOffsetAsync()

s32 DVD_SetGCMOffsetAsync ( dvdcmdblk block,
s64  offset,
dvdcbcallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_SpinUpDrive()

s32 DVD_SpinUpDrive ( dvdcmdblk block)
Here is the call graph for this function:

◆ DVD_SpinUpDriveAsync()

s32 DVD_SpinUpDriveAsync ( dvdcmdblk block,
dvdcbcallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DVD_StopStreamAtEnd()

s32 DVD_StopStreamAtEnd ( dvdcmdblk block)
Here is the call graph for this function:

◆ DVD_StopStreamAtEndAsync()

s32 DVD_StopStreamAtEndAsync ( dvdcmdblk block,
dvdcbcallback  cb 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __io_gcdvd

const DISC_INTERFACE __io_gcdvd