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 name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>DEMO Pad</title>
10</head>
11
12<body>
13
14<h1 align="left">DEMO Pad Functions</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;demo.h&gt;
19
20// main function prototypes
21extern void     DEMOPadInit( void );
22extern void     DEMOPadRead( void );
23
24// inline functions for getting each component
25inline u16 DEMOPadGetButton(u32 i);
26inline u16 DEMOPadGetButtonUp(u32 i);
27inline u16 DEMOPadGetButtonDown(u32 i);
28inline u16 DEMOPadGetDirs(u32 i);
29inline u16 DEMOPadGetDirsNew(u32 i);
30inline u16 DEMOPadGetDirsReleased(u32 i);
31inline s8  DEMOPadGetStickX(u32 i);
32inline s8  DEMOPadGetStickY(u32 i);
33inline s8  DEMOPadGetSubStickX(u32 i);
34inline s8  DEMOPadGetSubStickY(u32 i);
35inline u8  DEMOPadGetTriggerL(u32 i);
36inline u8  DEMOPadGetTriggerR(u32 i);
37inline u8  DEMOPadGetAnalogA(u32 i);
38inline u8  DEMOPadGetAnalogB(u32 i);
39inline s8  DEMOPadGetErr(u32 i);
40</pre></dd></dl>
41
42<h2>Arguments</h2>
43<TABLE class="arguments" border="1" >
44  <tr>
45<TH>i</TH>
46<TD>Specifies Controller to read. The first Controller is 0, the second Controller is 1, etc.</TD>
47  </tr>
48</TABLE>
49
50<h2>Return Values</h2>
51<TABLE class="arguments" border="1" >
52  <tr>
53<TH>u16 (button)</TH>
54<TD>Bit field that indicates the button state. Refer to <CODE>&lt;revolution/pad.h&gt;</CODE> for bit field names.</TD>
55  </tr>
56  <tr>
57<TH>u16 (dir)</TH>
58<TD>Bit field that specifies the directional state of the stick. Refer to <CODE>&lt;demo.h&gt;</CODE> for bit field names.</TD>
59  </tr>
60  <tr>
61<TH>s8&nbsp; (stick)</TH>
62<TD>Analog value for the stick position.</TD>
63  </tr>
64  <tr>
65<TH>u8</TH>
66<TD>Analog value that indicates how long the trigger or analog button has been pressed.</TD>
67  </tr>
68  <tr>
69<TH>s8&nbsp; (DEMOPadGetErr)</TH>
70<TD>&lt;A <CODE>PAD_ERR*</CODE> value specified in <CODE>&lt;revolution/pad.h&gt;</CODE>.</TD>
71  </tr>
72</TABLE>
73
74<H2>Description</H2>
75<P>The DEMO Pad library provides a means for reading Controller input.&nbsp;</P>
76<P>The <code>DEMOPadInit</code> function initializes the DEMO Pad system.</P>
77<P>The <code>DEMOPadRead</code> function is used to sample the current complete set of Controller inputs. Once a sample has been read, the individual values can be examined using inline functions.</P>
78<P>The inline functions return the state of the various Controller inputs. Each function takes an argument that specifies the Controller to be examined: the first Controller is 0, the second Controller is 1, etc. Some functions represent only the current Controller state, while others specify whether there are any transitions between the current and past sample. The button-related functions return a bit field with a bit that specifies each button state (not active = 0, active = 1). The fields are defined in <CODE>&lt;revolution/pad.h&gt;</CODE>. The direction-related functions return a different bit field that is defined in <CODE>&lt;demo.h&gt;</CODE>. For these functions, the stick input is digitized into primary directions (up, down, left, right).</P>
79
80<H3>Example Program</H3>
81<P>(TBA)</P>
82
83<h2>See Also</h2>
84<p class="reference">
85<a target="contents" href="../pad/toc.html">GameCube Controller (PAD)</a>
86</p>
87
88<H2>Revision History</H2>
89<P>
902006/03/01 Initial version.<br>
91</P>
92
93<hr><p>CONFIDENTIAL</p></body>
94</html>