Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the driver to operate in Xpad360 emulation mode #283

Closed

Conversation

kakra
Copy link
Collaborator

@kakra kakra commented Mar 28, 2021

Todo:

  • Maybe find a way to implement this as a quirk flag
  • Maybe make it switchable at runtime (can currently only be set at module load time)
  • Investigate integration with Re-implement hidraw patching #286

@kakra kakra added the 0 | type: enhancement New feature or request label Mar 28, 2021
@kakra kakra added this to the v0.10 milestone Mar 28, 2021
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from f3d9e54 to e72be85 Compare April 3, 2021 11:54
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch 3 times, most recently from 11398b6 to 15c53d2 Compare June 25, 2021 21:28
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from 15c53d2 to 45df9fc Compare July 6, 2021 21:17
@kakra kakra mentioned this pull request Jul 20, 2021
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from 45df9fc to f2fda05 Compare August 28, 2021 21:38
@kakra kakra modified the milestones: v0.10, v0.11 Mar 5, 2022
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch 2 times, most recently from 2dc927c to 902f3a1 Compare March 6, 2022 20:30
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from 902f3a1 to 0990923 Compare April 30, 2022 11:39
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from 0990923 to a087b16 Compare May 26, 2022 04:49
kakra added a commit that referenced this pull request May 30, 2022
A new SDL gamecontrollerdb entry allows us to get rid of the Xbox
button fixup we are carrying around. While this button is still not
exactly a button for games, all software expects it to be part of the
gamepad mapping anyways.

This leaves only the Share button left in the consumer control bits
which doesn't have an jsdev equivalent.

Affects: #286
Maybe-affects: #283
Fixes: #362
Fixes: #359
Closes: #301
Signed-off-by: Kai Krakow <kai@kaishome.de>
kakra added a commit to kakra/xpadneo that referenced this pull request May 30, 2022
A new SDL gamecontrollerdb entry allows us to get rid of the Xbox
button fixup we are carrying around. While this button is still not
exactly a button for games, all software expects it to be part of the
gamepad mapping anyways.

This leaves only the Share button left in the consumer control bits
which doesn't have an jsdev equivalent.

Affects: atar-axis#286
Maybe-affects: atar-axis#283
Fixes: atar-axis#362
Fixes: atar-axis#359
Closes: atar-axis#301
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from a087b16 to 52f4625 Compare May 30, 2022 02:38
kakra added a commit that referenced this pull request May 30, 2022
A new SDL gamecontrollerdb entry allows us to get rid of the Xbox
button fixup we are carrying around. While this button is still not
exactly a button for games, all software expects it to be part of the
gamepad mapping anyways.

This leaves only the Share button left in the consumer control bits
which doesn't have an jsdev equivalent.

Affects: #286
Maybe-affects: #283
Fixes: #362
Fixes: #359
Closes: #301
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from 52f4625 to ed5cf29 Compare May 30, 2022 22:30
kakra added a commit to kakra/xpadneo that referenced this pull request Sep 15, 2022
Switching to PID 0x028E seems to successfully evade the mappings in
Proton, and thus probably SDL.

Proton seems to do the same for Steam virtual controllers, and it
seems to also fix gamepad handling in Chrome.

Maybe-fixes: atar-axis#379
Maybe-affects: atar-axis#385
Maybe-affects: ValveSoftware/steam-for-linux#8463 (comment)
See-also: atar-axis#283
See-also: ValveSoftware/wine@7ea1cc2
Fixes: atar-axis#373
Signed-off-by: Kai Krakow <kai@kaishome.de>
kakra added a commit to kakra/xpadneo that referenced this pull request Sep 15, 2022
Switching to PID 0x028E seems to successfully evade the mappings in
Proton, and thus probably SDL.

Proton seems to do the same for Steam virtual controllers, and it
seems to also fix gamepad handling in Chrome.

Maybe-fixes: atar-axis#379
Maybe-affects: atar-axis#385
Maybe-affects: ValveSoftware/steam-for-linux#8463 (comment)
See-also: atar-axis#283
See-also: ValveSoftware/wine@7ea1cc2
Fixes: atar-axis#373
Signed-off-by: Kai Krakow <kai@kaishome.de>
This mode disables most advanced features and exposes the device as an
original USB-connected Xbox 360 controller. Use module parameter
`xpad_emulation=1`.

This may be useful for applications like Retroarch or other programs
that need the Guide button exposed as a joystick button. Essentially,
it enables such applications to use the button as a macro modifier
button, and the button will no longer be sent as a consumer control
key (but still announced as being available).

In this mode, joydev inserts the button before the left and right
thumb buttons which may mess up some mappings, especially with joydev.
Since we are pretending to be a USB Xbox360 controller, most programs
will take care of it.

For hidraw programs, we also scale the trigger range down from 0..1023
to 0..255 which makes the trigger slightly less precise.

This parameter cannot be changed at runtime, you must reload the module
with the parameter changed to apply the emulation correctly.

Fixes: atar-axis#237
Affects: atar-axis#273
Fixes: atar-axis#280
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra kakra force-pushed the queue/allow-exact-usb-xpad360-emulation branch from ed5cf29 to 257f24b Compare September 17, 2022 20:28
@codeclimate
Copy link

codeclimate bot commented Sep 17, 2022

Code Climate has analyzed commit 257f24b and detected 0 issues on this pull request.

View more on Code Climate.

kakra added a commit that referenced this pull request Sep 17, 2022
Switching to PID 0x028E seems to successfully evade the mappings in
Proton, and thus probably SDL.

Proton seems to do the same for Steam virtual controllers, and it
seems to also fix gamepad handling in Chrome.

Maybe-fixes: #379
Maybe-affects: #385
Maybe-affects: ValveSoftware/steam-for-linux#8463 (comment)
See-also: #283
See-also: ValveSoftware/wine@7ea1cc2
Fixes: #373
Signed-off-by: Kai Krakow <kai@kaishome.de>
@kakra
Copy link
Collaborator Author

kakra commented Mar 4, 2024

xpadneo now has options in place that should work around any left issues with this. The only thing left is using 8-bit values for the triggers, this should be fixed in user-space. Future customization option may add additional improvements. Closing.

@kakra kakra closed this Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

1 participant