Mercurial > repos > blastem
comparison controller_info.h @ 1596:437e80a700aa
Initial heuristics for detecting controller types and showing different labels in UI. Modified controller settings view to first display a list of controllers, only showing mapping after selecting controller
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 22 Jul 2018 17:48:46 -0700 |
parents | |
children | 1fc61c844ec5 |
comparison
equal
deleted
inserted
replaced
1595:360d5bab199f | 1596:437e80a700aa |
---|---|
1 #ifndef CONTROLLER_INFO_H_ | |
2 #define CONTROLLER_INFO_H_ | |
3 #include <stdint.h> | |
4 | |
5 enum { | |
6 TYPE_UNKNOWN, | |
7 TYPE_GENERIC_MAPPING, | |
8 TYPE_XBOX, | |
9 TYPE_PSX, | |
10 TYPE_NINTENDO, | |
11 TYPE_SEGA | |
12 }; | |
13 | |
14 enum { | |
15 SUBTYPE_UNKNOWN, | |
16 SUBTYPE_XBOX, | |
17 SUBTYPE_X360, | |
18 SUBTYPE_XBONE, | |
19 SUBTYPE_PS2, | |
20 SUBTYPE_PS3, | |
21 SUBTYPE_PS4, | |
22 SUBTYPE_WIIU, | |
23 SUBTYPE_SWITCH, | |
24 SUBTYPE_GENESIS, | |
25 SUBTYPE_SATURN | |
26 }; | |
27 | |
28 enum { | |
29 VARIANT_NORMAL, | |
30 VARIANT_6B_BUMPERS, //C and Z positions are RB and LB respectively | |
31 VARIANT_6B_RIGHT //C and Z positions are RT and RB respectively | |
32 }; | |
33 | |
34 typedef struct { | |
35 char const *name; | |
36 uint8_t type; | |
37 uint8_t subtype; | |
38 uint8_t variant; | |
39 } controller_info; | |
40 | |
41 controller_info get_controller_info(int index); | |
42 const char *get_button_label(controller_info *info, int button); | |
43 const char *get_axis_label(controller_info *info, int axis); | |
44 | |
45 #endif //CONTROLLER_INFO_H_ |