mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
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:
parent
d301c90c7b
commit
9308ed99dc
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user