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>WPADFSStatus</title> 9</head> 10 11<body> 12 13 14<h1>WPADFSStatus</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 67typedef struct WPADFSStatus 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 s16 fsAccX; 77 s16 fsAccY; 78 s16 fsAccZ; 79 s8 fsStickX; 80 s8 fsStickY; 81} WPADFSStatus; 82 83typedef struct DPDObject 84{ 85 s16 x; 86 s16 y; 87 u16 size; 88 u8 traceId; 89} DPDObject; 90</CODE></PRE> 91</DL> 92<H2>Elements</H2> 93<TABLE border="1" cellpadding="3" cellspacing="0.1"> 94 <TBODY> 95 <tr> 96 <TD><code><b><i>button</i></b></code></TD> 97 <TD>When a button is pressed, the corresponding bit (<code>WPAD_BUTTON_*</code>) is set to 1.</TD> 98 </tr> 99 <tr> 100 <TD><code><b><i>accX</i></b></code></TD> 101 <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> 102 </tr> 103 <tr> 104 <TD><code><b><i>accY</i></b></code></TD> 105 <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> 106 </tr> 107 <tr> 108 <TD><code><b><i>accZ</i></b></code></TD> 109 <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> 110 </tr> 111 <tr> 112 <TD><code><b><i>obj[].x</i></b></code></TD> 113 <TD>The x-coordinate of the center of mass for the object obtained with the pointer. The resolution is 1024.</TD> 114 </tr> 115 <tr> 116 <TD><code><b><i>obj[].y</i></b></code></TD> 117 <TD>The y-coordinate of the center of mass for the object obtained with the pointer. The resolution is 768.</TD> 118 </tr> 119 <tr> 120 <TD><code><b><i>obj[].size</i></b></code></TD> 121 <TD>The size of the object obtained with the pointer. The resolution is 128*96.</TD> 122 </tr> 123 <tr> 124 <TD><code><b><i>obj[].traceId</i></b></code></TD> 125 <TD>The trace ID of the object obtained with the pointer.</TD> 126 </tr> 127 <tr> 128 <TD><code><b><i>dev</i></b></code></TD> 129 <TD>The controller type.</TD> 130 </tr> 131 <TR> 132 <TD width="120" valign="top"><CODE><b><i>err</i></b></CODE></TD> 133 <TD width="520">The controller error status. 134 </TD> 135 </TR> 136 <tr> 137 <TD><code><b><i>fsAccX</i></b></code></TD> 138 <TD>Output of the Nunchuk's motion sensor's x-component. The resolution is 1024. A value of 0 corresponds to 0G=0 (outputs in the range of -512 <= <CODE><STRONG><EM>fsAccX</EM></STRONG></CODE> < 512).</TD> 139 </tr> 140 <tr> 141 <TD><code><b><i>fsAccY</i></b></code></TD> 142 <TD>Output of the Nunchuk's motion sensor's y-component. The resolution is the same as for <code><b><i>fsAccX</i></b></code>.</TD> 143 </tr> 144 <tr> 145 <TD><code><b><i>fsAccZ</i></b></code></TD> 146 <TD>Output of the Nunchuk's motion sensor's z-component. The resolution is the same as for <code><b><i>fsAccX</i></b></code>.</TD> 147 </tr> 148 <tr> 149 <TD><code><b><i>fsStickX</i></b></code></TD> 150 <TD>Translation data for the x-axis of the analog stick on the Nunchuk is received. The resolution is 256 (Outputs in the range of -128 <= <code><b><i>fsStickX</i></b></code> < 128).</TD> 151 </tr> 152 <tr> 153 <TD><code><b><i>fsStickY</i></b></code></TD> 154 <TD>Translation data for the y-axis of the analog stick on the Nunchuk is received. The resolution is the same as for <code><b><i>fsStickX</i></b></code>.</TD> 155 </tr> 156 </TBODY> 157</TABLE> 158 159 160 161<h2>Description</h2> 162<p> 163The <CODE>WPADFSStatus</CODE> structure represents the status of the Nunchuk style. 164</p> 165<ul> 166<li>Number of Controllers</li> 167</ul> 168<blockquote> 169The maximum number of Wii Remotes that can connect is defined as the macro constant below. 170<table border="1"> 171<TR> 172<TD width="150"><CODE>WPAD_MAX_CONTROLLERS</CODE></TD> 173<TD>The maximum number of Wii Remotes that can connect.</TD> 174</TR> 175</table> 176</blockquote> 177 178<ul> 179<li>Button Input</li> 180</ul> 181<blockquote> 182Button inputs are defined with the following macro constants. The Wii Remote is equipped with the +Control Pad, A, B, 1, 2, MINUS, PLUS, and HOME digital buttons; the Nunchuk is equipped with Z and C digital buttons. 183<table border="1"> 184<TR> 185<TD width="150"><CODE>WPAD_BUTTON_UP</CODE></TD> 186<TD>+Control Pad UP on the Wii Remote is being pressed.</TD> 187</TR> 188<TR> 189<TD width="150"><CODE>WPAD_BUTTON_DOWN</CODE></TD> 190<TD>+Control Pad DOWN on the Wii Remote is being pressed.</TD> 191</TR> 192<TR> 193<TD width="150"><CODE>WPAD_BUTTON_LEFT</CODE></TD> 194<TD>+Control Pad LEFT on the Wii Remote is being pressed.</TD> 195</TR> 196<TR> 197<TD width="150"><CODE>WPAD_BUTTON_RIGHT</CODE></TD> 198<TD>+Control Pad RIGHT on the Wii Remote is being pressed.</TD> 199</TR> 200<TR> 201<TD width="150"><CODE>WPAD_BUTTON_A</CODE></TD> 202<TD>The A Button on the Wii Remote is being pressed.</TD> 203</TR> 204<TR> 205<TD width="150"><CODE>WPAD_BUTTON_B</CODE></TD> 206<TD>The B Button on the Wii Remote is being pressed.</TD> 207</TR> 208<TR> 209<TD width="150"><CODE>WPAD_BUTTON_1</CODE></TD> 210<TD>The 1 Button on the Wii Remote is being pressed.</TD> 211</TR> 212<TR> 213<TD width="150"><CODE>WPAD_BUTTON_2</CODE></TD> 214<TD>The 2 Button on the Wii Remote is being pressed.</TD> 215</TR> 216<TR> 217<TD width="150"><CODE>WPAD_BUTTON_MINUS</CODE></TD> 218<TD>The - Button on the Wii Remote is being pressed.</TD> 219</TR> 220<TR> 221<TD width="150"><CODE>WPAD_BUTTON_PLUS</CODE></TD> 222<TD>The + Button on the Wii Remote is being pressed.</TD> 223</TR> 224<TR> 225<TD width="150"><CODE>WPAD_BUTTON_HOME</CODE></TD> 226<TD>HOME on the Wii Remote is being pressed.</TD> 227</TR> 228<TR> 229<TD width="150"><CODE>WPAD_BUTTON_Z</CODE></TD> 230<TD>The Z Button on the Nunchuk is being pressed.</TD> 231</TR> 232<TR> 233<TD width="150"><CODE>WPAD_BUTTON_C</CODE></TD> 234<TD>The C Button on the Nunchuk is being pressed.</TD> 235</TR> 236</table> 237</blockquote> 238 239<ul> 240<li>Pointer</li> 241</ul> 242<blockquote> 243The pointer specifications are defined by the following macro constants. 244 245<table border="1"> 246<TR> 247<TD width="150"><CODE>WPAD_DPD_MAX_OBJECTS</CODE></TD> 248<TD>The maximum number of objects that the pointer can detect simultaneously.</TD> 249</TR> 250<TR> 251<TD width="150"><CODE>WPAD_DPD_ANGLE</CODE></TD> 252<TD>The pointer view angle (in degrees).</TD> 253</TR> 254<TR> 255<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WX</CODE></TD> 256<TD>Pointer resolution along the x-axis.</TD> 257</TR> 258<TR> 259<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WY</CODE></TD> 260<TD>Pointer resolution along the y-axis.</TD> 261</TR> 262</table> 263 264<p> 265Object 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. 266</p> 267<p> 268The 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. 269</p> 270</blockquote> 271 272<ul> 273<li>Motion Sensor</li> 274</ul> 275<blockquote> 276The motion sensor specifications are defined by the macro constant below. 277 278<table border="1"> 279 280<TR> 281<TD width="150"><CODE>WPAD_ACC_RESO</CODE></TD> 282<TD>The resolution of the Wii Remote motion sensor.</TD> 283</TR> 284 285</table> 286</blockquote> 287 288<ul> 289<li>Controller Type</li> 290</ul> 291<blockquote> 292Controller types are defined with the following macro constants. 293 <TABLE border="1" width="500" cellspacing="0.1"> 294 <TBODY> 295 <TR> 296 <TD width="150"><CODE>WPAD_DEV_NOT_FOUND</CODE></TD> 297 <TD width="350">Nothing is connected to the specified channel.</TD> 298 </TR> 299 <TR> 300 <TD width="150"><CODE>WPAD_DEV_CORE</CODE></TD> 301 <TD width="350">Wii Remote.</TD> 302 </TR> 303 <TR> 304 <TD width="150"><CODE>WPAD_DEV_FREESTYLE</CODE></TD> 305 <TD width="350">Nunchuk Style.</TD> 306 </TR> 307 <TR> 308 <TD width="150"><CODE>WPAD_DEV_CLASSIC</CODE></TD> 309 <TD width="350">Classic Style.<BR> 310 </TR> 311 <TR> 312 <TD width="150"><CODE>WPAD_DEV_FUTURE</CODE></TD> 313 <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> 314 </TR> 315 <TR> 316 <TD width="150"><CODE>WPAD_DEV_NOT_SUPPORTED</CODE></TD> 317 <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> 318 </TR> 319 <TR> 320 <TD width="150"><CODE>WPAD_DEV_UNKNOWN</CODE></TD> 321 <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> 322 </TD> 323 </TR> 324 </TBODY> 325 </TABLE> 326</blockquote> 327 328<ul> 329<li>Error Status</li> 330</ul> 331<blockquote> 332Error statuses are defined with the following macro constants. 333 <TABLE border="1" width="500" cellspacing="0.1"> 334 <TBODY> 335 <TR> 336 <TD width="150"><CODE>WPAD_ERR_NONE</CODE></TD> 337 <TD width="350">Indicates the Wii Remote is connected. The <code>WPADFSStatus</code> structure contains valid data.</TD> 338 </TR> 339 <TR> 340 <TD width="150"><CODE>WPAD_ERR_BUSY</CODE></TD> 341 <TD width="350">This is the ACK control command sent to the Wii Remote. Only Wii Remote button information is valid for the <code>WPADFSStatus</code> structure. 342 </TR> 343 <TR> 344 <TD width="150"><CODE>WPAD_ERR_INVALID</CODE></TD> 345 <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> 346 </TR> 347 <TR> 348 <TD width="150"><CODE>WPAD_ERR_CORRUPTED</CODE></TD> 349 <TD width="350">The data in the External Extension Controller is corrupted. The structure members of the External Extension Controller are undefined.</TD> 350 </TR> 351 </TBODY> 352 </TABLE> 353</blockquote> 354 355<H2>See Also</H2> 356<p> 357<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> 358</p> 359 360 361<H2>Revision History</H2> 362<P> 3632007/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> 364 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 Added define, changed names of game remote controls, changed the name of the External Extension Controller, changed names of buttons, changed the order of members in the structure, changed descriptions during error status for the wireless library, deleted defined macros for motion sensor gravity acceleration.<br>2005/10/27 Initial version.<br></P> 365<hr><p>CONFIDENTIAL</p></body> 366</HTML>