gameinput: publish the console GameInputDeviceInfo layout #528
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/528"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-29T20:09:53Z.
What
The console
GameInputDeviceInfois 320 bytes, not the desktop 328: a provider built against the desktop record leaves an 8-byte overrun, and the first pointer field sits at offset 160 (inputReportInfo).runtime/gameinput/console_abi.his our own declaration: the 320-byte info record with every field offset pinned, the state and reading records, the enums, the callback signatures and the three interface tables. The C view a guest calls and the table the provider fills are generated from one slot list, so a slot cannot move in one view without the other.build.pypasses the in-tree include directory.python build.pyandpython build.py lanestherefore build on a bare checkout with no environment variables.tests/test_gameinput_abi.pychecks the build wiring and dumps the record layout to confirm the declaration yields 320 bytes at the documented offsets.Verification
rm -rf build:python build.pyandpython build.py allexit 0;build/gameinput/GameInput.dllsha256890b715b002d064c6351b11059daf5a66c5ff75bf0d951078ff0f0d8adec46d8.header_size=320 infoSize=320 overrun=0; the pre-change provider reported 328 andoverrun=8.python tuxbox.py check --no-gpupasses;clang-cl /W4 /WXis clean.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:37:55Z.
Thanks. The 320-byte
infoSizefix is right, and the offset checks are useful. But we can't make the build depend on the console reference:python build.pyandpython build.py lanesstop unlessTUXBOX_CONSOLE_ROOTpoints at a GDK installation. Most contributors and CI don't have one, so GameInput would never be built or checked there, and Lanes would stop building for them.Could you instead define the console
GameInputDeviceInfolayout in our own code (our own struct with the 320-byte layout, written from the documented fields, not copied from the header) and keep compiling against the desktop header? Theoffsetofchecks against the real header can stay as an optional check that runs only whenTUXBOX_CONSOLE_ROOTis set and skips otherwise, like #510's layout check.Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:11:46Z.
Thanks, this addresses what I raised. It conflicts with
mainnow (after tonight's merges); could you rebase it? Then we'll run it through the check and merge.