-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpad.h
57 lines (43 loc) · 1.14 KB
/
pad.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
52
53
54
55
/* pad.h - header for pad class */
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libetc.h>
#include <libpad.h>
#ifndef PSX_PAD_INCLUDED
#define PSX_PAD_INCLUDED
/* modified from Orion's psx library */
#define PadUp PADLup
#define PadDown PADLdown
#define PadLeft PADLleft
#define PadRight PADLright
#define PadTriangle PADRup
#define PadCross PADRdown
#define PadSquare PADRleft
#define PadCircle PADRright
#define PadL1 PADL1
#define PadL2 PADL2
#define PadR1 PADR1
#define PadR2 PADR2
#define PadStart PADstart
#define PadSelect PADselect
class PSX_Pad
{
public:
// constructor
PSX_Pad(u_int port);
void read(void); // read pad data
bool checkHeld( u_int button ); // returns true if sent button is clicked
bool checkPressed( u_int button ); // returns true if sent button is held down
private:
int port; // is it controller 1 or 2?
int padInfo; // contains read in pad information
/* these 2 taken from Orion's psx lib
* used for pad info manipulation */
int SysPad;
int SysPadT;
};
#endif