\hypertarget{input_8h}{
\section{libbroadway/include/input.h File Reference}
\label{input_8h}\index{libbroadway/include/input.h@{libbroadway/include/input.h}}
}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structgc__pad__t}{gc\_\-pad\_\-t}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{input_8h_adaf081f3dd52e90153df31490f68f96d}{PAD\_\-LEFT}~(1 $<$$<$  0)
\item 
\#define \hyperlink{input_8h_a6fd5dddc97219412ab1c4483ce144aef}{PAD\_\-RIGHT}~(1 $<$$<$  1)
\item 
\#define \hyperlink{input_8h_a69326cdea2530a1bb929dd121a852010}{PAD\_\-DOWN}~(1 $<$$<$  2)
\item 
\#define \hyperlink{input_8h_acdb66227c1cd67fa1c5a98548c75b504}{PAD\_\-UP}~(1 $<$$<$  3)
\item 
\#define \hyperlink{input_8h_a315c06b79f6ce6ccb6b0d322bc8bf1a3}{PAD\_\-Z}~(1 $<$$<$  4)
\item 
\#define \hyperlink{input_8h_a3296712b1a129411581d045817049d97}{PAD\_\-RS}~(1 $<$$<$  5)
\item 
\#define \hyperlink{input_8h_ad8d36e94c71b59b282098dde5351b4dc}{PAD\_\-LS}~(1 $<$$<$  6)
\item 
\#define \hyperlink{input_8h_a0189b1aa39b1b7d091f82918202b1be7}{PAD\_\-A}~(1 $<$$<$  8)
\item 
\#define \hyperlink{input_8h_ac4aa17858ec1e696517821e720d4d28a}{PAD\_\-B}~(1 $<$$<$  9)
\item 
\#define \hyperlink{input_8h_a4fbe54d91d53aabbbcec17706f6570ed}{PAD\_\-X}~(1 $<$$<$ 10)
\item 
\#define \hyperlink{input_8h_a5fb02b736c0c917dc78a96516bf2aac2}{PAD\_\-Y}~(1 $<$$<$ 11)
\item 
\#define \hyperlink{input_8h_a1754f0c837e05e32d0850bb1f427c336}{PAD\_\-START}~(1 $<$$<$ 12)
\item 
\#define \hyperlink{input_8h_acb26f179368869643e51e5508a4e3a7c}{PAD\_\-ANY}
\item 
\#define \hyperlink{input_8h_a51069ffb66fc27e24fbd0fd34314486f}{GCPAD\_\-0}~(0)
\item 
\#define \hyperlink{input_8h_a26ce38855896edfd1a2464afbc0b0392}{GCPAD\_\-1}~(1)
\item 
\#define \hyperlink{input_8h_a48a9d95ffe8724901e5d90a8329fbc9d}{GCPAD\_\-2}~(2)
\item 
\#define \hyperlink{input_8h_a7666b28331c9dc76ae6b6be256447ebb}{GCPAD\_\-3}~(3)
\item 
\#define \hyperlink{input_8h_adc98e2027544d8b503afa07a50980fc1}{GCPAD\_\-ALL}~(4)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{input_8h_ace0599fcfcdb5e4c00f42ef202cadc9a}{input\_\-initialize} (void)
\begin{DoxyCompactList}\small\item\em Initialize the input subsystem. \item\end{DoxyCompactList}\item 
int \hyperlink{input_8h_a7d2a6e84fc4f021d71bd8439a154974f}{input\_\-shutdown} (void)
\begin{DoxyCompactList}\small\item\em Shut down the input subsystem. \item\end{DoxyCompactList}\item 
u16 \hyperlink{input_8h_abb5492f404f4c04386c764465aa8c9a6}{pad\_\-read} (\hyperlink{structgc__pad__t}{gc\_\-pad\_\-t} $\ast$pad, int chan)
\begin{DoxyCompactList}\small\item\em Reads pad data. \item\end{DoxyCompactList}\item 
void \hyperlink{input_8h_adc703522c9cc48d605809eb002f4782e}{pad\_\-rumble} (int chan, BOOL on)
\begin{DoxyCompactList}\small\item\em Turns on/off rumble on GC pad. \item\end{DoxyCompactList}\item 
u16 \hyperlink{input_8h_aaa7adaf0eaf9bcd97dedb7b1a4ec3a7e}{input\_\-wait} (void)
\begin{DoxyCompactList}\small\item\em Waits until a button is pressed on any pad. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Performs all input management (front panel buttons and GC pad) 

\subsection{Define Documentation}
\hypertarget{input_8h_a51069ffb66fc27e24fbd0fd34314486f}{
\index{input.h@{input.h}!GCPAD\_\-0@{GCPAD\_\-0}}
\index{GCPAD\_\-0@{GCPAD\_\-0}!input.h@{input.h}}
\subsubsection[{GCPAD\_\-0}]{\setlength{\rightskip}{0pt plus 5cm}\#define GCPAD\_\-0~(0)}}
\label{input_8h_a51069ffb66fc27e24fbd0fd34314486f}
First GC pad \hypertarget{input_8h_a26ce38855896edfd1a2464afbc0b0392}{
\index{input.h@{input.h}!GCPAD\_\-1@{GCPAD\_\-1}}
\index{GCPAD\_\-1@{GCPAD\_\-1}!input.h@{input.h}}
\subsubsection[{GCPAD\_\-1}]{\setlength{\rightskip}{0pt plus 5cm}\#define GCPAD\_\-1~(1)}}
\label{input_8h_a26ce38855896edfd1a2464afbc0b0392}
Second GC pad \hypertarget{input_8h_a48a9d95ffe8724901e5d90a8329fbc9d}{
\index{input.h@{input.h}!GCPAD\_\-2@{GCPAD\_\-2}}
\index{GCPAD\_\-2@{GCPAD\_\-2}!input.h@{input.h}}
\subsubsection[{GCPAD\_\-2}]{\setlength{\rightskip}{0pt plus 5cm}\#define GCPAD\_\-2~(2)}}
\label{input_8h_a48a9d95ffe8724901e5d90a8329fbc9d}
Third GC pad \hypertarget{input_8h_a7666b28331c9dc76ae6b6be256447ebb}{
\index{input.h@{input.h}!GCPAD\_\-3@{GCPAD\_\-3}}
\index{GCPAD\_\-3@{GCPAD\_\-3}!input.h@{input.h}}
\subsubsection[{GCPAD\_\-3}]{\setlength{\rightskip}{0pt plus 5cm}\#define GCPAD\_\-3~(3)}}
\label{input_8h_a7666b28331c9dc76ae6b6be256447ebb}
Fourth GC pad \hypertarget{input_8h_adc98e2027544d8b503afa07a50980fc1}{
\index{input.h@{input.h}!GCPAD\_\-ALL@{GCPAD\_\-ALL}}
\index{GCPAD\_\-ALL@{GCPAD\_\-ALL}!input.h@{input.h}}
\subsubsection[{GCPAD\_\-ALL}]{\setlength{\rightskip}{0pt plus 5cm}\#define GCPAD\_\-ALL~(4)}}
\label{input_8h_adc98e2027544d8b503afa07a50980fc1}
All GC pads \hypertarget{input_8h_a0189b1aa39b1b7d091f82918202b1be7}{
\index{input.h@{input.h}!PAD\_\-A@{PAD\_\-A}}
\index{PAD\_\-A@{PAD\_\-A}!input.h@{input.h}}
\subsubsection[{PAD\_\-A}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-A~(1 $<$$<$  8)}}
\label{input_8h_a0189b1aa39b1b7d091f82918202b1be7}
A button \hypertarget{input_8h_acb26f179368869643e51e5508a4e3a7c}{
\index{input.h@{input.h}!PAD\_\-ANY@{PAD\_\-ANY}}
\index{PAD\_\-ANY@{PAD\_\-ANY}!input.h@{input.h}}
\subsubsection[{PAD\_\-ANY}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-ANY}}
\label{input_8h_acb26f179368869643e51e5508a4e3a7c}
{\bfseries Value:}
\begin{DoxyCode}
(PAD_LEFT | PAD_RIGHT | PAD_DOWN | PAD_UP | \
                         PAD_Z    | PAD_RS    | PAD_LS   | PAD_START | \
                         PAD_A    | PAD_B     | PAD_X    | PAD_Y)
\end{DoxyCode}
A mask that matches all buttons \hypertarget{input_8h_ac4aa17858ec1e696517821e720d4d28a}{
\index{input.h@{input.h}!PAD\_\-B@{PAD\_\-B}}
\index{PAD\_\-B@{PAD\_\-B}!input.h@{input.h}}
\subsubsection[{PAD\_\-B}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-B~(1 $<$$<$  9)}}
\label{input_8h_ac4aa17858ec1e696517821e720d4d28a}
B button \hypertarget{input_8h_a69326cdea2530a1bb929dd121a852010}{
\index{input.h@{input.h}!PAD\_\-DOWN@{PAD\_\-DOWN}}
\index{PAD\_\-DOWN@{PAD\_\-DOWN}!input.h@{input.h}}
\subsubsection[{PAD\_\-DOWN}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-DOWN~(1 $<$$<$  2)}}
\label{input_8h_a69326cdea2530a1bb929dd121a852010}
Down D-\/Pad button \hypertarget{input_8h_adaf081f3dd52e90153df31490f68f96d}{
\index{input.h@{input.h}!PAD\_\-LEFT@{PAD\_\-LEFT}}
\index{PAD\_\-LEFT@{PAD\_\-LEFT}!input.h@{input.h}}
\subsubsection[{PAD\_\-LEFT}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-LEFT~(1 $<$$<$  0)}}
\label{input_8h_adaf081f3dd52e90153df31490f68f96d}
Left D-\/Pad button \hypertarget{input_8h_ad8d36e94c71b59b282098dde5351b4dc}{
\index{input.h@{input.h}!PAD\_\-LS@{PAD\_\-LS}}
\index{PAD\_\-LS@{PAD\_\-LS}!input.h@{input.h}}
\subsubsection[{PAD\_\-LS}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-LS~(1 $<$$<$  6)}}
\label{input_8h_ad8d36e94c71b59b282098dde5351b4dc}
Left shoulder button \hypertarget{input_8h_a6fd5dddc97219412ab1c4483ce144aef}{
\index{input.h@{input.h}!PAD\_\-RIGHT@{PAD\_\-RIGHT}}
\index{PAD\_\-RIGHT@{PAD\_\-RIGHT}!input.h@{input.h}}
\subsubsection[{PAD\_\-RIGHT}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-RIGHT~(1 $<$$<$  1)}}
\label{input_8h_a6fd5dddc97219412ab1c4483ce144aef}
Right D-\/Pad button \hypertarget{input_8h_a3296712b1a129411581d045817049d97}{
\index{input.h@{input.h}!PAD\_\-RS@{PAD\_\-RS}}
\index{PAD\_\-RS@{PAD\_\-RS}!input.h@{input.h}}
\subsubsection[{PAD\_\-RS}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-RS~(1 $<$$<$  5)}}
\label{input_8h_a3296712b1a129411581d045817049d97}
Right shoulder button \hypertarget{input_8h_a1754f0c837e05e32d0850bb1f427c336}{
\index{input.h@{input.h}!PAD\_\-START@{PAD\_\-START}}
\index{PAD\_\-START@{PAD\_\-START}!input.h@{input.h}}
\subsubsection[{PAD\_\-START}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-START~(1 $<$$<$ 12)}}
\label{input_8h_a1754f0c837e05e32d0850bb1f427c336}
Start button \hypertarget{input_8h_acdb66227c1cd67fa1c5a98548c75b504}{
\index{input.h@{input.h}!PAD\_\-UP@{PAD\_\-UP}}
\index{PAD\_\-UP@{PAD\_\-UP}!input.h@{input.h}}
\subsubsection[{PAD\_\-UP}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-UP~(1 $<$$<$  3)}}
\label{input_8h_acdb66227c1cd67fa1c5a98548c75b504}
Up D-\/Pad button \hypertarget{input_8h_a4fbe54d91d53aabbbcec17706f6570ed}{
\index{input.h@{input.h}!PAD\_\-X@{PAD\_\-X}}
\index{PAD\_\-X@{PAD\_\-X}!input.h@{input.h}}
\subsubsection[{PAD\_\-X}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-X~(1 $<$$<$ 10)}}
\label{input_8h_a4fbe54d91d53aabbbcec17706f6570ed}
X button \hypertarget{input_8h_a5fb02b736c0c917dc78a96516bf2aac2}{
\index{input.h@{input.h}!PAD\_\-Y@{PAD\_\-Y}}
\index{PAD\_\-Y@{PAD\_\-Y}!input.h@{input.h}}
\subsubsection[{PAD\_\-Y}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-Y~(1 $<$$<$ 11)}}
\label{input_8h_a5fb02b736c0c917dc78a96516bf2aac2}
Y button \hypertarget{input_8h_a315c06b79f6ce6ccb6b0d322bc8bf1a3}{
\index{input.h@{input.h}!PAD\_\-Z@{PAD\_\-Z}}
\index{PAD\_\-Z@{PAD\_\-Z}!input.h@{input.h}}
\subsubsection[{PAD\_\-Z}]{\setlength{\rightskip}{0pt plus 5cm}\#define PAD\_\-Z~(1 $<$$<$  4)}}
\label{input_8h_a315c06b79f6ce6ccb6b0d322bc8bf1a3}
Z button 

\subsection{Function Documentation}
\hypertarget{input_8h_ace0599fcfcdb5e4c00f42ef202cadc9a}{
\index{input.h@{input.h}!input\_\-initialize@{input\_\-initialize}}
\index{input\_\-initialize@{input\_\-initialize}!input.h@{input.h}}
\subsubsection[{input\_\-initialize}]{\setlength{\rightskip}{0pt plus 5cm}int input\_\-initialize (void)}}
\label{input_8h_ace0599fcfcdb5e4c00f42ef202cadc9a}


Initialize the input subsystem. 

Initializes the input subsystem, registers necessary IRQs, and all other required initialization tasks. \begin{DoxyReturn}{Returns}
If initialization was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{input_8h_a7d2a6e84fc4f021d71bd8439a154974f}{input\_\-shutdown()} 
\end{DoxySeeAlso}
\hypertarget{input_8h_a7d2a6e84fc4f021d71bd8439a154974f}{
\index{input.h@{input.h}!input\_\-shutdown@{input\_\-shutdown}}
\index{input\_\-shutdown@{input\_\-shutdown}!input.h@{input.h}}
\subsubsection[{input\_\-shutdown}]{\setlength{\rightskip}{0pt plus 5cm}int input\_\-shutdown (void)}}
\label{input_8h_a7d2a6e84fc4f021d71bd8439a154974f}


Shut down the input subsystem. 

Shuts down the input subsystem, unregisters the IRQs, and performs all other required shut down tasks. \begin{DoxyReturn}{Returns}
If shut down was successful, returns 1. Otherwise 0. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{input_8h_ace0599fcfcdb5e4c00f42ef202cadc9a}{input\_\-initialize()} 
\end{DoxySeeAlso}
\hypertarget{input_8h_aaa7adaf0eaf9bcd97dedb7b1a4ec3a7e}{
\index{input.h@{input.h}!input\_\-wait@{input\_\-wait}}
\index{input\_\-wait@{input\_\-wait}!input.h@{input.h}}
\subsubsection[{input\_\-wait}]{\setlength{\rightskip}{0pt plus 5cm}u16 input\_\-wait (void)}}
\label{input_8h_aaa7adaf0eaf9bcd97dedb7b1a4ec3a7e}


Waits until a button is pressed on any pad. 

\begin{DoxyReturn}{Returns}
The combined button states of all pads. 
\end{DoxyReturn}
\hypertarget{input_8h_abb5492f404f4c04386c764465aa8c9a6}{
\index{input.h@{input.h}!pad\_\-read@{pad\_\-read}}
\index{pad\_\-read@{pad\_\-read}!input.h@{input.h}}
\subsubsection[{pad\_\-read}]{\setlength{\rightskip}{0pt plus 5cm}u16 pad\_\-read ({\bf gc\_\-pad\_\-t} $\ast$ {\em pad}, \/  int {\em chan})}}
\label{input_8h_abb5492f404f4c04386c764465aa8c9a6}


Reads pad data. 

Reads data from the specified GC pad, and places it into a struct. 
\begin{DoxyParams}{Parameters}
\item[{\em pad}]pointer to the \hyperlink{structgc__pad__t}{gc\_\-pad\_\-t} for the pad data to go. \item[{\em chan}]which GC pad should be read. \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The button state. (the same as pad-\/$>$btns\_\-held) 
\end{DoxyReturn}
\hypertarget{input_8h_adc703522c9cc48d605809eb002f4782e}{
\index{input.h@{input.h}!pad\_\-rumble@{pad\_\-rumble}}
\index{pad\_\-rumble@{pad\_\-rumble}!input.h@{input.h}}
\subsubsection[{pad\_\-rumble}]{\setlength{\rightskip}{0pt plus 5cm}void pad\_\-rumble (int {\em chan}, \/  BOOL {\em on})}}
\label{input_8h_adc703522c9cc48d605809eb002f4782e}


Turns on/off rumble on GC pad. 


\begin{DoxyParams}{Parameters}
\item[{\em chan}]which GC pad should have rumble status changed. \item[{\em on}]if TRUE, turns on rumble. If FALSE, turns off rumble. \end{DoxyParams}
