port-work; won't compile or even work
[ppcskel.git] / input.h
1 /*
2         BootMii - a Free Software replacement for the Nintendo/BroadOn bootloader.
3         Requires mini.
4
5 Copyright (C) 2009              Andre Heider "dhewg" <dhewg@wiibrew.org>
6 Copyright (C) 2009              John Kelley <wiidev@kelley.ca>
7 Copyright (C) 2009              bLAStY <blasty@bootmii.org>
8
9 # This code is licensed to you under the terms of the GNU GPL, version 2;
10 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
11 */
12
13 #ifndef __INPUT_H__
14 #define __INPUT_H__
15
16 #define PAD_LEFT  0x0001
17 #define PAD_RIGHT 0x0002
18 #define PAD_DOWN  0x0004
19 #define PAD_UP    0x0008
20 #define PAD_Z     0x0010
21 #define PAD_RS    0x0020
22 #define PAD_LS    0x0040
23 //    unused      0x0080
24 #define PAD_A     0x0100
25 #define PAD_B     0x0200
26 #define PAD_X     0x0400
27 #define PAD_Y     0x0800
28 #define PAD_START 0x1000
29 #define PAD_ANY   0x1F7F
30
31 #define GPIO_POWER      PAD_RIGHT
32 #define GPIO_RESET      PAD_A
33 #define GPIO_EJECT      PAD_START
34
35 typedef struct {
36         u16 btns_held;
37         u16 btns_up;
38         u16 btns_down;
39                 s8 x, y, cx, cy;
40                 u8 l, r;
41 } GC_Pad;
42
43 void input_init(void);
44
45 u16 pad_read(GC_Pad *pad, int chan);
46 u16 gpio_read(void);
47
48 u16 input_read(void);
49 u16 input_wait(void);
50
51 #endif
52