Revert "xinput: the left+right triggers combined are considered the Z Axis, not Z Axis+Z Rotation where the axis resting position was at the middle of the trigger (nw)"

The DirectInput Z-axis trigger merger seems more widely considered a bug than a feature, and probably should not be the default MAME behavior.

This reverts commit 80a64430a3.
This commit is contained in:
AJR 2017-10-13 19:25:43 -04:00
parent d301c90c7b
commit 9308ed99dc
2 changed files with 13 additions and 5 deletions

View File

@ -131,7 +131,8 @@ void xinput_joystick_device::poll()
gamepad.right_thumb_y = normalize_absolute_axis(-xinput_state.xstate.Gamepad.sThumbRY, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE);
// Now the triggers
gamepad.z_axis = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger - xinput_state.xstate.Gamepad.bRightTrigger, -255, 255);
gamepad.left_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger, 0, 255);
gamepad.right_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bRightTrigger, 0, 255);
}
void xinput_joystick_device::reset()
@ -178,10 +179,16 @@ void xinput_joystick_device::configure()
}
device()->add_item(
"Z",
"Left Trigger",
ITEM_ID_ZAXIS,
generic_axis_get_state<LONG>,
&gamepad.z_axis);
&gamepad.left_trigger);
device()->add_item(
"Right Trigger",
ITEM_ID_RZAXIS,
generic_axis_get_state<LONG>,
&gamepad.right_trigger);
m_configured = true;
}

View File

@ -74,7 +74,8 @@ struct gamepad_state
{
BYTE buttons[XINPUT_MAX_BUTTONS];
BYTE povs[XINPUT_MAX_POV];
LONG z_axis;
LONG left_trigger;
LONG right_trigger;
LONG left_thumb_x;
LONG left_thumb_y;
LONG right_thumb_x;
@ -84,7 +85,7 @@ struct gamepad_state
// state information for a gamepad; state must be first element
struct xinput_api_state
{
uint32_t player_index;
uint32_t player_index;
XINPUT_STATE xstate;
XINPUT_CAPABILITIES caps;
};