1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>DVDReadPrio</title>
10</head>
11
12<body>
13
14<h1>DVDReadPrio<BR>DVDReadAsyncPrio</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">#include &lt;revolution/dvd.h&gt;
18
19typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
20
21s32  DVDReadPrio         ( DVDFileInfo* fileInfo, void* addr, s32 length,
22                           s32 offset, s32 prio );
23
24BOOL DVDReadAsyncPrio    ( DVDFileInfo* fileInfo, void* addr, s32 length,
25                           s32 offset,
26                           DVDCallback callback, s32 prio );
27</pre></dd></dl>
28
29<h2>Arguments</h2>
30<TABLE class="arguments" border="1" >
31  <tr>
32<TH>fileInfo</TH>
33<TD>Information about the file associated by calling the <A href="DVDOpen.html"><CODE>DVDOpen</CODE></A> function beforehand.</TD>
34    </tr>
35  <tr>
36<TH>addr</TH>
37<TD>Buffer address. Should be 32-byte aligned.</TD>
38    </tr>
39  <tr>
40<TH>length</TH>
41<TD>Number of bytes to read. Must be a multiple of 32.</TD>
42    </tr>
43  <tr>
44<TH>offset</TH>
45<TD>File position from which to start read. Must be a multiple of 4.</TD>
46    </tr>
47  <tr>
48<TH>callback</TH>
49<TD>Address of a callback function to notify about the read result (only for the <CODE>DVDReadAsyncPrio</CODE> function).</TD>
50    </tr>
51  <tr>
52<TH>prio</TH>
53<TD>Queue priority for entering a read request.</TD>
54    </tr>
55</TABLE>
56
57<h2>Return Values</h2>
58<P>The <CODE>DVDReadPrio</CODE> function returns the number of bytes read if the command completes successfully. Otherwise, returns a negative value.</P>
59<P>The <CODE>DVDReadAsyncPrio</CODE> function always returns <CODE>TRUE</CODE>.</P>
60
61<H2>Description</H2>
62<P>The <A href="DVDReadAsync.html"><CODE>DVDReadAsync</CODE></A> and <CODE>DVDReadAsyncPrio</CODE> functions are essentially the same, but the <CODE>DVDReadAsyncPrio</CODE> function can specify the queue to use for entering read requests.</P>
63<P>Internally, the optical disc device driver manages four queues: 0 to 3. Queue 0 has the highest priority and queue 3 the lowest. Each queue is FIFO (First In First Out). The lead command of the queue with the highest priority is processed first.</P>
64<P>Normal DVD commands use queue 2.</P>
65<P>The <CODE>DVDReadAsyncPrio</CODE> function lets you change the priority for read commands. In other words, you can specify the queue to use for a read request.</P>
66<P>For details, see the <A href="DVDReadAsync.html"><CODE>DVDReadAsync</CODE></A> function in the function reference manual.</P>
67<P>The <CODE>DVDReadPrio</CODE> function is the synchronous version of <CODE>DVDReadAsyncPrio</CODE>. For details, see the <A href="DVDRead.html"><CODE>DVDRead</CODE></A> function in the function reference manual.</P>
68<P><strong><B>Note:</B></strong>Be careful if you are considering the use of a synchronous function in a real game. Synchronous functions&nbsp;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.</P>
69
70<p>This function may put the current thread to sleep. Refer to <a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>.</p>
71
72<h2>See Also</h2>
73<p class="reference">
74<a href="DVDRead.html">DVDRead</a>,
75<a href="DVDReadAsync.html">DVDReadAsync</a>,
76<a href="DVDOpen.html">DVDOpen</a>,
77<a href="../os/Interrupt/intro.html">Interrupts and Callback Functions</a>
78</p>
79
80<H2>Revision History</H2>
81<P>
822007/09/25 Added an explanation of thread behavior. <BR>2007/06/28 Revised the description of the return values.<BR>2006/03/01 Initial version.<BR>
83</P>
84
85<hr><p>CONFIDENTIAL</p></body>
86</html>