SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
pad.h
Go to the documentation of this file.
1
#ifndef _DOLPHIN_PAD_H_
2
#define _DOLPHIN_PAD_H_
3
4
#include <
dolphin/types.h
>
5
6
#define PAD_SPEC_0 0
7
#define PAD_SPEC_1 1
8
#define PAD_SPEC_2 2
9
#define PAD_SPEC_3 3
10
#define PAD_SPEC_4 4
11
#define PAD_SPEC_5 5
12
13
#define PAD_MOTOR_STOP 0
14
#define PAD_MOTOR_RUMBLE 1
15
#define PAD_MOTOR_STOP_HARD 2
16
17
#define PAD_CHAN0_BIT 0x80000000
18
#define PAD_CHAN1_BIT 0x40000000
19
#define PAD_CHAN2_BIT 0x20000000
20
#define PAD_CHAN3_BIT 0x10000000
21
22
#define PAD_MAX_CONTROLLERS 4
23
24
#define PAD_BUTTON_LEFT (1 << 0)
// 0x0001
25
#define PAD_BUTTON_RIGHT (1 << 1)
// 0x0002
26
#define PAD_BUTTON_DOWN (1 << 2)
// 0x0004
27
#define PAD_BUTTON_UP (1 << 3)
// 0x0008
28
#define PAD_TRIGGER_Z (1 << 4)
// 0x0010
29
#define PAD_TRIGGER_R (1 << 5)
// 0x0020
30
#define PAD_TRIGGER_L (1 << 6)
// 0x0040
31
#define PAD_BUTTON_A (1 << 8)
// 0x0100
32
#define PAD_BUTTON_B (1 << 9)
// 0x0200
33
#define PAD_BUTTON_X (1 << 10)
// 0x0400
34
#define PAD_BUTTON_Y (1 << 11)
// 0x0800
35
#define PAD_BUTTON_MENU (1 << 12)
// 0x1000
36
#define PAD_BUTTON_START (1 << 12)
// 0x1000
37
#define PAD_STICK_UP (1 << 16)
// 0x10000
38
#define PAD_STICK_DOWN (1 << 17)
// 0x20000
39
#define PAD_STICK_LEFT (1 << 18)
// 0x40000
40
#define PAD_STICK_RIGHT (1 << 19)
// 0x80000
41
#define PAD_SUBSTICK_UP (1 << 20)
// 0x100000
42
#define PAD_SUBSTICK_DOWN (1 << 21)
// 0x200000
43
#define PAD_SUBSTICK_LEFT (1 << 22)
// 0x400000
44
#define PAD_SUBSTICK_RIGHT (1 << 23)
// 0x800000
45
#define PAD_TRIGGER_LR (1 << 31)
// 0x80000000
46
#define PAD_CONFIRM (1ULL << 32)
// 0x100000000
47
#define PAD_CANCEL (1ULL << 33)
// 0x200000000
48
#define PAD_LR_START (1ULL << 34)
// 0x400000000
49
#define PAD_LRA_START (1ULL << 35)
// 0x800000000
50
#define PAD_ANY_UP (1ULL << 36)
// 0x1000000000
51
#define PAD_ANY_DOWN (1ULL << 37)
// 0x2000000000
52
#define PAD_ANY_LEFT (1ULL << 38)
// 0x4000000000
53
#define PAD_ANY_RIGHT (1ULL << 39)
// 0x8000000000
54
55
#define PAD_ERR_NONE 0
56
#define PAD_ERR_NO_CONTROLLER -1
57
#define PAD_ERR_NOT_READY -2
58
#define PAD_ERR_TRANSFER -3
59
60
#define RES_WIRELESS_LITE 0x40000
61
62
typedef
struct
PADStatus
{
63
/*0x00*/
u16
button
;
64
/*0x02*/
s8
stickX
;
65
/*0x03*/
s8
stickY
;
66
/*0x04*/
s8
substickX
;
67
/*0x05*/
s8
substickY
;
68
/*0x06*/
u8
triggerLeft
;
69
/*0x07*/
u8
triggerRight
;
70
/*0x08*/
u8
analogA
;
71
/*0x09*/
u8
analogB
;
72
/*0x0A*/
s8
err
;
73
}
PADStatus
;
74
75
// PAD.c
76
int
PADReset
(
unsigned
long
mask
);
77
BOOL
PADRecalibrate
(
u32
mask
);
78
BOOL
PADInit
();
79
u32
PADRead
(
struct
PADStatus
* status);
80
void
PADSetSamplingRate
(
unsigned
long
msec);
81
void
__PADTestSamplingRate
(
unsigned
long
tvmode);
82
void
PADControlAllMotors
(
const
u32
* commandArray);
83
void
PADControlMotor
(
s32
chan,
u32
command);
84
void
PADSetSpec
(
u32
spec);
85
unsigned
long
PADGetSpec
();
86
int
PADGetType
(
long
chan,
unsigned
long
* type);
87
BOOL
PADSync
(
void
);
88
void
PADSetAnalogMode
(
u32
mode);
89
BOOL
__PADDisableRecalibration
(
int
arg0);
90
void
SIRefreshSamplingRate
(
void
);
91
92
// Padclamp.c
93
void
PADClamp
(
PADStatus
* status);
94
95
#endif
types.h
BOOL
int BOOL
Definition
types.h:20
s8
signed char s8
Definition
types.h:4
u32
unsigned long u32
Definition
types.h:9
u16
unsigned short int u16
Definition
types.h:7
s32
signed long s32
Definition
types.h:8
u8
unsigned char u8
Definition
types.h:5
PADControlAllMotors
void PADControlAllMotors(const u32 *commandArray)
PADRead
u32 PADRead(struct PADStatus *status)
SIRefreshSamplingRate
void SIRefreshSamplingRate(void)
PADGetType
int PADGetType(long chan, unsigned long *type)
PADSync
BOOL PADSync(void)
PADControlMotor
void PADControlMotor(s32 chan, u32 command)
PADInit
BOOL PADInit()
PADSetSamplingRate
void PADSetSamplingRate(unsigned long msec)
PADReset
int PADReset(unsigned long mask)
PADRecalibrate
BOOL PADRecalibrate(u32 mask)
__PADDisableRecalibration
BOOL __PADDisableRecalibration(int arg0)
PADSetSpec
void PADSetSpec(u32 spec)
PADClamp
void PADClamp(PADStatus *status)
PADGetSpec
unsigned long PADGetSpec()
PADSetAnalogMode
void PADSetAnalogMode(u32 mode)
__PADTestSamplingRate
void __PADTestSamplingRate(unsigned long tvmode)
mask
int mask
Definition
state.c:130
PADStatus
Definition
pad.h:62
PADStatus::triggerLeft
u8 triggerLeft
Definition
pad.h:68
PADStatus::stickY
s8 stickY
Definition
pad.h:65
PADStatus::substickY
s8 substickY
Definition
pad.h:67
PADStatus::stickX
s8 stickX
Definition
pad.h:64
PADStatus::analogA
u8 analogA
Definition
pad.h:70
PADStatus::triggerRight
u8 triggerRight
Definition
pad.h:69
PADStatus::button
u16 button
Definition
pad.h:63
PADStatus::analogB
u8 analogB
Definition
pad.h:71
PADStatus::substickX
s8 substickX
Definition
pad.h:66
PADStatus::err
s8 err
Definition
pad.h:72
extern
dolphin
include
dolphin
pad.h
Generated by
1.17.0