diff --git a/src/game/gameport.c b/src/game/gameport.c index f17e39efe..88ff5cc8a 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -100,7 +100,7 @@ static const struct { { &joystick_3axis_2button }, { &joystick_2button_yoke_throttle }, { &joystick_3axis_4button }, - { &joystick_win95_steering_wheel }, + { &joystick_steering_wheel_4_button }, { &joystick_4button_yoke_throttle }, { &joystick_4axis_4button }, { &joystick_ch_flightstick_pro }, diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 834aa8a99..84dc5a380 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -10,9 +10,11 @@ * * Authors: Miran Grca, * Sarah Walker, + * Jasmine Iwanek, * * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. + * Copyright 2021-2025 Jasmine Iwanek. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,14 +72,19 @@ ch_flightstick_pro_read(UNUSED(void *priv)) ret &= ~0x40; if (joystick_state[gp][0].button[3]) ret &= ~0x80; + // POV Hat if (joystick_state[gp][0].pov[0] != -1) { - if (joystick_state[gp][0].pov[0] > 315 || joystick_state[gp][0].pov[0] < 45) + // POV Up + if ((joystick_state[gp][0].pov[0] > 315) || (joystick_state[gp][0].pov[0] < 45)) ret &= ~0xf0; - else if (joystick_state[gp][0].pov[0] >= 45 && joystick_state[gp][0].pov[0] < 135) + // POV Right + else if ((joystick_state[gp][0].pov[0]) >= 45 && (joystick_state[gp][0].pov[0] < 135)) ret &= ~0xb0; - else if (joystick_state[gp][0].pov[0] >= 135 && joystick_state[gp][0].pov[0] < 225) + // POV Down + else if ((joystick_state[gp][0].pov[0]) >= 135 && (joystick_state[gp][0].pov[0] < 225)) ret &= ~0x70; - else if (joystick_state[gp][0].pov[0] >= 225 && joystick_state[gp][0].pov[0] < 315) + // POV Left + else if ((joystick_state[gp][0].pov[0]) >= 225 && (joystick_state[gp][0].pov[0] < 315)) ret &= ~0x30; } } @@ -94,7 +101,7 @@ ch_flightstick_pro_write(UNUSED(void *priv)) static int ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) { - uint8_t gp = 0; + uint8_t gp = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; @@ -116,7 +123,7 @@ ch_flightstick_pro_read_axis(UNUSED(void *priv), int axis) static int ch_flightstick_pro_ch_pedals_read_axis(UNUSED(void *priv), int axis) { - uint8_t gp = 0; + uint8_t gp = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 5e0268d6b..60ea4b57d 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -193,7 +193,6 @@ static int joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis) { uint8_t gp = 0; - uint8_t js = 0; if (!JOYSTICK_PRESENT(gp, 0)) return AXIS_NOT_PRESENT; @@ -470,9 +469,9 @@ const joystick_t joystick_4button_yoke_throttle = { .pov_names = { NULL } }; -const joystick_t joystick_win95_steering_wheel = { - .name = "Win95 Steering Wheel (3-axis, 4-button)", - .internal_name = "win95_steering_wheel", +const joystick_t joystick_steering_wheel_4_button = { + .name = "Steering Wheel (3-axis, 4-button)", + .internal_name = "steering_wheel_4_button", .init = joystick_standard_init, .close = joystick_standard_close, .read = joystick_standard_read_4button, diff --git a/src/include/86box/gameport.h b/src/include/86box/gameport.h index f9d7810e0..1b86c0567 100644 --- a/src/include/86box/gameport.h +++ b/src/include/86box/gameport.h @@ -182,7 +182,7 @@ extern const joystick_t joystick_3axis_2button; extern const joystick_t joystick_2button_yoke_throttle; extern const joystick_t joystick_3axis_4button; extern const joystick_t joystick_4button_yoke_throttle; -extern const joystick_t joystick_win95_steering_wheel; +extern const joystick_t joystick_steering_wheel_4_button; extern const joystick_t joystick_4axis_4button; extern const joystick_t joystick_2axis_6button; extern const joystick_t joystick_2axis_8button;