summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_xinput.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-01-10 04:53:25 +1100
committer Vas Crabb <vas@vastheman.com>2023-01-10 04:53:25 +1100
commit06da34a209ac5482a3e06c07d5a0f3305c049c52 (patch)
tree2a387565123fd73c3aa85969281598787d5b812d /src/osd/modules/input/input_xinput.cpp
parenta435366d8ffc6b571de82ed59205558d8cbd3c95 (diff)
-Input code cleanup:
* dinput, xinput: Use proper item IDs for hat switches rather than "other switch". * xinput: Map right thumb stick to Z/rZ for consistency with SDL and DirectInput. * xinput: Map triggers to additional absolute axes 1 and 2. * xinput: Map start and back buttons to start and select. * Added default assignments for player 5-10 start/select. * Added default assignments for 5P-8P start and coin 5-8. -namco/namcos2.cpp: Changed collective pitch control to AD Stick Z.
Diffstat (limited to 'src/osd/modules/input/input_xinput.cpp')
-rw-r--r--src/osd/modules/input/input_xinput.cpp35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp
index 22171895c97..e7242a4e38a 100644
--- a/src/osd/modules/input/input_xinput.cpp
+++ b/src/osd/modules/input/input_xinput.cpp
@@ -38,8 +38,8 @@ const input_item_id xinput_axis_ids[] =
{
ITEM_ID_XAXIS,
ITEM_ID_YAXIS,
- ITEM_ID_RXAXIS,
- ITEM_ID_RYAXIS
+ ITEM_ID_ZAXIS,
+ ITEM_ID_RZAXIS
};
const USHORT xinput_pov_dir[] = {
@@ -63,10 +63,10 @@ const USHORT xinput_buttons[] = {
XINPUT_GAMEPAD_Y,
XINPUT_GAMEPAD_LEFT_SHOULDER,
XINPUT_GAMEPAD_RIGHT_SHOULDER,
- XINPUT_GAMEPAD_START,
- XINPUT_GAMEPAD_BACK,
XINPUT_GAMEPAD_LEFT_THUMB,
XINPUT_GAMEPAD_RIGHT_THUMB,
+ XINPUT_GAMEPAD_START,
+ XINPUT_GAMEPAD_BACK
};
const char *const xinput_button_names[] = {
@@ -76,10 +76,23 @@ const char *const xinput_button_names[] = {
"Y",
"LB",
"RB",
- "Start",
- "Back",
"LS",
- "RS"
+ "RS",
+ "Start",
+ "Back"
+};
+
+const input_item_id xinput_button_ids[] = {
+ ITEM_ID_BUTTON1,
+ ITEM_ID_BUTTON2,
+ ITEM_ID_BUTTON3,
+ ITEM_ID_BUTTON4,
+ ITEM_ID_BUTTON5,
+ ITEM_ID_BUTTON6,
+ ITEM_ID_BUTTON7,
+ ITEM_ID_BUTTON8,
+ ITEM_ID_START,
+ ITEM_ID_SELECT
};
@@ -266,7 +279,7 @@ void xinput_joystick_device::configure()
{
device()->add_item(
xinput_pov_names[povnum],
- ITEM_ID_OTHER_SWITCH,
+ input_item_id(ITEM_ID_HAT1UP + povnum), // matches up/down/left/right order
generic_button_get_state<BYTE>,
&gamepad.povs[povnum]);
}
@@ -276,20 +289,20 @@ void xinput_joystick_device::configure()
{
device()->add_item(
xinput_button_names[butnum],
- static_cast<input_item_id>(ITEM_ID_BUTTON1 + butnum),
+ xinput_button_ids[butnum],
generic_button_get_state<BYTE>,
&gamepad.buttons[butnum]);
}
device()->add_item(
"RT",
- ITEM_ID_ZAXIS,
+ ITEM_ID_ADD_ABSOLUTE1,
generic_axis_get_state<LONG>,
&gamepad.right_trigger);
device()->add_item(
"LT",
- ITEM_ID_RZAXIS,
+ ITEM_ID_ADD_ABSOLUTE2,
generic_axis_get_state<LONG>,
&gamepad.left_trigger);