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="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>DVDChangeDisk</title>
10</head>
11
12<body>
13
14<h1>DVDChangeDisk</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/dvd.h&gt;
19
20typedef void (*DVDCBCallback)(s32 result, <a href="DVDCommandBlock.html">DVDCommandBlock</a>* block);
21
22s32 DVDChangeDisk(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDDiskID* id);
23
24BOOL DVDChangeDiskAsync(<a href="DVDCommandBlock.html">DVDCommandBlock</a>* block, DVDDiskID* id,
25                        DVDCBCallback callback);
26</pre></dd></dl>
27
28<h2>Arguments</h2>
29<TABLE class="arguments" border="1" >
30  <tr>
31<TH>block</TH>
32<TD>Command block of this command.</TD>
33  </tr>
34  <tr>
35<TH>id</TH>
36<TD>Pointer to the disc ID.</TD>
37  </tr>
38  <tr>
39<TH>callback</TH>
40<TD>Callback function that indicates completion. (Only for <code>DVDChangeDiskAsync</code>.)</TD>
41  </tr>
42</TABLE>
43
44<h2>Return Values</h2>
45<P><code>DVDChangeDisk</code>: Returns 0 if the command completes normally; otherwise, returns a negative value.</P>
46<P><code>DVDChangeDiskAsync</code>: Returns <CODE>TRUE</CODE> if the command terminates normally; otherwise, returns <CODE>FALSE</CODE>.</P>
47
48<h2>Description</h2>
49<P><code>DVDChangeDiskAsync</code> waits for the game player to insert the game disc with a matching <SPAN class="argument">id</SPAN>.</P>
50<P>
51Wildcards can be specified in the disc number and/or game version of the disc ID being specified. If <CODE>0xff</CODE> is specified for the disc number and game version, a disc having any disc number and game version can be used as the correct disc as long as other elements match.
52</P>
53<P>After the read finishes, the <SPAN class="argument">callback</SPAN> function is called (unless <CODE>NULL</CODE> is specified for <SPAN class="argument">callback</SPAN>). When the game disc is successfully changed, zero is returned as the first argument <SPAN class="argument">result</SPAN> of the <SPAN class="argument">callback</SPAN> function. If a fatal error occurs, <code>DVD_RESULT_FATAL_ERROR</code> is returned. If the function is canceled, <code>DVD_RESULT_CANCELED</code> is returned. <CODE>DVD_RESULT_FATAL_ERROR</CODE> and <CODE>DVD_RESULT_CANCELED</CODE> are both negative values. The second argument of <SPAN class="argument">callback</SPAN> is the same <A href="DVDCommandBlock.html"><code>DVDCommandBlock</code></A> structure as that passed when <code>DVDCheckDiskAsync</code> is called.</P>
54<P>After the <code>DVDChangeDiskAsync</code> function is called, two methods are available for determining if the game disc change is completed.&nbsp;One method is to check that the <SPAN class="argument">callback</SPAN> function was called. The other is to poll with the <code><a href="DVDGetDriveStatus.html">DVDGetDriveStatus</a></code> function and wait until it returns <code>DVD_STATE_END</code>.</P>
55<P>The <code>DVDChangeDisk</code> function is a synchronous version of <code>DVDChangeDiskAsync</code>.</P>
56<P><B>Note:</B>Be careful if you are considering the use of synchronous functions in a real game program; use synchronous functions&nbsp;if the game program is&nbsp;multithreaded. In single threaded games, synchronous functions can't be used because there is no method for error checking.</P>
57
58<h2>See Also</h2>
59<P>
60<a href="DVDGenerateDiskID.html"><CODE>DVDGenerateDiskID</CODE></a>
61</p>
62
63<H2>Revision History</H2>
64<P>
652009/02/03 Added a description of wildcards.<br />2006/03/01 Initial version.
66</P>
67
68<hr><p>CONFIDENTIAL</p></body>
69</html>