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>WPADCLStatus</title> 9</head> 10 11<body> 12 13 14<h1>WPADCLStatus</h1> 15 16 17<H2>C Specification</H2> 18<DL> 19 <DD> 20 <PRE><CODE>#include <revolution/wpad.h></CODE></PRE> 21 <DD> 22 <PRE><CODE> 23#define WPAD_DPD_MAX_OBJECTS 4 24 25#define WPAD_BUTTON_LEFT 0x0001 26#define WPAD_BUTTON_RIGHT 0x0002 27#define WPAD_BUTTON_DOWN 0x0004 28#define WPAD_BUTTON_UP 0x0008 29#define WPAD_BUTTON_PLUS 0x0010 30#define WPAD_BUTTON_2 0x0100 31#define WPAD_BUTTON_1 0x0200 32#define WPAD_BUTTON_B 0x0400 33#define WPAD_BUTTON_A 0x0800 34#define WPAD_BUTTON_MINUS 0x1000 35#define WPAD_BUTTON_HOME 0x8000 36 37// for FreeStyle 38#define WPAD_BUTTON_Z 0x2000 39#define WPAD_BUTTON_C 0x4000 40 41// for ClassicStyle 42#define WPAD_CL_BUTTON_UP 0x0001 43#define WPAD_CL_BUTTON_LEFT 0x0002 44#define WPAD_CL_TRIGGER_ZR 0x0004 45#define WPAD_CL_BUTTON_X 0x0008 46#define WPAD_CL_BUTTON_A 0x0010 47#define WPAD_CL_BUTTON_Y 0x0020 48#define WPAD_CL_BUTTON_B 0x0040 49#define WPAD_CL_TRIGGER_ZL 0x0080 50#define WPAD_CL_RESERVED 0x0100 51#define WPAD_CL_TRIGGER_R 0x0200 52#define WPAD_CL_BUTTON_PLUS 0x0400 53#define WPAD_CL_BUTTON_HOME 0x0800 54#define WPAD_CL_BUTTON_MINUS 0x1000 55#define WPAD_CL_TRIGGER_L 0x2000 56#define WPAD_CL_BUTTON_DOWN 0x4000 57#define WPAD_CL_BUTTON_RIGHT 0x8000 58 59// for compatibility 60#define WPAD_BUTTON_SELECT WPAD_BUTTON_MINUS 61#define WPAD_BUTTON_START WPAD_BUTTON_PLUS 62#define WPAD_BUTTON_SMALL_B WPAD_BUTTON_2 63#define WPAD_BUTTON_SMALL_A WPAD_BUTTON_1 64#define WPAD_BUTTON_Z1 WPAD_BUTTON_Z 65#define WPAD_BUTTON_Z2 WPAD_BUTTON_C 66 67 68typedef struct WPADCLStatus 69{ 70 u16 button; 71 s16 accX; 72 s16 accY; 73 s16 accZ; 74 DPDObject obj[WPAD_DPD_MAX_OBJECTS]; 75 u8 dev; 76 s8 err; 77 u16 clButton; 78 s16 clLStickX; 79 s16 clLStickY; 80 s16 clRStickX; 81 s16 clRStickY; 82 u8 clTriggerL; 83 u8 clTriggerR; 84} WPADCLStatus; 85 86typedef struct DPDObject 87{ 88 s16 x; 89 s16 y; 90 u16 size; 91 u8 traceId; 92} DPDObject; 93</CODE></PRE> 94</DL> 95<H2>Elements</H2> 96<TABLE border="1" cellpadding="3" cellspacing="0.1"> 97 <TBODY> 98 <tr> 99 <TD><code><b><i>button</i></b></code></TD> 100 <TD>When a Wii Remote button is pressed, the corresponding bit (<code>WPAD_BUTTON_*</code>) is set to 1.</TD> 101 </tr> 102 <tr> 103 <TD><code><b><i>accX</i></b></code></TD> 104 <TD>Output of the Wii Remote's 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> 105 </tr> 106 <tr> 107 <TD><code><b><i>accY</i></b></code></TD> 108 <TD>Output of the Wii Remote's motion sensor's y-component. The resolution is the same as for <code><b><i>accX</i></b></code>.</TD> 109 </tr> 110 <tr> 111 <TD><code><b><i>accZ</i></b></code></TD> 112 <TD>Output of the Wii Remote's motion sensor's z-component. The resolution is the same as for <code><b><i>accX</i></b></code>.</TD> 113 </tr> 114 <tr> 115 <TD><code><b><i>obj[].x</i></b></code></TD> 116 <TD>The x-coordinate of the center of mass for the object obtained with the pointer. The resolution is 1024.</TD> 117 </tr> 118 <tr> 119 <TD><code><b><i>obj[].y</i></b></code></TD> 120 <TD>The y-coordinate of the center of mass for the object obtained with the pointer. The resolution is 768.</TD> 121 </tr> 122 <tr> 123 <TD><code><b><i>obj[].size</i></b></code></TD> 124 <TD>The size of the object obtained with the pointer. The resolution is 128*96.</TD> 125 </tr> 126 <tr> 127 <TD><code><b><i>obj[].traceId</i></b></code></TD> 128 <TD>The trace ID of the object obtained with the pointer.</TD> 129 </tr> 130 <tr> 131 <TD><code><b><i>dev</i></b></code></TD> 132 <TD>The controller type.</TD> 133 </tr> 134 <TR> 135 <TD width="120" valign="top"><CODE><b><i>err</i></b></CODE></TD> 136 <TD width="520">The controller error status. 137 </TD> 138 </TR> 139 <tr> 140 <TD><code><b><i>clButton</i></b></code></TD> 141 <TD>When a Classic Controller button is pressed, the corresponding bit (<code>WPAD_CL_BUTTON_*</code>) is set to 1.</TD> 142 </tr> 143 <tr> 144 <TD><code><b><i>clLStickX</i></b></code></TD> 145 <TD>Movement data given in terms of the x-axis for the Classic Controller L Stick. (Values are output in the range -512 <= <STRONG><CODE><EM>clLStickX</EM></CODE></STRONG> < 512.)</TD> 146 </tr> 147 <tr> 148 <TD><code><b><i>clLStickY</i></b></code></TD> 149 <TD>Movement data given in terms of the y-axis for the Classic Controller L Stick. The value range is the same as for <CODE><STRONG><EM>clLStickX</EM></STRONG></CODE>.</TD> 150 </tr> 151 <tr> 152 <TD><code><b><i>clRStickX</i></b></code></TD> 153 <TD>Movement data given in terms of the x-axis for the Classic Controller R Stick. (Values are output in the -512 <= <CODE><STRONG><EM>clRStickX</EM></STRONG></CODE> < 512.)</TD> 154 </tr> 155 <tr> 156 <TD><code><b><i>clRStickY</i></b></code></TD> 157 <TD>Movement data given in terms of the y-axis for the Classic Controller R Stick. The value range is the same as for <CODE><STRONG><EM>clRStickX</EM></STRONG></CODE>.</TD> 158 </tr> 159 <tr> 160 <TD><code><b><i>clTriggerL</i></b></code></TD> 161 <TD>Movement data given in terms of the L Button of the Classic Controller. (Values are output in the range 0 <= <CODE><STRONG><EM>clTriggerL</EM></STRONG></CODE> < 256.)</TD> 162 </tr> 163 <tr> 164 <TD><code><b><i>clTriggerR</i></b></code></TD> 165 <TD>Movement data given in terms of the R Button of the Classic Controller. The value range is as for <CODE><STRONG><EM>clTriggerL</EM></STRONG></CODE>.</TD> 166 </tr> 167 </TBODY> 168</TABLE> 169 170 171 172<h2>Description</h2> 173<p> 174The <CODE>WPADCLStatus</CODE> structure represents the status of the Classic Style. 175</p> 176<ul> 177<li>Number of Controllers</li> 178</ul> 179<blockquote> 180The maximum number of Wii Remotes that can connect is defined as the macro constant below. 181<table border="1"> 182<TR> 183<TD width="150"><CODE>WPAD_MAX_CONTROLLERS</CODE></TD> 184<TD>The maximum number of Wii Remotes that can connect.</TD> 185</TR> 186</table> 187</blockquote> 188 189<ul> 190<li>Button Input</li> 191</ul> 192<blockquote> 193Button inputs are defined with the following macro constants. The Wii Remote has +Control Pad, A Button, B Button, 1 Button, 2 Button, - Button, + Button, and HOME; the Classic Controller has +Control Pad, A Button, B Button, X Button, Y Button, -/SELECT Button, +/START Button, HOME, L Button, R Button, and Z Button. The button status for the Wii Remote and the Classic Controller can be obtained independently. 194<table border="1"> 195<TR> 196<TD width="150"><CODE>WPAD_BUTTON_UP</CODE></TD> 197<TD>+Control Pad UP on the Wii Remote is being pressed.</TD> 198</TR> 199<TR> 200<TD width="150"><CODE>WPAD_BUTTON_DOWN</CODE></TD> 201<TD>+Control Pad DOWN on the Wii Remote is being pressed.</TD> 202</TR> 203<TR> 204<TD width="150"><CODE>WPAD_BUTTON_LEFT</CODE></TD> 205<TD>+Control Pad LEFT on the Wii Remote is being pressed.</TD> 206</TR> 207<TR> 208<TD width="150"><CODE>WPAD_BUTTON_RIGHT</CODE></TD> 209<TD>+Control Pad RIGHT on the Wii Remote is being pressed.</TD> 210</TR> 211<TR> 212<TD width="150"><CODE>WPAD_BUTTON_A</CODE></TD> 213<TD>The A Button on the Wii Remote is being pressed.</TD> 214</TR> 215<TR> 216<TD width="150"><CODE>WPAD_BUTTON_B</CODE></TD> 217<TD>The B Button on the Wii Remote is being pressed.</TD> 218</TR> 219<TR> 220<TD width="150"><CODE>WPAD_BUTTON_1</CODE></TD> 221<TD>The 1 Button on the Wii Remote is being pressed.</TD> 222</TR> 223<TR> 224<TD width="150"><CODE>WPAD_BUTTON_2</CODE></TD> 225<TD>The 2 Button on the Wii Remote is being pressed.</TD> 226</TR> 227<TR> 228<TD width="150"><CODE>WPAD_BUTTON_MINUS</CODE></TD> 229<TD>The - Button on the Wii Remote is being pressed.</TD> 230</TR> 231<TR> 232<TD width="150"><CODE>WPAD_BUTTON_PLUS</CODE></TD> 233<TD>The + Button on the Wii Remote is being pressed.</TD> 234</TR> 235<TR> 236<TD width="150"><CODE>WPAD_BUTTON_HOME</CODE></TD> 237<TD>HOME on the Wii Remote is being pressed.</TD> 238</TR> 239</table> 240<br> 241<table border="1"> 242<TR> 243<TD width="150"><CODE>WPAD_CL_BUTTON_UP</CODE></TD> 244<TD>+Control Pad UP on the Classic Controller is being pressed.</TD> 245</TR> 246<TR> 247<TD width="150"><CODE>WPAD_CL_BUTTON_DOWN</CODE></TD> 248<TD>+Control Pad DOWN on the Classic Controller is being pressed.</TD> 249</TR> 250<TR> 251<TD width="150"><CODE>WPAD_CL_BUTTON_LEFT</CODE></TD> 252<TD>+Control Pad LEFT on the Classic Controller is being pressed.</TD> 253</TR> 254<TR> 255<TD width="150"><CODE>WPAD_CL_BUTTON_RIGHT</CODE></TD> 256<TD>+Control Pad RIGHT on the Classic Controller is being pressed.</TD> 257</TR> 258<TR> 259<TD width="150"><CODE>WPAD_CL_BUTTON_A</CODE></TD> 260<TD>The A Button on the Classic Controller is being pressed.</TD> 261</TR> 262<TR> 263<TD width="150"><CODE>WPAD_CL_BUTTON_B</CODE></TD> 264<TD>The B Button on the Classic Controller is being pressed.</TD> 265</TR> 266<TR> 267<TD width="150"><CODE>WPAD_CL_BUTTON_Y</CODE></TD> 268<TD>The Y Button on the Classic Controller is being pressed.</TD> 269</TR> 270<TR> 271<TD width="150"><CODE>WPAD_CL_BUTTON_X</CODE></TD> 272<TD>The X Button on the Classic Controller is being pressed.</TD> 273</TR> 274<TR> 275<TD width="150"><CODE>WPAD_CL_TRIGGER_L</CODE></TD> 276<TD>The L Button on the Classic Controller is being pressed.</TD> 277</TR> 278<TR> 279<TD width="150"><CODE>WPAD_CL_TRIGGER_R</CODE></TD> 280<TD>The R Button on the Classic Controller is being pressed.</TD> 281</TR> 282<TR> 283<TD width="150"><CODE>WPAD_CL_TRIGGER_ZL</CODE></TD> 284<TD>The ZL Button on the Classic Controller is being pressed.</TD> 285</TR> 286<TR> 287<TD width="150"><CODE>WPAD_CL_TRIGGER_ZR</CODE></TD> 288<TD>The ZR Button on the Classic Controller is being pressed.</TD> 289<TR> 290<TD width="150"><CODE>WPAD_CL_BUTTON_MINUS</CODE></TD> 291<TD>The -/SELECT Button on the Classic Controller is being pressed.</TD> 292</TR> 293<TR> 294<TD width="150"><CODE>WPAD_CL_BUTTON_PLUS</CODE></TD> 295<TD>The +/START Button on the Classic Controller is being pressed.</TD> 296</TR> 297<TR> 298<TD width="150"><CODE>WPAD_CL_BUTTON_HOME</CODE></TD> 299<TD>HOME on the Classic Controller is being pressed.</TD> 300</TR> 301</table> 302</blockquote> 303 304<ul> 305<li>Pointer</li> 306</ul> 307<blockquote> 308The pointer specifications are defined by the following macro constants. 309 310<table border="1"> 311<TR> 312<TD width="150"><CODE>WPAD_DPD_MAX_OBJECTS</CODE></TD> 313<TD>The maximum number of objects that the pointer can detect simultaneously.</TD> 314</TR> 315<TR> 316<TD width="150"><CODE>WPAD_DPD_ANGLE</CODE></TD> 317<TD>The pointer view angle (in degrees).</TD> 318</TR> 319<TR> 320<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WX</CODE></TD> 321<TD>Pointer resolution along the x-axis.</TD> 322</TR> 323<TR> 324<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WY</CODE></TD> 325<TD>Pointer resolution along the y-axis.</TD> 326</TR> 327</table> 328 329<p> 330Object 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. 331</p> 332<p> 333The 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. 334</p> 335</blockquote> 336 337<ul> 338<li>Controller Type</li> 339</ul> 340<blockquote> 341Controller types are defined with the following macro constants. 342 <TABLE border="1" width="500" cellspacing="0.1"> 343 <TBODY> 344 <TR> 345 <TD width="150"><CODE>WPAD_DEV_NOT_FOUND</CODE></TD> 346 <TD width="350">Nothing is connected to the specified channel.</TD> 347 </TR> 348 <TR> 349 <TD width="150"><CODE>WPAD_DEV_CORE</CODE></TD> 350 <TD width="350">Wii Remote.</TD> 351 </TR> 352 <TR> 353 <TD width="150"><CODE>WPAD_DEV_FREESTYLE</CODE></TD> 354 <TD width="350">Nunchuk Style.</TD> 355 </TR> 356 <TR> 357 <TD width="150"><CODE>WPAD_DEV_CLASSIC</CODE></TD> 358 <TD width="350">Classic Style.<BR> 359 </TR> 360 <TR> 361 <TD width="150"><CODE>WPAD_DEV_FUTURE</CODE></TD> 362 <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> 363 </TR> 364 <TR> 365 <TD width="150"><CODE>WPAD_DEV_NOT_SUPPORTED</CODE></TD> 366 <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> 367 </TR> 368 <TR> 369 <TD width="150"><CODE>WPAD_DEV_UNKNOWN</CODE></TD> 370 <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> 371 </TD> 372 </TR> 373 </TBODY> 374 </TABLE> 375</blockquote> 376 377<ul> 378<li>Error Status</li> 379</ul> 380<blockquote> 381Error statuses are defined with the following macro constants. 382 <TABLE border="1" width="500" cellspacing="0.1"> 383 <TBODY> 384 <TR> 385 <TD width="150"><CODE>WPAD_ERR_NONE</CODE></TD> 386 <TD width="350">Indicates the Wii Remote is connected. The <code>WPADCLStatus</code> structure maintains valid data.</TD> 387 </TR> 388 <TR> 389 <TD width="150"><CODE>WPAD_ERR_BUSY</CODE></TD> 390 <TD width="350">This is the ACK control command sent to the Wii Remote. Only Wii Remote button information is valid for the <code>WPADCLStatus</code> structure. 391 </TR> 392 <TR> 393 <TD width="150"><CODE>WPAD_ERR_INVALID</CODE></TD> 394 <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> 395 </TR> 396 <TR> 397 <TD width="150"><CODE>WPAD_ERR_CORRUPTED</CODE></TD> 398 <TD width="350">The data in the External Extension Controller is corrupted. The structure members of the External Extension Controller are undefined.</TD> 399 </TR> 400 </TBODY> 401 </TABLE> 402</blockquote> 403 404<H2>See Also</H2> 405<p> 406<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> 407</p> 408 409 410<H2>Revision History</H2> 411<P> 4122007/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> 413 2007/12/27 Corrected mistaken range for the stick value.<br>2006/09/22 Added <CODE>WPAD_ERR_CORRUPTED</CODE>.<br>2006/08/15 Changed the description of <CODE>WPAD_ERR_INVALID</CODE>.<br>2006/06/19 Initial version<br></P> 414<hr><p>CONFIDENTIAL</p></body> 415</HTML>