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<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<TITLE>SISetSamplingRate</TITLE> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9</HEAD> 10<BODY> 11<H1>SISetSamplingRate</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/os/OSSerial.h> 16 17void SISetSamplingRate(u32 msec); 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH>msec</TH> 25<TD>Sampling rate of 11 msec or less. Specifying 0 initializes the sampling rate so that the game program can obtain the most recent controller status when <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> is called immediately after each vertical retrace interrupt (default).</TD> 26 </TR> 27 </TBODY> 28</TABLE> 29 30<H2>Return Values</H2> 31<P>None.</P> 32 33<H2>Description</H2> 34<P>This function sets the sampling rate of the GameCube Controller Sockets (Controller Sockets) in units of milliseconds. <B>Note:</B> All of the attached controller devices share the same sampling rate setting.</P> 35<P>Since the sampling rate is controlled by the video clock, the sampling rate actually set differs from the one specified. The following table shows the average sampling rate on all TV modes. Note each interval is guaranteed to be less than the specified sampling rate.</P> 36<TABLE class="arguments" border="1" > 37 <TBODY> 38 <TR> 39 <TD bgcolor="#C0C0C0" width="15%"><STRONG>Argument:</STRONG><SPAN class="argument">msec</SPAN></TD> 40 <TD bgcolor="#C0C0C0" width="40%"><STRONG>60Hz:</STRONG>NTSC, EURGB60 [msec]</TD> 41 <TD bgcolor="#C0C0C0" width="40%"><STRONG>50Hz:</STRONG><STRONG>PAL [msec]</STRONG></TD> 42 </TR> 43 <TR> 44 <TD>1</TD> 45 <TD>0.93</TD> 46 <TD>0.95</TD> 47 </TR> 48 <TR> 49 <TD>2</TD> 50 <TD>1.86</TD> 51 <TD>1.82</TD> 52 </TR> 53 <TR> 54 <TD>3</TD> 55 <TD>2.79</TD> 56 <TD>2.86</TD> 57 </TR> 58 <TR> 59 <TD>4</TD> 60 <TD>3.34</TD> 61 <TD>3.34</TD> 62 </TR> 63 <TR> 64 <TD>5</TD> 65 <TD>4.18</TD> 66 <TD>4.00</TD> 67 </TR> 68 <TR> 69 <TD>6</TD> 70 <TD>5.57</TD> 71 <TD>5.00</TD> 72 </TR> 73 <TR> 74 <TD>7</TD> 75 <TD>5.57</TD> 76 <TD>6.68</TD> 77 </TR> 78 <TR> 79 <TD>8</TD> 80 <TD>5.57</TD> 81 <TD>6.68</TD> 82 </TR> 83 <TR> 84 <TD>9</TD> 85 <TD>8.36</TD> 86 <TD>6.68</TD> 87 </TR> 88 <TR> 89 <TD>10</TD> 90 <TD>8.36</TD> 91 <TD>6.68</TD> 92 </TR> 93 <TR> 94 <TD>11</TD> 95 <TD>8.36</TD> 96 <TD>10.01</TD> 97 </TR> 98 </TBODY> 99</TABLE> 100<P><strong>Note for PAD library:</strong> If <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> is called at an interval shorter than the one specified by <CODE>SISetSamplingRate</CODE>, only the first <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> returns an accurate value. The subsequent <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> calls return <CODE>PAD_ERR_TRANSFER</CODE> until the next cycle.</P> 101<P>With the WaveBird Controller, the transfer cycle for sending controller information via the controller port (serial interface) is approximately 2.2 msec. Thus, with the WaveBird, setting the sampling rate at a value higher than this transfer cycle will only result in getting the same input. Even given the same input values, <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> will not fail if <A href="../pad/PADRead.html"><CODE>PADRead</CODE></A> is called in cycles longer than the set sampling cycle.</P> 102<p><font color="ff0000"><b>Important:</b> Do not use the <CODE>SISetSamplingRate</CODE> function if you are using the WPAD library for UI Tool version 3 (<CODE>wpadEmu.a</CODE> and <CODE>wpadEmuD.a</CODE>).</font></p> 103 104<H2>See Also</H2> 105<P class="reference"> 106<A href="../os/toc.html" target="contents">OS Functions</A>, 107<A href="../pad/toc.html" target="contents">PAD Functions</A>, 108<A href="../pad/PADRead.html">PADRead</A> 109</P> 110 111<H2>Revision History</H2> 112<P> 1132008/06/19 Removed mention of MPAL.<br>2006/03/01 Initial version.<br> 114</P> 115 116<hr><p>CONFIDENTIAL</p></body> 117</HTML>