1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 8<title>WPADStatus</title> 9</head> 10 11<body> 12 13<h1>WPADStatus</h1> 14 15 16<H2>C Specification</H2> 17<DL> 18 <DD> 19 <PRE><CODE>#include <revolution/wpad.h></CODE></PRE> 20 <DD> 21 <PRE><CODE> 22#define WPAD_DPD_MAX_OBJECTS 4 23 24#define WPAD_BUTTON_LEFT 0x0001 25#define WPAD_BUTTON_RIGHT 0x0002 26#define WPAD_BUTTON_DOWN 0x0004 27#define WPAD_BUTTON_UP 0x0008 28#define WPAD_BUTTON_PLUS 0x0010 29#define WPAD_BUTTON_2 0x0100 30#define WPAD_BUTTON_1 0x0200 31#define WPAD_BUTTON_B 0x0400 32#define WPAD_BUTTON_A 0x0800 33#define WPAD_BUTTON_MINUS 0x1000 34#define WPAD_BUTTON_HOME 0x8000 35 36// for FreeStyle 37#define WPAD_BUTTON_Z 0x2000 38#define WPAD_BUTTON_C 0x4000 39 40// for ClassicStyle 41#define WPAD_CL_BUTTON_UP 0x0001 42#define WPAD_CL_BUTTON_LEFT 0x0002 43#define WPAD_CL_TRIGGER_ZR 0x0004 44#define WPAD_CL_BUTTON_X 0x0008 45#define WPAD_CL_BUTTON_A 0x0010 46#define WPAD_CL_BUTTON_Y 0x0020 47#define WPAD_CL_BUTTON_B 0x0040 48#define WPAD_CL_TRIGGER_ZL 0x0080 49#define WPAD_CL_RESERVED 0x0100 50#define WPAD_CL_TRIGGER_R 0x0200 51#define WPAD_CL_BUTTON_PLUS 0x0400 52#define WPAD_CL_BUTTON_HOME 0x0800 53#define WPAD_CL_BUTTON_MINUS 0x1000 54#define WPAD_CL_TRIGGER_L 0x2000 55#define WPAD_CL_BUTTON_DOWN 0x4000 56#define WPAD_CL_BUTTON_RIGHT 0x8000 57 58// for compatibility 59#define WPAD_BUTTON_SELECT WPAD_BUTTON_MINUS 60#define WPAD_BUTTON_START WPAD_BUTTON_PLUS 61#define WPAD_BUTTON_SMALL_B WPAD_BUTTON_2 62#define WPAD_BUTTON_SMALL_A WPAD_BUTTON_1 63#define WPAD_BUTTON_Z1 WPAD_BUTTON_Z 64#define WPAD_BUTTON_Z2 WPAD_BUTTON_C 65 66 67typedef struct WPADStatus 68{ 69 u16 button; 70 s16 accX; 71 s16 accY; 72 s16 accZ; 73 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; 74 u8 dev; 75 s8 err; 76} WPADStatus; 77 78typedef struct DPDObject 79{ 80 s16 x; 81 s16 y; 82 u16 size; 83 u8 traceId; 84} DPDObject; 85</CODE></PRE> 86</DL> 87<H2>Elements</H2> 88<TABLE border="1" cellpadding="3" cellspacing="0.1"> 89 <TBODY> 90 <tr> 91 <TD><code><b><i>button</i></b></code></TD> 92 <TD>When a button is pressed, the corresponding bit (<code>WPAD_BUTTON_*</code>) is set to 1.</TD> 93 </tr> 94 <tr> 95 <TD><code><b><i>accX</i></b></code></TD> 96 <TD>Output of the motion sensor's x-component. The resolution is 1024. A value of 0 corresponds to 0G (outputs in the range of -512 <= <code><b><i>accX</i></b></code> < 512).</TD> 97 </tr> 98 <tr> 99 <TD><code><b><i>accY</i></b></code></TD> 100 <TD>Output of the motion sensor's y-component. The resolution is the same as for <code><b><i>accX</i></b></code>.</TD> 101 </tr> 102 <tr> 103 <TD><code><b><i>accZ</i></b></code></TD> 104 <TD>Output of the motion sensor's z-component. The resolution is the same as for <code><b><i>accX</i></b></code>.</TD> 105 </tr> 106 <tr> 107 <TD><code><b><i>obj[].x</i></b></code></TD> 108 <TD>The x-coordinate of the center of mass for the object obtained with the pointer. The resolution is 1024.</TD> 109 </tr> 110 <tr> 111 <TD><code><b><i>obj[].y</i></b></code></TD> 112 <TD>The y-coordinate of the center of mass for the object obtained with the pointer. The resolution is 768.</TD> 113 </tr> 114 <tr> 115 <TD><code><b><i>obj[].size</i></b></code></TD> 116 <TD>The size of the object obtained with the pointer. The resolution is 128*96.</TD> 117 </tr> 118 <tr> 119 <TD><code><b><i>obj[].traceId</i></b></code></TD> 120 <TD>The trace ID of the object obtained with the pointer.</TD> 121 </tr> 122 <tr> 123 <TD><code><b><i>dev</i></b></code></TD> 124 <TD>The controller type.</TD> 125 </tr> 126 <TR> 127 <TD width="120" valign="top"><CODE><b><i>err</i></b></CODE></TD> 128 <TD width="520">The controller error status. 129 </TD> 130 </TR> 131 </TBODY> 132</TABLE> 133 134 135 136<h2>Description</h2> 137<p> 138The WPADStatus structure represents the status of the Wii Remote. 139<ul> 140<li>Number of Controllers</li> 141</ul> 142<blockquote> 143The maximum number of Wii Remotes that can connect is defined as the macro constant below. 144<table border="1"> 145<TR> 146<TD width="150"><CODE>WPAD_MAX_CONTROLLERS</CODE></TD> 147<TD>The maximum number of Wii Remotes that can connect.</TD> 148</TR> 149</table> 150</blockquote> 151 152<ul> 153<li>Button Input</li> 154</ul> 155<blockquote> 156Button inputs are defined with the following macro constants. The Wii Remote is equipped with +Control Pad, A, B, 1, 2, -, +, and HOME digital buttons. 157<table border="1"> 158<TR> 159<TD width="150"><CODE>WPAD_BUTTON_UP</CODE></TD> 160<TD>+Control Pad UP is being pressed.</TD> 161</TR> 162<TR> 163<TD width="150"><CODE>WPAD_BUTTON_DOWN</CODE></TD> 164<TD>+Control Pad DOWN is being pressed.</TD> 165</TR> 166<TR> 167<TD width="150"><CODE>WPAD_BUTTON_LEFT</CODE></TD> 168<TD>+Control Pad LEFT is being pressed.</TD> 169</TR> 170<TR> 171<TD width="150"><CODE>WPAD_BUTTON_RIGHT</CODE></TD> 172<TD>+Control Pad RIGHT is being pressed.</TD> 173</TR> 174<TR> 175<TD width="150"><CODE>WPAD_BUTTON_A</CODE></TD> 176<TD>The A Button is being pressed.</TD> 177</TR> 178<TR> 179<TD width="150"><CODE>WPAD_BUTTON_B</CODE></TD> 180<TD>The B Button is being pressed.</TD> 181</TR> 182<TR> 183<TD width="150"><CODE>WPAD_BUTTON_1</CODE></TD> 184<TD>The 1 Button is being pressed.</TD> 185</TR> 186<TR> 187<TD width="150"><CODE>WPAD_BUTTON_2</CODE></TD> 188<TD>The 2 Button is being pressed.</TD> 189</TR> 190<TR> 191<TD width="150"><CODE>WPAD_BUTTON_MINUS</CODE></TD> 192<TD>The - Button is being pressed.</TD> 193</TR> 194<TR> 195<TD width="150"><CODE>WPAD_BUTTON_PLUS</CODE></TD> 196<TD>The + Button is being pressed.</TD> 197</TR> 198<TR> 199<TD width="150"><CODE>WPAD_BUTTON_HOME</CODE></TD> 200<TD>HOME is being pressed.</TD> 201</TR> 202</table> 203</blockquote> 204 205<ul> 206<li>Pointer</li> 207</ul> 208<blockquote> 209The pointer specifications are defined by the following macro constants. 210 211<table border="1"> 212<TR> 213<TD width="150"><CODE>WPAD_DPD_MAX_OBJECTS</CODE></TD> 214<TD>The maximum number of objects that the pointer can detect simultaneously.</TD> 215</TR> 216<TR> 217<TD width="150"><CODE>WPAD_DPD_ANGLE</CODE></TD> 218<TD>The pointer view angle (in degrees).</TD> 219</TR> 220<TR> 221<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WX</CODE></TD> 222<TD>Pointer resolution along the x-axis.</TD> 223</TR> 224<TR> 225<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WY</CODE></TD> 226<TD>Pointer resolution along the y-axis.</TD> 227</TR> 228</table> 229 230<p> 231Object data items are stored in the <CODE>obj</CODE> array in the order in which they are detected by the pointer. The pointer scans the image captured by the sensor internally from top left to bottom right and outputs object data in the order detected. At the same time, trace IDs are assigned in the order in which the objects are detected. 232</p> 233<p> 234The trace IDs help to judge whether previously obtained data is the same as the currently obtained data. Consider a case where objects A (trace ID=0) and B (trace ID=1) are detected as A and B, respectively, by the previous scan, and then they are detected as B and A, respectively, after the pointer is moved. The output order for the current scan is the reverse of the previous one. However, the trace IDs are in the order of B (using the previously assigned trace ID of 1) and A (using the previously assigned trace ID of 0), and the fact that the data is the same is preserved. 235</p> 236</blockquote> 237 238<ul> 239<li>Motion Sensor</li> 240</ul> 241<blockquote> 242The motion sensor specifications are defined by the macro constant below. 243 244<table border="1"> 245 246<TR> 247<TD width="150"><CODE>WPAD_ACC_RESO</CODE></TD> 248<TD>The motion sensor's resolution.</TD> 249</TR> 250 251</table> 252</blockquote> 253 254<ul> 255<li>Controller Type</li> 256</ul> 257<blockquote> 258Controller types are defined with the following macro constants. 259 <TABLE border="1" width="500" cellspacing="0.1"> 260 <TBODY> 261 <TR> 262 <TD width="150"><CODE>WPAD_DEV_NOT_FOUND</CODE></TD> 263 <TD width="350">Nothing is connected to the specified channel.</TD> 264 </TR> 265 <TR> 266 <TD width="150"><CODE>WPAD_DEV_CORE</CODE></TD> 267 <TD width="350">Wii Remote.</TD> 268 </TR> 269 <TR> 270 <TD width="150"><CODE>WPAD_DEV_FREESTYLE</CODE></TD> 271 <TD width="350">Nunchuk Style.</TD> 272 </TR> 273 <TR> 274 <TD width="150"><CODE>WPAD_DEV_CLASSIC</CODE></TD> 275 <TD width="350">Classic Style.<BR> 276 </TR> 277 <TR> 278 <TD width="150"><CODE>WPAD_DEV_FUTURE</CODE></TD> 279 <TD width="350">A device that will be supported in the future. The device is legitimate, but this External Extension Controller cannot be used with this title. It may be operated as a Wii Remote.<BR> 280 </TR> 281 <TR> 282 <TD width="150"><CODE>WPAD_DEV_NOT_SUPPORTED</CODE></TD> 283 <TD width="350">A device that cannot be used. This type is selected when device recognition fails or an illegal device is plugged in. It may be operated as a Wii Remote.<BR> 284 </TR> 285 <TR> 286 <TD width="150"><CODE>WPAD_DEV_UNKNOWN</CODE></TD> 287 <TD width="350">Unknown device. This type is selected during the period between insertion of an External Extension Controller and completion of the recognition process. It may be operated as a Wii Remote.<BR> 288 </TD> 289 </TR> 290 </TBODY> 291 </TABLE> 292</blockquote> 293<ul> 294<li>Error Status</li> 295</ul> 296<blockquote> 297Error statuses are defined with the following macro constants. 298 <TABLE border="1" width="500" cellspacing="0.1"> 299 <TBODY> 300 <TR> 301 <TD width="150"><CODE>WPAD_ERR_NONE</CODE></TD> 302 <TD width="350">Indicates the Wii Remote is connected. The <code>WPADStatus</code> structure contains valid data.</TD> 303 </TR> 304 <TR> 305 <TD width="150"><CODE>WPAD_ERR_BUSY</CODE></TD> 306 <TD width="350">This is the ACK control command sent to the Wii Remote. Only button information is valid for the <code>WPADStatus</code> structure.<BR> 307 </TR> 308 <TR> 309 <TD width="150"><CODE>WPAD_ERR_INVALID</CODE></TD> 310 <TD width="350">The data format of data received from the Wii Remote differs from that set by the <a href="./WPADSetDataFormat.html"><code>WPADSetDataFormat</code></a> function. (Structure members other than <CODE><STRONG><EM>err</EM></STRONG></CODE> are undefined.)</TD> 311 </TR> 312 <TR> 313 <TD width="150"><CODE>WPAD_ERR_CORRUPTED</CODE></TD> 314 <TD width="350">The data in the External Extension Controller is corrupted. The structure members of the External Extension Controller are undefined.</TD> 315 </TR> 316 </TBODY> 317 </TABLE> 318</blockquote> 319 320<H2>See Also</H2> 321<p> 322<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> 323</p> 324 325 326<H2>Revision History</H2> 327<P> 3282007/12/10 Revised the description of <CODE>WPAD_ERR_BUSY</CODE>, and deleted <CODE>WPAD_ERR_NO_CONTROLLER</CODE> and <CODE>WPAD_ERR_TRANSFER</CODE>.<br> 2006/09/22 Added <CODE>WPAD_ERR_CORRUPTED</CODE>.<br>2006/08/15 Revised the description of <CODE>WPAD_ERR_INVALID</CODE>.<br>2006/06/19 Added define. Changed the name of the External Extension Controller. Changed the names of buttons. Revised the description of <CODE>WPAD_DEV_DOLPHIN</CODE>.<br>2005/10/27 Changed the acceleration resolution from 2048 to 1024. Changed the interface from EXI to SI.<br>2005/09/27 Changed the abbreviation to DPD. Deleted the note regarding the <code>DPDObject</code> members <CODE><b><i>size</i></b></CODE> and <CODE><b><i>traceID</i></b></CODE>; Changed the description related to DPD.<br>2005/08/30 Revised the description of buttons; added a note that the member variables of the structure <code>DPDObject</code> will change.<br>2005/08/01 Initial version.<br> 329</P> 330<hr><p>CONFIDENTIAL</p></body> 331</HTML>