summaryrefslogtreecommitdiffstats
path: root/main.h
blob: a4300d43f78a7d6443b056a4f014483c2fb87f78 (plain)
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
#ifndef MAIN_H
#define MAIN_H

/*
The Wii Remote has 11 buttons that are used as regular input devices: A, B (trigger), a 4-directional D-Pad, +, -, Home, 1, and 2.
These are reported as bits in a two-byte bitmask. These are the assignments, in big-endian order:

Bit 	Mask 	First Byte 	Second Byte
0 	0x01 	D-Pad Left 	Two
1 	0x02 	D-Pad Right 	One
2 	0x04 	D-Pad Down 	B
3 	0x08 	D-Pad Up 	A
4 	0x10 	Plus 		Minus
5 	0x20 	Other uses 	Other uses
6 	0x40 	Other uses 	Other uses
7 	0x80 	Unknown 	Home
*/

/* first byte */
#define DPAD_LEFT 0x01
#define DPAD_RIGHT 0x02
#define DPAD_DOWN 0x04
#define DPAD_UP 0x08
#define PLUS 0x10
#define OTHER0 0x20
#define OTHER1 0x40
#define UNKNOWN 0x80

/* second byte */
#define TWO 0x01
#define ONE 0x02
#define B 0x04
#define A 0x08
#define MINUS 0x10
#define OTHER2 0x20
#define OTHER3 0x40
#define HOME 0x80


#define MAX 40

#endif