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 http-equiv="Content-Style-Type" content="text/css"> 6<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 7<title>KPADRead</title> 8</head> 9 10<body> 11 12<h1>KPADRead</h1> 13 14<h2>Syntax</h2> 15<dl><dd><pre class="construction"> 16#include <revolution/kpad.h> 17 18s32 KPADRead( s32 chan, KPADStatus samplingBufs[], u32 length ); 19</pre></dd></dl> 20 21<h2>Arguments</h2> 22<TABLE class="arguments" border="1" > 23 <TBODY> 24 <TR> 25 <TH>chan</TH> 26 <TD>One of the <code>WPAD_CHAN<i>n</i></code> values.</TD> 27 </TR> 28 <TR> 29 <TH>samplingBufs</TH> 30 <TD>Pointer to the <a href="./KPADStatus.html"><code>KPADStatus</code></a> structure.</TD> 31 </TR> 32 <TR> 33 <TH>length</TH> 34 <TD>Maximum number of data sets to store. If you use the <a href="./KPADInit.html"><CODE>KPADInit</CODE></a> function, this number cannot exceed <code>KPAD_RING_BUFS</code>. If you use the <a href="./KPADInitEx.html"><CODE>KPADInitEx</CODE></a> function, this value cannot exceed the sum of <code>KPAD_RING_BUFS</code> and one-quarter the array length passed to the <a href="./KPADInitEx.html"><CODE>KPADInitEx</CODE></a> function.</TD> 35 </TR> 36 </TBODY> 37</TABLE> 38 39<h2>Return Values</h2> 40<p>Returns the number of data sets that are stored.</p> 41 42<H2>Description</H2> 43<p> 44This function reads data in the <a href="./KPADStatus.html"><CODE>KPADStatus</CODE></a> structure type for each controller channel. We have assumed that this function will be called for each game frame. The buffer specified by the argument stores, from newest to oldest, the data sampled from the previous call's time to the current call's time. (In other words, the newest data is always stored at the beginning of the buffer.) However, in the case of button information only, if the button processing method obtained using the <CODE>KPADGetButtonProcMode</CODE> function is <CODE>KPAD_BUTTON_PROC_MODE_LOOSE</CODE>, only the most recent values are accessed when the <CODE>KPADRead</CODE> or <CODE>KPADReadEx</CODE> functions are called, and those values are copied into all the current-frame sampling buffers. 45</p> 46<p> 47The buffer specified by <SPAN class="argument">samplingBufs</SPAN> is sometimes used internally as a work area. Because of this, it is possible for buffer contents to be overwritten even when there was no data. 48</p> 49 50<h2>See Also</h2> 51<p class="reference"> 52<a href="./KPADStatus.html"><CODE>KPADStatus</CODE></a> 53</p> 54 55<H2>Revision History</H2> 56<P> 572008/06/13 Revised the explanation of <SPAN class="argument">length</SPAN>. Added explanation of the differences caused by different button processing methods.<br>2008/06/03 Deleted error codes. <br>2008/04/17 Revised the description of <SPAN class="argument">length</SPAN>. Added error codes.<br>2006/10/25 Revised the description to match KPAD version 2.<br>2006/08/xx Added a link under <B>See Also</B>.<br>2006/03/01 Initial version.<br> 58</P> 59 60<hr><p>CONFIDENTIAL</p></body> 61</html>