PSXSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
psxpad.h
Go to the documentation of this file.
1 #ifndef _PSXPAD_H
2 #define _PSXPAD_H
3 
4 /* Pad bits defines. */
5 
6 #define PAD_LEFT (1<<15)
7 #define PAD_RIGHT (1<<13)
8 #define PAD_UP (1<<12)
9 #define PAD_DOWN (1<<14)
10 #define PAD_L2 1
11 #define PAD_R2 (1<<1)
12 #define PAD_L1 (1<<2)
13 #define PAD_R1 (1<<3)
14 #define PAD_TRIANGLE (1<<4)
15 #define PAD_CIRCLE (1<<5)
16 #define PAD_CROSS (1<<6)
17 #define PAD_SQUARE (1<<7)
18 #define PAD_SELECT (1<<8)
19 #define PAD_LANALOGB (1<<9)
20 #define PAD_RANALOGB (1<<10)
21 #define PAD_START (1<<11)
22 
23 #define PAD_READ_RAW_SIZE 21
24 
31 {
41  PADTYPE_NEGCON, // Namco NeGcon
46 };
47 
53 typedef struct
54 {
56  unsigned char status;
59  unsigned char id;
61  unsigned char type;
67  unsigned short buttons;
68 
73  union extra
74  {
87  struct analogJoy
88  {
93  signed char x[2];
98  signed char y[2];
99  }analogJoy;
100 
113  struct analogPad
114  {
119  signed char x[2];
124  signed char y[2];
125  }analogPad;
126 
131  struct negCon
132  {
143  signed char steering;
144 
151  unsigned char one;
152 
159  unsigned char two;
160 
167  unsigned char shoulder;
168  }negCon;
169  }extra;
171 
172 void QueryPAD(int pad_n, unsigned char *in, unsigned char *out, int len);
173 void pad_read_raw(int pad_n, unsigned char *arr);
174 void pad_escape_mode(int pad_n, int enable);
175 void pad_enable_vibration(int pad_n);
176 void pad_set_vibration(int pad_n, unsigned char small, unsigned char big);
177 
178 #endif