diff --git a/src/game/gameport.c b/src/game/gameport.c index 7551b2b91..04fb01de5 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -60,17 +60,21 @@ typedef struct _joystick_instance_ { int joystick_type = 0; static const joystick_if_t joystick_none = { - "None", - "none", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0, - 0 + .name = "None", + .internal_name = "none", + .init = NULL, + .close = NULL, + .read = NULL, + .write = NULL, + .read_axis = NULL, + .a0_over = NULL, + .axis_count = 0, + .button_count = 0, + .pov_count = 0, + .max_joysticks = 0, + .axis_names = { NULL }, + .button_names = { NULL }, + .pov_names = { NULL } }; static const struct { diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 5a44c2312..5be3ce50f 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -115,19 +115,19 @@ static void ch_flightstick_pro_a0_over(void *p) const joystick_if_t joystick_ch_flightstick_pro = { - "CH Flightstick Pro", - "ch_flightstick_pro", - ch_flightstick_pro_init, - ch_flightstick_pro_close, - ch_flightstick_pro_read, - ch_flightstick_pro_write, - ch_flightstick_pro_read_axis, - ch_flightstick_pro_a0_over, - 3, - 4, - 1, - 1, - {"X axis", "Y axis", "Throttle"}, - {"Button 1", "Button 2", "Button 3", "Button 4"}, - {"POV"} + .name = "CH Flightstick Pro", + .internal_name = "ch_flightstick_pro", + .init = ch_flightstick_pro_init, + .close = ch_flightstick_pro_close, + .read = ch_flightstick_pro_read, + .write = ch_flightstick_pro_write, + .read_axis = ch_flightstick_pro_read_axis, + .a0_over = ch_flightstick_pro_a0_over, + .axis_count = 3, + .button_count = 4, + .pov_count = 1, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Throttle" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { "POV" } }; diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index f091841b0..ce2a72664 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -236,122 +236,128 @@ static void joystick_standard_a0_over(void *p) { } -const joystick_if_t joystick_2axis_2button = -{ - "2-axis, 2-button joystick(s)", - "2axis_2button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read, - joystick_standard_write, - joystick_standard_read_axis, - joystick_standard_a0_over, - 2, - 2, - 0, - 2, - {"X axis", "Y axis"}, - {"Button 1", "Button 2"} +const joystick_if_t joystick_2axis_2button = { + .name = "2-axis, 2-button joystick(s)", + .internal_name = "2axis_2button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 2, + .pov_count = 0, + .max_joysticks = 2, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_4button = -{ - "2-axis, 4-button joystick", - "2axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_4button, - joystick_standard_a0_over, - 2, - 4, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_2axis_4button = { + .name = "2-axis, 4-button joystick", + .internal_name = "2axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_4button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_3axis_2button = -{ - "3-axis, 2-button joystick", - "3axis_2button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read, - joystick_standard_write, - joystick_standard_read_axis_3axis, - joystick_standard_a0_over, - 3, - 2, - 0, - 1, - {"X axis", "Y axis", "Z axis"}, - {"Button 1", "Button 2"} + +const joystick_if_t joystick_3axis_2button = { + .name = "3-axis, 2-button joystick", + .internal_name = "3axis_2button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_3axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 3, + .button_count = 2, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis" }, + .button_names = { "Button 1", "Button 2" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_3axis_4button = -{ - "3-axis, 4-button joystick", - "3axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_3axis, - joystick_standard_a0_over, - 3, - 4, - 0, - 1, - {"X axis", "Y axis", "Z axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_3axis_4button = { + .name = "3-axis, 4-button joystick", + .internal_name = "3axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_3axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 3, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_4axis_4button = -{ - "4-axis, 4-button joystick", - "4axis_4button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_4axis, - joystick_standard_a0_over, - 4, - 4, - 0, - 1, - {"X axis", "Y axis", "Z axis", "zX axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"} + +const joystick_if_t joystick_4axis_4button = { + .name = "4-axis, 4-button joystick", + .internal_name = "4axis_4button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_4axis, + .a0_over = joystick_standard_a0_over, + .axis_count = 4, + .button_count = 4, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis", "Z axis", "zX axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_6button = -{ - "2-axis, 6-button joystick", - "2axis_6button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_6button, - joystick_standard_a0_over, - 2, - 6, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6"} + +const joystick_if_t joystick_2axis_6button = { + .name = "2-axis, 6-button joystick", + .internal_name = "2axis_6button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_6button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 6, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6" }, + .pov_names = { NULL } }; -const joystick_if_t joystick_2axis_8button = -{ - "2-axis, 8-button joystick", - "2axis_8button", - joystick_standard_init, - joystick_standard_close, - joystick_standard_read_4button, - joystick_standard_write, - joystick_standard_read_axis_8button, - joystick_standard_a0_over, - 2, - 8, - 0, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6", "Button 7", "Button 8"} + +const joystick_if_t joystick_2axis_8button = { + .name = "2-axis, 8-button joystick", + .internal_name = "2axis_8button", + .init = joystick_standard_init, + .close = joystick_standard_close, + .read = joystick_standard_read_4button, + .write = joystick_standard_write, + .read_axis = joystick_standard_read_axis_8button, + .a0_over = joystick_standard_a0_over, + .axis_count = 2, + .button_count = 8, + .pov_count = 0, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6", "Button 7", "Button 8" }, + .pov_names = { NULL } }; diff --git a/src/game/joystick_sw_pad.c b/src/game/joystick_sw_pad.c index 8c0235046..718eefbb4 100644 --- a/src/game/joystick_sw_pad.c +++ b/src/game/joystick_sw_pad.c @@ -262,20 +262,20 @@ static void sw_a0_over(void *p) timer_set_delay_u64(&sw->trigger_timer, TIMER_USEC * 10000); } -const joystick_if_t joystick_sw_pad = -{ - "Microsoft SideWinder Pad", - "sidewinder_pad", - sw_init, - sw_close, - sw_read, - sw_write, - sw_read_axis, - sw_a0_over, - 2, - 10, - 0, - 4, - {"X axis", "Y axis"}, - {"A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M"} +const joystick_if_t joystick_sw_pad = { + .name = "Microsoft SideWinder Pad", + .internal_name = "sidewinder_pad", + .init = sw_init, + .close = sw_close, + .read = sw_read, + .write = sw_write, + .read_axis = sw_read_axis, + .a0_over = sw_a0_over, + .axis_count = 2, + .button_count = 10, + .pov_count = 0, + .max_joysticks = 4, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "A", "B", "C", "X", "Y", "Z", "L", "R", "Start", "M" }, + .pov_names = { NULL } }; diff --git a/src/game/joystick_tm_fcs.c b/src/game/joystick_tm_fcs.c index e3dbae1e3..ee83c5ad2 100644 --- a/src/game/joystick_tm_fcs.c +++ b/src/game/joystick_tm_fcs.c @@ -114,19 +114,19 @@ static void tm_fcs_a0_over(void *p) const joystick_if_t joystick_tm_fcs = { - "Thrustmaster Flight Control System", - "thrustmaster_fcs", - tm_fcs_init, - tm_fcs_close, - tm_fcs_read, - tm_fcs_write, - tm_fcs_read_axis, - tm_fcs_a0_over, - 2, - 4, - 1, - 1, - {"X axis", "Y axis"}, - {"Button 1", "Button 2", "Button 3", "Button 4"}, - {"POV"} + .name = "Thrustmaster Flight Control System", + .internal_name = "thrustmaster_fcs", + .init = tm_fcs_init, + .close = tm_fcs_close, + .read = tm_fcs_read, + .write = tm_fcs_write, + .read_axis = tm_fcs_read_axis, + .a0_over = tm_fcs_a0_over, + .axis_count = 2, + .button_count = 4, + .pov_count = 1, + .max_joysticks = 1, + .axis_names = { "X axis", "Y axis" }, + .button_names = { "Button 1", "Button 2", "Button 3", "Button 4" }, + .pov_names = { "POV" } };