summaryrefslogtreecommitdiff
path: root/include/SSystem/SComponent/c_API_controller_pad.h
blob: 812ccde38795eea7fede98e3a14093efb00b35be (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
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef C_API_CONTROLLER_PAD_
#define C_API_CONTROLLER_PAD_

#include "dolphin/types.h"

// made up name
struct controller_pad_buttons {
    /* 0x00 (0x80 >> 7) */ bool left  : 1;
    /* 0x00 (0x40 >> 6) */ bool right : 1;
    /* 0x00 (0x10 >> 5) */ bool down  : 1;
    /* 0x00 (0x10 >> 4) */ bool up    : 1;
    /* 0x00 (0x08 >> 3) */ bool z     : 1;
    /* 0x00 (0x04 >> 2) */ bool r     : 1;
    /* 0x00 (0x02 >> 1) */ bool l     : 1;
    /* 0x00 (0x01 >> 0) */ bool a     : 1;
    /* 0x01 (0x80 >> 7) */ bool b     : 1;
    /* 0x01 (0x40 >> 6) */ bool x     : 1;
    /* 0x01 (0x20 >> 5) */ bool y     : 1;
    /* 0x01 (0x10 >> 4) */ bool start : 1;
};

struct interface_of_controller_pad {
    /* 0x00 */ f32 mMainStickPosX;
    /* 0x04 */ f32 mMainStickPosY;
    /* 0x08 */ f32 mMainStickValue;
    /* 0x0C */ s16 mMainStickAngle;
    /* 0x0E */ u8 field_0xe;
    /* 0x0F */ u8 field_0xf;
    /* 0x10 */ f32 mCStickPosX;
    /* 0x14 */ f32 mCStickPosY;
    /* 0x18 */ f32 mCStickValue;
    /* 0x1C */ s16 mCStickAngle;
    /* 0x1E */ u8 field_0x1e;
    /* 0x1F */ u8 field_0x1f;
    /* 0x20 */ f32 mAnalogA;
    /* 0x24 */ f32 mAnalogB;
    /* 0x28 */ f32 mTriggerLeft;
    /* 0x2C */ f32 mTriggerRight;
    /* 0x30 */ controller_pad_buttons mButtonHold;
    /* 0x32 */ controller_pad_buttons mButtonTrig;
    /* 0x34 */ s8 mGamepadErrorFlags;
    /* 0x35 */ u8 mHoldLockL;
    /* 0x36 */ u8 mTrigLockL;
    /* 0x37 */ u8 mHoldLockR;
    /* 0x38 */ u8 mTrigLockR;
    /* 0x39 */ u8 field_0x3d;
    /* 0x3A */ u8 field_0x3e;
    /* 0x3B */ u8 field_0x3f;
};

void cAPICPad_recalibrate(void);
u32 cAPICPad_ANY_BUTTON(u32 param_0);

#endif