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