diff options
| author | Maraco91 <43787609+Maraco91@users.noreply.github.com> | 2026-11-23 23:15:46 +0100 |
|---|---|---|
| committer | Maraco91 <43787609+Maraco91@users.noreply.github.com> | 2026-11-23 23:15:46 +0100 |
| commit | 29bd7a11a68574e1aa79908805ee6f56a8ae8e76 (patch) | |
| tree | 61d46a5d5cf8300c8a39e9a61e2802c3c112358d /docs/gameinput.md | |
| parent | 5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (diff) | |
gameinput: the device info has its GameInputLabel members
gameinput_abi.h left out the labels of the public v0 layout. In
GameInputControllerAxisInfo and GameInputControllerButtonInfo a label
sits at offset 4, in what is otherwise padding, so the sizes matched
while isContinuous, restValue, legacyDInputIndex and rawReportIndex were
four bytes early. GameInputGamepadInfo and GameInputUiNavigationInfo are
tables of 14 and 21 labels; they were declared empty, and the pointers
in GameInputDeviceInfo led to one-byte members, so a title reading a
label read whatever followed.
The header declares the enum, the two tables and the two label members
and pins each offset that moved. fill_info gives every control the Xbox
label of its position on every pad, since every pad is presented as an
Xbox One pad.
gameinput_test reads the tables by the public header's byte offsets, so
the shim's own header cannot agree with itself.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'docs/gameinput.md')
| -rw-r--r-- | docs/gameinput.md | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/gameinput.md b/docs/gameinput.md index 4b617b487..a3c0458a4 100644 --- a/docs/gameinput.md +++ b/docs/gameinput.md | |||
| @@ -425,7 +425,15 @@ the enums the shim uses and the structs it has to lay out. It was written agains | |||
| 425 | GDK version, also published as the `Microsoft.GameInput` NuGet package 0.2303.22621.3038). The header is not in the | 425 | GDK version, also published as the `Microsoft.GameInput` NuGet package 0.2303.22621.3038). The header is not in the |
| 426 | repository. Its struct offsets were checked by compiling both side by side with `offsetof` asserts for every field the | 426 | repository. Its struct offsets were checked by compiling both side by side with `offsetof` asserts for every field the |
| 427 | shim fills (`GameInputDeviceInfo` 320 bytes with `deviceFamily` at 96 and the info pointers from 160, | 427 | shim fills (`GameInputDeviceInfo` 320 bytes with `deviceFamily` at 96 and the info pointers from 160, |
| 428 | `GameInputGamepadState` 28 bytes, `GameInputControllerAxisInfo` 48, and the rest in `gameinput_abi.h`). | 428 | `GameInputGamepadState` 28 bytes, and the rest in `gameinput_abi.h`). Four structs had only their size compared, or |
| 429 | were taken as empty, and were wrong: `GameInputControllerAxisInfo` (48 bytes) and `GameInputControllerButtonInfo` (32) | ||
| 430 | have a `GameInputLabel` at offset 4, in what would otherwise be padding, so the members behind it sat four bytes early, | ||
| 431 | and `GameInputGamepadInfo` and `GameInputUiNavigationInfo` are tables of 14 and 21 labels (56 and 84 bytes). Every | ||
| 432 | member of the four now compares equal side by side, and `gameinput_abi.h` pins each offset. The host's GameInput 0.2309 | ||
| 433 | fills the two tables in that order: a DualSense (`054c:0ce6`) over USB has the cross, circle, square and triangle icons | ||
| 434 | for A, B, X and Y, `Menu`, `View`, `Up`/`Down`/`Left`/`Right`, `L1`/`R1` and `L3`/`R3`, and null axis and button arrays. | ||
| 435 | The shim gives every control the Xbox label of its position on every pad, because every pad is presented as an Xbox | ||
| 436 | One pad; an Xbox pad's labels on the host are not measured. | ||
| 429 | 437 | ||
| 430 | The force-feedback and haptic declarations (`GameInputForceFeedbackMotorInfo`, `GameInputHapticWaveformInfo`, | 438 | The force-feedback and haptic declarations (`GameInputForceFeedbackMotorInfo`, `GameInputHapticWaveformInfo`, |
| 431 | `GameInputHapticFeedbackMotorInfo`, the envelope and parameter structs, `IGameInputForceFeedbackEffect`) were | 439 | `GameInputHapticFeedbackMotorInfo`, the envelope and parameter structs, `IGameInputForceFeedbackEffect`) were |