#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. |
|
Number of bytes to read. Must be a multiple of 32. |
|
File position to start read from. 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 returns TRUE if the command is issued successfully and FALSE otherwise.
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, queue 0 - 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 the Function Reference.
The DVDReadPrio function is the synchronous version of the DVDReadAsyncPrio function. For details, see the DVDRead function in the Function Reference.
Note: Take care if you plan to use 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.
03/01/2006 Initial version.