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 16<h2>C Specification</h2> 17 18<dl> 19 <dd> 20 <pre> 21 <code> 22#include <revolution/wpad.h> 23 24#define WPAD_CHAN0 0 25#define WPAD_CHAN1 1 26#define WPAD_CHAN2 2 27#define WPAD_CHAN3 3 28 29#define WPAD_STICK_CLAMP_OCTA_WITH_PLAY 0 30#define WPAD_STICK_CLAMP_OCTA_WITHOUT_PLAY 1 31#define WPAD_STICK_CLAMP_CIRCLE_WITH_PLAY 2 32#define WPAD_STICK_CLAMP_CIRCLE_WITHOUT_PLAY 3 33 34void WPADClampStick( s32 chan, void *status, u32 type ); 35 </code> 36 </pre> 37 </dd> 38</dl> 39 40<h2>Arguments</h2> 41<TABLE border="1"> 42 <TBODY> 43 <TR> 44<TD><CODE><b><i>chan</i></b></CODE></TD> 45<TD>One of <code>WPAD_CHAN*</code>.</TD> 46 </TR> 47 <TR> 48<TD><code><b><i>status</i></b></code></TD> 49<TD>Pointer to the <a href="./WPADStatus.html"><code>WPADStatus</code></a> structure to be clamped. If the err member stores WPAD_ERR_NONE, the analog stick input value is clamped according to the algorithm below.</TD> 50 </TR> 51 <TR> 52<TD><CODE><b><i>type</i></b></CODE></TD> 53<TD>One of <code>WPAD_STICK_CLAMP_*</code>.</TD> 54 </TR> 55 </TBODY> 56</TABLE> 57<h2>Return Values</h2> 58<p>None.</p> 59 60<H2>Description</H2> 61<p>This API clamps the input of the analog stick of a Nunchuk unit or a classic controller unit.</p> 62<p> 63The algorithm for clamping the analog stick can be specified using <code>type</code> 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 deadzone 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 deadzone. More accurate movement in the diagonal direction that straddles each axis can be obtained when the deadzone is not clamped. 64</p> 65 66<P><IMG src="WPADClampStickOctaPlay.gif" alt="WPADClampStickOctaPlay.gif" width="585" height="360"></P> 67<P><IMG src="WPADClampStickOcta.gif" alt="WPADClampStickOcta.gif" width="400" height="360"></P> 68<P><IMG src="WPADClampStickCirclePlay.gif" alt="WPADClampStickCirclePlay.gif" width="585" height="360"></P> 69<P><IMG src="WPADClampStickCircle.gif" alt="WPADClampStickCircle.gif" width="400" height="360"></P> 70<P><IMG src="WPADClampStickOctaPlayClassic.gif" alt="WPADClampStickOctaPlayClassic.gif" width="585" height="390"></P> 71<P><IMG src="WPADClampStickOctaClassic.gif" alt="WPADClampStickOctaClassic.gif" width="535" height="360"></P> 72<P><IMG src="WPADClampStickCirclePlayClassic.gif" alt="WPADClampStickCirclePlayClassic.gif" width="585" height="390"></P> 73<P><IMG src="WPADClampStickCircleClassic.gif" alt="WPADClampStickCircleClassic.gif" width="400" height="360"></P> 74 75<h2>See Also</h2> 76<p> 77<A href="./toc.html" target="contents"><CODE>WPAD Functions</CODE></A><br> <A href="./WPADFSStatus.html"><CODE>WPADFSStatus</CODE></A><br> <A href="./WPADCLStatus.html"><CODE>WPADCLStatus</CODE></A><br> 78</p> 79 80<H2>Revision History</H2> 81<P> 8208/15/2006 Changed the API, added circular clamping and added diagrams.<br> 06/19/2006 Changed the name of the External Extension Controller, deleted a description related to standard GameCube controllers from the text, and deleted parts related to the sub-stick from the figure.<br>11/10/2005 Initial version.<br> 83</p> 84 85<hr> 86<P>CONFIDENTIAL</p> 87</BODY> 88</HTML>