Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
pad.h
Go to the documentation of this file.
1#ifndef PAD_H
2#define PAD_H
3
4#include "dolphin/types.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct OSContext OSContext;
11
12#define PAD_CHAN0_BIT 0x80000000
13#define PAD_CHAN1_BIT 0x40000000
14#define PAD_CHAN2_BIT 0x20000000
15#define PAD_CHAN3_BIT 0x10000000
16
17#define PAD_SPEC_0 0
18#define PAD_SPEC_1 1
19#define PAD_SPEC_2 2
20#define PAD_SPEC_3 3
21#define PAD_SPEC_4 4
22#define PAD_SPEC_5 5
23
24#define PAD_MOTOR_STOP 0
25#define PAD_MOTOR_RUMBLE 1
26#define PAD_MOTOR_STOP_HARD 2
27
28#define PAD_ERR_NONE 0
29#define PAD_ERR_NO_CONTROLLER -1
30#define PAD_ERR_NOT_READY -2
31#define PAD_ERR_TRANSFER -3
32
33#define PAD_BUTTON_LEFT 0x0001
34#define PAD_BUTTON_RIGHT 0x0002
35#define PAD_BUTTON_DOWN 0x0004
36#define PAD_BUTTON_UP 0x0008
37#define PAD_TRIGGER_Z 0x0010
38#define PAD_TRIGGER_R 0x0020
39#define PAD_TRIGGER_L 0x0040
40#define PAD_BUTTON_A 0x0100
41#define PAD_BUTTON_B 0x0200
42#define PAD_BUTTON_X 0x0400
43#define PAD_BUTTON_Y 0x0800
44#define PAD_BUTTON_MENU 0x1000
45#define PAD_BUTTON_START 0x1000
46
47typedef struct PADStatus {
48 /* 0x0 */ u16 button;
49 /* 0x2 */ s8 stick_x;
50 /* 0x3 */ s8 stick_y;
51 /* 0x4 */ s8 substick_x;
52 /* 0x5 */ s8 substick_y;
53 /* 0x6 */ u8 trigger_left;
54 /* 0x7 */ u8 trigger_right;
55 /* 0x8 */ u8 analog_a;
56 /* 0x9 */ u8 analog_b;
57 /* 0xA */ s8 error;
59
61
62BOOL PADInit(void);
63void PADSetAnalogMode(u32 mode);
64void PADSetSpec(u32 spec);
69void PADControlMotor(s32 channel, u32 command);
71
72extern u32 __PADSpec;
73
74#ifdef __cplusplus
75};
76#endif
77
78#endif /* PAD_H */
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static s32 status
Definition fstload.c:6
u32 __PADSpec
Definition Pad.c:374
BOOL PADRecalibrate(u32 mask)
Definition Pad.c:334
void PADControlMotor(s32 channel, u32 command)
Definition Pad.c:515
void PADClampCircle(PADStatus *status)
Definition Padclamp.c:163
void PADSetSpec(u32 spec)
Definition Pad.c:537
BOOL PADInit(void)
Definition Pad.c:377
void PADClamp(PADStatus *status)
Definition Padclamp.c:146
BOOL PADReset(u32 mask)
Definition Pad.c:306
u32 PADRead(PADStatus *status)
Definition Pad.c:411
void(* PADSamplingCallback)(void)
Definition pad.h:60
void PADSetAnalogMode(u32 mode)
Definition Pad.c:736
Definition OSContext.h:137
Definition pad.h:47
u8 analog_b
Definition pad.h:56
s8 substick_y
Definition pad.h:52
u16 button
Definition pad.h:48
u8 trigger_left
Definition pad.h:53
s8 stick_y
Definition pad.h:50
s8 error
Definition pad.h:57
u8 trigger_right
Definition pad.h:54
s8 substick_x
Definition pad.h:51
s8 stick_x
Definition pad.h:49
u8 analog_a
Definition pad.h:55
int BOOL
Definition types.h:27
signed char s8
Definition types.h:4
unsigned long u32
Definition types.h:10
unsigned short u16
Definition types.h:9
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8