Refactor gamepad emulation code to use the DS4 extended report format #1426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a preparatory PR for implementing the extended controller protocol features (motion, touch, battery, and RGB LED control) on Windows. We must send the full DS4 extended report rather than just filling out the simple report and relying on ViGEmBus to fill in the rest with default values.
This has the side-effect of fixing #1407 due to the incorrect assumption that it's safe to cast our
gamepad_state_t
directly to aXUSB_REPORT
. That broke in #1401 when I extended thebuttonFlags
from a 16-bit to a 32-bit value and caused all the subsequent values to become offset when emulating an Xbox 360 controller.I was going to wait to PR this until I had finished plumbing some of the extended features, but decided to do it sooner after I realized it fixes the root cause of #1407.
Screenshot
Issues Fixed or Closed
Fixes #1407
Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.