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{ 69u16 button; 70s16 accX; 71s16 accY; 72s16 accZ; 73DPDObject obj[WPAD_DPD_MAX_OBJECTS]; 74u8 dev; 75s8 err; 76s16 fsAccX; 77s16 fsAccY; 78s16 fsAccZ; 79s8 fsStickX; 80s8 fsStickY; 81} WPADFSStatus; 82 83typedef struct DPDObject 84{ 85s16 x; 86s16 y; 87u16 size; 88u8 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 <= fsAccX < 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 3D 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 3D 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 WPADFSStatus structure represents the status of the Nunchuk style. 164<ul> 165<li>Number of Standard Controllers</li> 166</ul> 167<blockquote> 168The maximum number of Wii Remotes that can connect is defined as a macro constant. 169<table border="1"> 170<TR> 171<TD width="150"><CODE>WPAD_MAX_CONTROLLERS</CODE></TD> 172<TD>The maximum number of Wii Remotes that can connect.</TD> 173</TR> 174</table> 175</blockquote> 176 177<ul> 178<li>Button Input</li> 179</ul> 180<blockquote> 181Button inputs are defined with the following macro constants. The Wii Remote is equipped with + Control Pad, A, B, 1, 2, MINUS, PLUS, and HOME digital buttons; the Nunchuk is equipped with Z and C digital buttons. 182<table border="1"> 183<TR> 184<TD width="150"><CODE>WPAD_BUTTON_UP</CODE></TD> 185<TD>+Control Pad UP on the Wii Remote is being pressed.</TD> 186</TR> 187<TR> 188<TD width="150"><CODE>WPAD_BUTTON_DOWN</CODE></TD> 189<TD>+Control Pad DOWN on the Wii Remote is being pressed.</TD> 190</TR> 191<TR> 192<TD width="150"><CODE>WPAD_BUTTON_LEFT</CODE></TD> 193<TD>+Control Pad LEFT on the Wii Remote is being pressed.</TD> 194</TR> 195<TR> 196<TD width="150"><CODE>WPAD_BUTTON_RIGHT</CODE></TD> 197<TD>+Control Pad RIGHT on the Wii Remote is being pressed.</TD> 198</TR> 199<TR> 200<TD width="150"><CODE>WPAD_BUTTON_A</CODE></TD> 201<TD>The A Button on the Wii Remote is being pressed.</TD> 202</TR> 203<TR> 204<TD width="150"><CODE>WPAD_BUTTON_B</CODE></TD> 205<TD>The B Button on the Wii Remote is being pressed.</TD> 206</TR> 207<TR> 208<TD width="150"><CODE>WPAD_BUTTON_1</CODE></TD> 209<TD>The 1 Button on the Wii Remote is being pressed.</TD> 210</TR> 211<TR> 212<TD width="150"><CODE>WPAD_BUTTON_2</CODE></TD> 213<TD>The 2 Button on the Wii Remote is being pressed.</TD> 214</TR> 215<TR> 216<TD width="150"><CODE>WPAD_BUTTON_MINUS</CODE></TD> 217<TD>The MINUS Button on the Wii Remote is being pressed.</TD> 218</TR> 219<TR> 220<TD width="150"><CODE>WPAD_BUTTON_PLUS</CODE></TD> 221<TD>The PLUS Button on the Wii Remote is being pressed.</TD> 222</TR> 223<TR> 224<TD width="150"><CODE>WPAD_BUTTON_HOME</CODE></TD> 225<TD>HOME on the Wii Remote is being pressed.</TD> 226</TR> 227<TR> 228<TD width="150"><CODE>WPAD_BUTTON_Z</CODE></TD> 229<TD>The Z Button on the Nunchuk is being pressed.</TD> 230</TR> 231<TR> 232<TD width="150"><CODE>WPAD_BUTTON_C</CODE></TD> 233<TD>The C Button on the Nunchuk is being pressed.</TD> 234</TR> 235</table> 236</blockquote> 237 238<ul> 239<li>Pointer</li> 240</ul> 241<blockquote> 242The pointer specifications are defined as macro constants. 243 244<table border="1"> 245<TR> 246<TD width="150"><CODE>WPAD_DPD_MAX_OBJECTS</CODE></TD> 247<TD>The maximum number of objects that the pointer can detect simultaneously.</TD> 248</TR> 249<TR> 250<TD width="150"><CODE>WPAD_DPD_ANGLE</CODE></TD> 251<TD>The pointer view angle (in degrees).</TD> 252</TR> 253<TR> 254<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WX</CODE></TD> 255<TD>Pointer resolution along the x-axis.</TD> 256</TR> 257<TR> 258<TD width="150"><CODE>WPAD_DPD_IMG_RESO_WY</CODE></TD> 259<TD>Pointer resolution along the y-axis.</TD> 260</TR> 261</table> 262 263<p> 264Object data items are stored in the obj[] array in the order that they are detected by the pointer. The pointer scans the image captured by sensor internally from top left to bottom right and outputs object data in the order detected. At the same time, trace ID(s) are assigned in the order that the objects are detected. 265</p> 266<p> 267The trace ID helps 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. 268</p> 269</blockquote> 270 271<ul> 272<li>Motion Sensor</li> 273</ul> 274<blockquote> 275The motion sensor specifications are defined as macro constants. 276 277<table border="1" 278 279<TR> 280<TD width="150"><CODE>WPAD_ACC_RESO</CODE></TD> 281<TD>The resolution of the Wii Remote motion sensor.</TD> 282</TR> 283 284</table> 285</blockquote> 286 287<ul> 288<li>Controller Type</li> 289</ul> 290<blockquote> 291Controller types are defined with the following macro constants. 292 <TABLE border="1" width="500" cellspacing="0.1"> 293 <TBODY> 294 <TR> 295<TD width="150"><CODE>WPAD_DEV_CORE</CODE></TD> 296<TD width="350">Wii Remote.</TD> 297 </TR> 298 <TR> 299<TD width="150"><CODE>WPAD_DEV_FREESTYLE</CODE></TD> 300<TD width="350">Nunchuk Style.</TD> 301 </TR> 302 <TR> 303<TD width="150"><CODE>WPAD_DEV_CLASSIC</CODE></TD> 304<TD width="350">Classic Style. 305 </TR> 306 <TR> 307<TD width="150"><CODE>WPAD_DEV_UNKNOWN</CODE></TD> 308<TD width="350">Unknown device. 309 </TD> 310 </TR> 311 </TBODY> 312 </TABLE> 313</blockquote> 314 315<ul> 316<li>Error Status</li> 317</ul> 318<blockquote> 319Error statuses are defined with the following macro constants. 320 <TABLE border="1" width="500" cellspacing="0.1"> 321 <TBODY> 322 <TR> 323<TD width="150"><CODE>WPAD_ERR_NONE</CODE></TD> 324<TD width="350">Indicates the Wii Remote is connected. The <code>WPADFSStatus</code> structure contains valid data.</TD> 325 </TR> 326 <TR> 327<TD width="150"><CODE>WPAD_ERR_NO_CONTROLLER</CODE></TD> 328<TD width="350">Indicates the Wii Remote is not connected. The <code>WPADFSStatus</code> structure does not contain valid data. (Members other than <CODE><b><i>err</i></b></CODE> are undefined.) 329 </TD> 330 </TR> 331 <TR> 332<TD width="150"><CODE>WPAD_ERR_BUSY</CODE></TD> 333<TD width="350">Processing is being carried out for the Wii Remote. Only Wii Remote button information is valid for the <code>WPADFSStatus</code> structure. 334 </TR> 335 <TR> 336<TD width="150"><CODE>WPAD_ERR_TRANSFER</CODE></TD> 337<TD width="350">A problem occurred during communications. The <code>WPADFSStatus</code> structure does not contain valid data. (Members other than <CODE><b><i>err</i></b></CODE> are undefined.) 338 </TD> 339 </TR> 340 <TR> 341<TD width="150"><CODE>WPAD_ERR_INVALID</CODE></TD> 342<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 err are undefined.)</TD> 343 </TR> 344 </TBODY> 345 </TABLE> 346</blockquote> 347 348</p> 349<H2>See Also</H2> 350<p> 351<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> 352</p> 353 354 355<H2>Revision History</H2> 356<P> 35708/15/2006 Changed the description of WP AD_ERR_INVALID. 06/19/2006 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. 358</P> 359<hr> 360<P>CONFIDENTIAL</p> 361</BODY> 362</HTML>