SSBM Decomp
Loading...
Searching...
No Matches
dvd.h
Go to the documentation of this file.
1#ifndef __DOLPHIN_DVD_H_
2#define __DOLPHIN_DVD_H_
3
4#include <platform.h>
5
7
9
17
27
38
42 /*0x08*/ u32 command;
43 /*0x0C*/ s32 state;
44 /*0x10*/ u32 offset;
45 /*0x14*/ u32 length;
46 /*0x18*/ void* addr;
49 /*0x24*/ DVDDiskID* id;
51 /*0x2C*/ void* userData;
52};
53
54typedef struct DVDFileInfo DVDFileInfo;
55typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
58 /*0x30*/ u32 startAddr;
59 /*0x34*/ u32 length;
61};
62
69
70// Minimum transfer size.
71#define DVD_MIN_TRANSFER_SIZE 32
72
73// DVD states.
74#define DVD_STATE_FATAL_ERROR -1
75#define DVD_STATE_END 0
76#define DVD_STATE_BUSY 1
77#define DVD_STATE_WAITING 2
78#define DVD_STATE_COVER_CLOSED 3
79#define DVD_STATE_NO_DISK 4
80#define DVD_STATE_COVER_OPEN 5
81#define DVD_STATE_WRONG_DISK 6
82#define DVD_STATE_MOTOR_STOPPED 7
83#define DVD_STATE_PAUSING 8
84#define DVD_STATE_IGNORED 9
85#define DVD_STATE_CANCELED 10
86#define DVD_STATE_RETRY 11
87
88// File info states.
89#define DVD_FILEINFO_READY 0
90#define DVD_FILEINFO_BUSY 1
91
92// DVD results.
93#define DVD_RESULT_GOOD 0
94#define DVD_RESULT_FATAL_ERROR -1
95#define DVD_RESULT_IGNORED -2
96#define DVD_RESULT_CANCELED -3
97
98#define DVD_AIS_SUCCESS 0
99
101
102typedef void (*DVDLowCallback)(u32 intType);
104
105void DVDInit(void);
106bool DVDOpen(char*, DVDFileInfo*);
107bool DVDClose(DVDFileInfo*);
108bool DVDChangeDir(char*);
109bool DVDFastOpen(s32 entrynum, DVDFileInfo* fileInfo);
110bool DVDReadAsyncPrio(DVDFileInfo* fileInfo, void* addr, s32 length,
111 s32 offset, DVDCallback callback, s32 prio);
112s32 DVDConvertPathToEntrynum(const char* pathPtr);
113void DVDReset(void);
116void __CARDSetDiskID(const DVDDiskID* id);
117
118bool DVDReadAbsAsyncForBS(DVDCommandBlock* block, void* addr, s32 length,
119 s32 offset, DVDCBCallback callback);
120
121bool DVDReadDiskID(DVDCommandBlock* block, DVDDiskID* diskID,
123bool DVDCheckDisk(void);
125bool DVDSetAutoInvalidation(bool autoInval);
126
127#define DVDReadAsync(fileInfo, addr, length, offset, callback) \
128 DVDReadAsyncPrio((fileInfo), (addr), (length), (offset), (callback), 2)
129
132int DVDCancelAll(void);
138bool DVDInquiryAsync(DVDCommandBlock* block, void* addr,
140bool DVDReadAbsAsyncPrio(DVDCommandBlock* block, void* addr, s32 length,
141 s32 offset, DVDCBCallback callback, s32 prio);
142bool DVDSeekAbsAsyncPrio(DVDCommandBlock* block, u32 offset,
144bool DVDPrepareStreamAbsAsync(DVDCommandBlock* block, u32 length, u32 offset,
146
147#endif
void(* DVDCBCallback)(s32 result, DVDCommandBlock *block)
Definition forward.h:8
u32 error
Definition dvd.c:3
void(* DVDCallback)(s32 result, DVDFileInfo *fileInfo)
Definition dvd.h:55
OSThreadQueue __DVDThreadQueue
Definition dvdfs.c:17
bool DVDSetAutoInvalidation(bool autoInval)
Definition dvd.c:1074
void __CARDSetDiskID(const DVDDiskID *id)
Definition CARDBios.c:484
bool DVDCancelStreamAsync(DVDCommandBlock *block, DVDCBCallback callback)
Definition dvd.c:957
bool DVDStopStreamAtEndAsync(DVDCommandBlock *block, DVDCBCallback callback)
Definition dvd.c:997
bool DVDReadAsyncPrio(DVDFileInfo *fileInfo, void *addr, s32 length, s32 offset, DVDCallback callback, s32 prio)
Definition dvdfs.c:185
void DVDReset(void)
Definition dvd.c:1021
s32 DVDGetCommandBlockStatus(const DVDCommandBlock *block)
Definition dvd.c:1030
u32 CategorizeError(u32 error)
Definition dvd.c:198
s32 DVDGetDriveStatus(void)
Definition dvd.c:1048
bool DVDSeekAbsAsyncPrio(DVDCommandBlock *block, u32 offset, DVDCBCallback callback, s32 prio)
Definition dvd.c:901
bool DVDFastOpen(s32 entrynum, DVDFileInfo *fileInfo)
Definition dvdfs.c:163
bool DVDReadAbsAsyncForBS(DVDCommandBlock *block, void *addr, s32 length, s32 offset, DVDCBCallback callback)
Definition dvd.c:913
bool DVDReadAbsAsyncPrio(DVDCommandBlock *block, void *addr, s32 length, s32 offset, DVDCBCallback callback, s32 prio)
Definition dvd.c:886
DVDDiskID * DVDGetCurrentDiskID(void)
Definition dvd.c:1306
s32 DVDCancel(DVDCommandBlock *block)
Definition dvd.c:1206
bool DVDReadDiskID(DVDCommandBlock *block, DVDDiskID *diskID, DVDCBCallback callback)
Definition dvd.c:928
bool DVDCheckDisk(void)
Definition dvd.c:1311
s32 DVDConvertPathToEntrynum(const char *pathPtr)
Definition dvdfs.c:56
bool DVDChangeDir(char *)
void(* DVDLowCallback)(u32 intType)
Definition dvd.h:102
bool DVDPrepareStreamAbsAsync(DVDCommandBlock *block, u32 length, u32 offset, DVDCBCallback callback)
Definition dvd.c:944
void __DVDPrepareResetAsync(DVDCBCallback callback)
Definition dvd.c:1367
DVDLowCallback DVDLowClearCallback(void)
Definition dvdlow.c:444
void DVDInit(void)
Definition dvd.c:93
bool DVDCancelAsync(DVDCommandBlock *block, DVDCBCallback callback)
Definition dvd.c:1102
bool DVDOpen(char *, DVDFileInfo *)
int DVDCancelStream(DVDCommandBlock *block)
Definition dvd.c:966
int DVDCancelAll(void)
Definition dvd.c:1273
bool DVDClose(DVDFileInfo *)
Definition dvdfs.c:179
bool DVDInquiryAsync(DVDCommandBlock *block, void *addr, DVDCBCallback callback)
Definition dvd.c:1007
static void callback(HSD_GObj *gobj)
Definition ftDk_SpecialLw.c:88
unsigned long u32
An unsigned 32-bit integer.
Definition platform.h:26
unsigned short u16
An unsigned 16-bit integer.
Definition platform.h:23
signed long s32
A signed 32-bit integer.
Definition platform.h:14
unsigned char u8
An unsigned 8-bit integer.
Definition platform.h:20
Definition dvd.h:28
u32 FSTPosition
Definition dvd.h:30
u32 FSTMaxLength
Definition dvd.h:32
void * bootFilePosition
Definition dvd.h:29
u32 userPosition
Definition dvd.h:34
void * FSTAddress
Definition dvd.h:33
u32 padding0
Definition dvd.h:36
u32 userLength
Definition dvd.h:35
u32 FSTLength
Definition dvd.h:31
Definition dvd.h:39
u32 transferredSize
Definition dvd.h:48
void * addr
Definition dvd.h:46
u32 currTransferSize
Definition dvd.h:47
DVDCommandBlock * prev
Definition dvd.h:41
void * userData
Definition dvd.h:51
u32 offset
Definition dvd.h:44
DVDDiskID * id
Definition dvd.h:49
u32 command
Definition dvd.h:42
DVDCBCallback callback
Definition dvd.h:50
s32 state
Definition dvd.h:43
DVDCommandBlock * next
Definition dvd.h:40
u32 length
Definition dvd.h:45
Definition dvd.h:18
u8 streaming
Definition dvd.h:23
char company[2]
Definition dvd.h:20
char gameName[4]
Definition dvd.h:19
u8 gameVersion
Definition dvd.h:22
u8 diskNumber
Definition dvd.h:21
u8 streamingBufSize
Definition dvd.h:24
u8 padding[22]
Definition dvd.h:25
Definition dvd.h:63
u16 deviceCode
Definition dvd.h:65
u32 releaseDate
Definition dvd.h:66
u8 padding[24]
Definition dvd.h:67
u16 revisionLevel
Definition dvd.h:64
Definition dvd.h:56
u32 length
Definition dvd.h:59
DVDCallback callback
Definition dvd.h:60
DVDCommandBlock cb
Definition dvd.h:57
u32 startAddr
Definition dvd.h:58
Definition OSThread.h:42
Definition dvd.h:10
u32 _00
Definition dvd.h:11
void * FSTLocationInRam
Definition dvd.h:15
u32 FSTMaxLength
Definition dvd.h:14
s32 _08
Definition dvd.h:13
u32 _04
Definition dvd.h:12