#include <revolution/dvd.h>
typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
s32 DVDReadPrio ( DVDFileInfo* fileInfo, void* addr, s32 length,
s32 offset, s32 prio );
BOOL DVDReadAsyncPrio ( DVDFileInfo* fileInfo, void* addr, s32 length,
s32 offset,
DVDCallback callback, s32 prio );
fileInfo |
File information retrieved by calling the DVDOpen function. |
addr |
Buffer address. Should be 32-byte aligned. |
length |
Number of bytes to read. Must be a multiple of 32. |
offset |
File position from which to start read. Must be a multiple of 4. |
callback |
Address of callback function to notify about the read result (only for the DVDReadAsyncPrio function). |
prio |
Queue priority for entering a read request. |
The DVDReadPrio function returns the number of bytes read if the command completes successfully. Otherwise, returns a negative value.
The DVDReadAsyncPrio function always returns TRUE.
The DVDReadAsync and DVDReadAsyncPrio functions are essentially the same, but the DVDReadAsyncPrio function can specify the queue to use for entering read requests.
Internally the DVD device driver manages four queues: 0 to 3. Queue 0 has the highest priority and queue 3 has the lowest priority. Each queue is FIFO (First In First Out). The lead command of the queue with the highest priority is processed first.
Normal DVD commands use queue 2.
The DVDSeekAsyncPrio function lets you change the priority for read commands. In other words, you can specify the queue to use for a read request.
For details, see the DVDReadAsync function in Function Reference.
The DVDReadPrio function is the synchronous version of the DVDReadAsyncPrio function. For details, see the DVDRead function in the Function Reference.
Note: Be careful if you are considering the use of a synchronous function in a real game. Synchronous functions can only be used in a multithreaded game. In single thread games, synchronous functions can't be used because there is no way to check errors.
The DVDReadPrio function may put the current thread to sleep. Refer to Interrupts and Callback Functions.
DVDRead
DVDReadAsync
DVDOpen
Interrupts and Callback Functions
2007/09/25 Added explanation on thread behavior.
2007/06/28 Revised return value descriptions.
2006/03/01 Initial version.
CONFIDENTIAL