RetroArch
dvd.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 dvd.h -- DVD subsystem
4 
5 Copyright (C) 2004
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
8 
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
12 
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
16 
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
21 
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source
26 distribution.
27 
28 -------------------------------------------------------------*/
29 
30 
31 #ifndef __DVD_H__
32 #define __DVD_H__
33 
40 #include <gctypes.h>
41 #include <ogc/lwp_queue.h>
42 #include <ogc/disc_io.h>
43 
49 #define DVD_STATE_FATAL_ERROR -1
50 #define DVD_STATE_END 0
51 #define DVD_STATE_BUSY 1
52 #define DVD_STATE_WAITING 2
53 #define DVD_STATE_COVER_CLOSED 3
54 #define DVD_STATE_NO_DISK 4
55 #define DVD_STATE_COVER_OPEN 5
56 #define DVD_STATE_WRONG_DISK 6
57 #define DVD_STATE_MOTOR_STOPPED 7
58 #define DVD_STATE_IGNORED 8
59 #define DVD_STATE_CANCELED 10
60 #define DVD_STATE_RETRY 11
61 
62 #define DVD_ERROR_OK 0
63 #define DVD_ERROR_FATAL -1
64 #define DVD_ERROR_IGNORED -2
65 #define DVD_ERROR_CANCELED -3
66 #define DVD_ERROR_COVER_CLOSED -4
67 
78 #define DVD_RESETHARD 0
79 #define DVD_RESETSOFT 1
80 #define DVD_RESETNONE 2
92 #define DVD_SPINMOTOR_DOWN 0x00000000
93 #define DVD_SPINMOTOR_UP 0x00000100
94 #define DVD_SPINMOTOR_ACCEPT 0x00004000
95 #define DVD_SPINMOTOR_CHECKDISK 0x00008000
102 #ifdef __cplusplus
103  extern "C" {
104 #endif /* __cplusplus */
105 
106 
111 typedef struct _dvddiskid dvddiskid;
112 
128 struct _dvddiskid {
135  u8 pad[22];
136 };
137 
142 typedef struct _dvdcmdblk dvdcmdblk;
143 
144 
150 
151 
157 struct _dvdcmdblk {
163  void *buf;
168  void *usrdata;
169 };
170 
171 
176 typedef struct _dvddrvinfo dvddrvinfo;
177 
178 
190 struct _dvddrvinfo {
194  u8 pad[24];
195 };
196 
197 
202 typedef struct _dvdfileinfo dvdfileinfo;
203 
204 
213 
214 
220 struct _dvdfileinfo {
225 };
226 
227 
236 void DVD_Init();
237 void DVD_Pause();
238 
239 
248 void DVD_Reset(u32 reset_mode);
249 
250 
259 s32 DVD_Mount();
261 
262 
284 
285 
298 
299 
311 
312 
325 
326 
340 
358 
359 #define DVD_SetUserData(block, data) ((block)->usrdata = (data))
360 #define DVD_GetUserData(block) ((block)->usrdata)
361 
362 #define DEVICE_TYPE_GAMECUBE_DVD (('G'<<24)|('D'<<16)|('V'<<8)|'D')
363 extern const DISC_INTERFACE __io_gcdvd;
364 
365 #ifdef __cplusplus
366  }
367 #endif /* __cplusplus */
368 
369 #endif
s32 DVD_CancelAllAsync(dvdcbcallback cb)
Definition: dvd.c:2123
u8 pad[24]
Definition: dvd.h:194
int32_t s32
32bit signed integer
Definition: gctypes.h:24
u32 txdsize
Definition: dvd.h:165
s32 DVD_SetGCMOffsetAsync(dvdcmdblk *block, s64 offset, dvdcbcallback cb)
Definition: dvd.c:2212
Definition: dvd.h:157
Data type definitions.
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
Definition: libretro.h:2275
u16 rev_level
Definition: dvd.h:191
GLenum GLsizei len
Definition: glext.h:7389
s32 DVD_ReadAbsAsyncForBS(dvdcmdblk *block, void *buf, u32 len, s64 offset, dvdcbcallback cb)
Definition: dvd.c:2028
s32 DVD_ReadPrio(dvdcmdblk *block, void *buf, u32 len, s64 offset, s32 prio)
Definition: dvd.c:2078
int8_t s8
8bit signed integer
Definition: gctypes.h:22
Definition: lwp_queue.h:16
u32 currtxsize
Definition: dvd.h:164
u32 DVD_SetAutoInvalidation(u32 auto_inv)
Definition: dvd.c:2364
s32 DVD_StopStreamAtEnd(dvdcmdblk *block)
Definition: dvd.c:2139
const struct retro_game_info * info
Definition: libretro.h:2121
const DISC_INTERFACE __io_gcdvd
Definition: dvd.c:2423
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
u32 len
Definition: dvd.h:162
void * usrdata
Definition: dvd.h:168
s32 DVD_StopStreamAtEndAsync(dvdcmdblk *block, dvdcbcallback cb)
Definition: dvd.c:2132
u8 disknum
Definition: dvd.h:131
s32 DVD_SpinUpDriveAsync(dvdcmdblk *block, dvdcbcallback cb)
Definition: dvd.c:2158
lwp_node node
Definition: dvd.h:158
s32 DVD_GetCmdBlockStatus(dvdcmdblk *block)
Definition: dvd.c:2238
Definition: dvd.h:128
dvddiskid * id
Definition: dvd.h:166
ubyte cmd
Definition: wiiuse_internal.h:319
s32 DVD_SeekAbsAsyncPrio(dvdcmdblk *block, s64 offset, dvdcbcallback cb, s32 prio)
Definition: dvd.c:2040
uint16_t u16
16bit unsigned integer
Definition: gctypes.h:18
s8 company[2]
Definition: dvd.h:130
s32 DVD_GetDriveStatus()
Definition: dvd.c:2251
s64 offset
Definition: dvd.h:161
s32 DVD_SeekPrio(dvdcmdblk *block, s64 offset, s32 prio)
Definition: dvd.c:2100
u8 gamever
Definition: dvd.h:132
dvdcallback cb
Definition: dvd.h:224
void(* dvdcallback)(s32 result, dvdfileinfo *info)
function pointer typedef for the user's DVD operation callback
Definition: dvd.h:212
s32 state
Definition: dvd.h:160
GLuint64EXT * result
Definition: glext.h:12211
u8 streambufsize
Definition: dvd.h:134
s32 DVD_MountAsync(dvdcmdblk *block, dvdcbcallback cb)
Mounts the DVD drive.
Definition: dvd.c:2308
u32 rel_date
Definition: dvd.h:193
s32 DVD_ReadDiskID(dvdcmdblk *block, dvddiskid *id, dvdcbcallback cb)
Definition: dvd.c:2002
dvdcmdblk block
Definition: dvd.h:221
s32 DVD_SpinUpDrive(dvdcmdblk *block)
Definition: dvd.c:2167
static int block
Definition: psp2.c:31
u16 dev_code
Definition: dvd.h:192
Definition: dvd.h:220
s32 DVD_Mount()
Mounts the DVD drive.
Definition: dvd.c:2316
void(* dvdcbcallback)(s32 result, dvdcmdblk *block)
function pointer typedef for the user's operations callback
Definition: dvd.h:149
Definition: iosuhax_disc_interface.h:52
dvddrvinfo * DVD_GetDriveInfo()
Definition: dvd.c:2344
void DVD_Reset(u32 reset_mode)
Performs a reset of the drive and FW respectively.
Definition: dvd.c:2279
s8 gamename[4]
Definition: dvd.h:129
u32 addr
Definition: dvd.h:222
s32 DVD_ControlDriveAsync(dvdcmdblk *block, u32 cmd, dvdcbcallback cb)
Controls the drive's motor and behavior.
Definition: dvd.c:2186
s32 DVD_InquiryAsync(dvdcmdblk *block, dvddrvinfo *info, dvdcbcallback cb)
Definition: dvd.c:2049
void DVD_Pause()
Definition: dvd.c:2269
void DVD_Init()
Initializes the DVD subsystem.
Definition: dvd.c:2349
u8 streaming
Definition: dvd.h:133
void * buf
Definition: dvd.h:163
s32 DVD_SetGCMOffset(dvdcmdblk *block, s64 offset)
Definition: dvd.c:2220
GLintptr offset
Definition: glext.h:6560
s32 DVD_ReadAbsAsyncPrio(dvdcmdblk *block, void *buf, u32 len, s64 offset, dvdcbcallback cb, s32 prio)
Definition: dvd.c:2016
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
u32 cmd
Definition: dvd.h:159
dvdcbcallback cb
Definition: dvd.h:167
int64_t s64
64bit signed integer
Definition: gctypes.h:25
u32 len
Definition: dvd.h:223
s32 DVD_Inquiry(dvdcmdblk *block, dvddrvinfo *info)
Definition: dvd.c:2059
dvddiskid * DVD_GetCurrentDiskID()
Definition: dvd.c:2339
s32 DVD_ControlDrive(dvdcmdblk *block, u32 cmd)
Controls the drive's motor and behavior.
Definition: dvd.c:2194
u8 pad[22]
Definition: dvd.h:135
Definition: dvd.h:190