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 http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<title>WPADClampStick</title>
9</head>
10
11<body>
12
13<h1>WPADClampStick</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/wpad.h&gt;
18
19#define WPAD_CHAN0                              0
20#define WPAD_CHAN1                              1
21#define WPAD_CHAN2                              2
22#define WPAD_CHAN3                              3
23
24#define WPAD_STICK_CLAMP_OCTA_WITH_PLAY         0
25#define WPAD_STICK_CLAMP_OCTA_WITHOUT_PLAY      1
26#define WPAD_STICK_CLAMP_CIRCLE_WITH_PLAY       2
27#define WPAD_STICK_CLAMP_CIRCLE_WITHOUT_PLAY    3
28
29void WPADClampStick( s32 chan, void *status, u32 type );
30</pre></dd></dl>
31
32<h2>Arguments</h2>
33<TABLE class="arguments" border="1" >
34  <TBODY>
35    <TR>
36<TH>chan</TH>
37<TD>One of the <code>WPAD_CHAN*</code>.</TD>
38    </TR>
39    <TR>
40<TH>status</TH>
41<TD>Pointer to the <a href="./WPADStatus.html"><code>WPADStatus</code></a> structure to be clamped. If the <SPAN class="argument">err</SPAN> member stores <CODE>WPAD_ERR_NONE</CODE>, the analog stick input value is clamped according to the algorithm below.</TD>
42    </TR>
43    <TR>
44<TH>type</TH>
45<TD>One of the <code>WPAD_STICK_CLAMP_*</code>.</TD>
46    </TR>
47  </TBODY>
48</TABLE>
49
50<h2>Return Values</h2>
51<p>None.</p>
52
53<H2>Description</H2>
54<p>This API clamps the input of the analog stick of a Nunchuk or a Classic Controller.</p>
55<p>
56The algorithm for clamping the analog stick can be specified using <SPAN class="argument">type</SPAN> as shown in the figure below. If <code>WPAD_STICK_CLAMP_OCTA_WITH_PLAY</code> or <code>WPAD_STICK_CIRCLE_WITH_PLAY</code> are specified, the dead zone for the analog stick is clamped and the outside of an octagonal or circular shape is clamped. If <code>WPAD_STICK_CLAMP_OCTA_WITHOUT_PLAY</code> or <code>WPAD_STICK_CIRCLE_WITHOUT_PLAY</code> are specified, only the outside of the octagonal or circular shape is clamped without clamping the dead zone. More accurate movement in the diagonal direction that straddles each axis can be obtained when the dead zone is not clamped.
57</p>
58<p>
59The hardware specifications for the analog stick give a guaranteed play value of +/- 15.
60</p>
61
62<P><IMG src="WPADClampStickOctaPlay.gif"          alt="WPADClampStickOctaPlay.gif"          ></P>
63<P><IMG src="WPADClampStickOcta.gif"              alt="WPADClampStickOcta.gif"              ></P>
64<P><IMG src="WPADClampStickCirclePlay.gif"        alt="WPADClampStickCirclePlay.gif"        ></P>
65<P><IMG src="WPADClampStickCircle.gif"            alt="WPADClampStickCircle.gif"            ></P>
66<P><IMG src="WPADClampStickOctaPlayClassic.gif"   alt="WPADClampStickOctaPlayClassic.gif"   ></P>
67<P><IMG src="WPADClampStickOctaClassic.gif"       alt="WPADClampStickOctaClassic.gif"       ></P>
68<P><IMG src="WPADClampStickCirclePlayClassic.gif" alt="WPADClampStickCirclePlayClassic.gif" ></P>
69<P><IMG src="WPADClampStickCircleClassic.gif"     alt="WPADClampStickCircleClassic.gif"     ></P>
70
71<h2>See Also</h2>
72<p class="reference">
73<A href="./WPADStatus.html">WPADStatus</A>
74</p>
75
76<H2>Revision History</H2>
77<P>
782008/03/17 Added the guaranteed hardware play value.<br>2006/08/15 Changed the API. Added circular clamping and figures.<br>2006/06/19 Renamed the external extension controllers, deleted descriptions related to the standard GameCube controller, and removed portions specific to the C Stick from the figures.<br>2005/11/10 Initial version.<br>
79</p>
80
81<hr><p>CONFIDENTIAL</p></body>
82</html>