Skip to content

Commit

Permalink
Add sensor function placeholders for all joypad drivers.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Jul 24, 2024
1 parent 6b8025f commit d9ee198
Show file tree
Hide file tree
Showing 27 changed files with 92 additions and 37 deletions.
4 changes: 3 additions & 1 deletion input/drivers_joypad/android_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ input_device_driver_t android_joypad = {
android_joypad_axis,
android_joypad_poll,
android_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
android_joypad_name,
"android",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/ctr_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ input_device_driver_t ctr_joypad = {
ctr_joypad_get_buttons,
ctr_joypad_axis,
ctr_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
ctr_joypad_name,
"ctr",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/dinput_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ input_device_driver_t dinput_joypad = {
dinput_joypad_axis,
dinput_joypad_poll,
dinput_joypad_set_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
dinput_joypad_name,
"dinput",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/dos_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ input_device_driver_t dos_joypad = {
NULL,
dos_joypad_axis,
dos_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
dos_joypad_name,
"dos",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/gx_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,10 @@ input_device_driver_t gx_joypad = {
gx_joypad_get_buttons,
gx_joypad_axis,
gx_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
gx_joypad_name,
"gx",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/hid_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ input_device_driver_t hid_joypad = {
hid_joypad_axis,
hid_joypad_poll,
hid_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
hid_joypad_name,
"hid"
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/linuxraw_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,10 @@ input_device_driver_t linuxraw_joypad = {
linuxraw_joypad_get_buttons,
linuxraw_joypad_axis,
linuxraw_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
linuxraw_joypad_name,
"linuxraw",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/parport_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,10 @@ input_device_driver_t parport_joypad = {
parport_joypad_get_buttons,
parport_joypad_axis,
parport_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
parport_joypad_name,
"parport",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/ps2_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ input_device_driver_t ps2_joypad = {
ps2_joypad_axis,
ps2_joypad_poll,
ps2_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
ps2_joypad_name,
"ps2",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/ps3_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ input_device_driver_t ps3_joypad = {
ps3_joypad_axis,
ps3_joypad_poll,
ps3_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
ps3_joypad_name,
"ps3",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/ps4_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ input_device_driver_t ps4_joypad = {
ps4_joypad_axis,
ps4_joypad_poll,
ps4_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
ps4_joypad_name,
"ps4",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/psp_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ input_device_driver_t psp_joypad = {
psp_joypad_axis,
psp_joypad_poll,
psp_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
psp_joypad_name,
#ifdef VITA
"vita",
Expand Down
6 changes: 4 additions & 2 deletions input/drivers_joypad/qnx_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ input_device_driver_t qnx_joypad = {
NULL,
qnx_joypad_axis,
qnx_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
qnx_joypad_name,
"qnx",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/rwebpad_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ input_device_driver_t rwebpad_joypad = {
rwebpad_joypad_get_buttons,
rwebpad_joypad_axis,
rwebpad_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
rwebpad_joypad_name,
"rwebpad",
};
2 changes: 2 additions & 0 deletions input/drivers_joypad/sdl_dingux_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ input_device_driver_t sdl_dingux_joypad = {
NULL,
NULL,
#endif
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
sdl_dingux_joypad_name,
"sdl_dingux",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/sdl_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,11 @@ input_device_driver_t sdl_joypad = {
#ifdef HAVE_SDL2
sdl_joypad_set_rumble,
#else
NULL,
NULL, /* set_rumble */
#endif
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
sdl_joypad_name,
#ifdef HAVE_SDL2
"sdl2",
Expand Down
4 changes: 3 additions & 1 deletion input/drivers_joypad/switch_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ input_device_driver_t switch_joypad = {
#else
NULL, /* set_rumble */
#endif
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
switch_joypad_name,
"switch"
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/test_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,10 @@ input_device_driver_t test_joypad = {
NULL, /* get_buttons */
test_joypad_axis,
test_joypad_poll,
NULL, /* rumble */
NULL, /* rumble_gain */
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
test_joypad_name,
"test",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/udev_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,10 @@ input_device_driver_t udev_joypad = {
#ifndef HAVE_LAKKA_SWITCH
udev_set_rumble_gain,
#else
NULL,
NULL, /* set_rumble_gain */
#endif
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
udev_joypad_name,
"udev",
};
2 changes: 2 additions & 0 deletions input/drivers_joypad/wiiu/hidpad_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ input_device_driver_t hidpad_driver =
hidpad_poll,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
hidpad_name,
"hid"
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/wiiu/kpad_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ input_device_driver_t kpad_driver =
kpad_get_buttons,
kpad_axis,
kpad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
kpad_name,
"wiimote",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/wiiu/wpad_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ input_device_driver_t wpad_driver =
wpad_get_buttons,
wpad_axis,
wpad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
wpad_name,
"gamepad",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/wiiu_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ input_device_driver_t wiiu_joypad =
wiiu_joypad_get_buttons,
wiiu_joypad_axis,
wiiu_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
wiiu_joypad_name,
"wiiu",
};
6 changes: 4 additions & 2 deletions input/drivers_joypad/xdk_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ input_device_driver_t xdk_joypad = {
NULL,
xdk_joypad_axis,
xdk_joypad_poll,
NULL,
NULL,
NULL, /* set_rumble */
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
xdk_joypad_name,
"xdk",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/xinput_hybrid_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,9 @@ input_device_driver_t xinput_joypad = {
xinput_joypad_axis,
xinput_joypad_poll,
xinput_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
xinput_joypad_name,
"xinput",
};
4 changes: 3 additions & 1 deletion input/drivers_joypad/xinput_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ input_device_driver_t xinput_joypad = {
xinput_joypad_axis,
xinput_joypad_poll,
xinput_joypad_rumble,
NULL,
NULL, /* set_rumble_gain */
NULL, /* set_sensor_state */
NULL, /* get_sensor_input */
xinput_joypad_name,
"xinput",
};
3 changes: 3 additions & 0 deletions input/input_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ struct rarch_joypad_driver
void (*poll)(void);
bool (*set_rumble)(unsigned, enum retro_rumble_effect, uint16_t);
bool (*set_rumble_gain)(unsigned, unsigned);
bool (*set_sensor_state)(void *data, unsigned port,
enum retro_sensor_action action, unsigned rate);
float (*get_sensor_input)(void *data, unsigned port, unsigned id);
const char *(*name)(unsigned);

const char *ident;
Expand Down

0 comments on commit d9ee198

Please sign in to comment.