Add per-backend input debug visualization + round-trip view

Makes it possible to isolate an input->tool problem from a tool->game one in the
Controllers panel (under Debug details):
- which backend fed each slot is already shown via the per-pad source tag
  ("XInput #0" / "Steam Input") in the Incoming section;
- a new "Round-trip" table shows, per slot, the state we forwarded (the active
  backend's pad) next to what the game actually read back, highlighting matches.

For the round-trip, the XInput hook now echoes the state it returns to the game into
the status (protocol v9->v10: per-slot read_state in HookStatus).

Verified: hook_selftest (x64 + x86) asserts the hook records the game-read state;
full build x64 + x86 clean; ctest x64 9/9, x86 3/3.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 05:15:07 +02:00
parent 056a478e19
commit 327ba1f394
8 changed files with 57 additions and 10 deletions

View File

@@ -175,6 +175,10 @@ int main()
check(block->status.rumble_left[0] == 0x8000 && block->status.rumble_right[0] == 0x4000,
"status records rumble from XInputSetState");
// Round-trip: the hook echoes the state it returned to the game (for the
// Controllers panel's forwarded-vs-read view).
check(block->status.read_state[0].buttons == (kButtonA | kButtonB), "status records game-read state");
hook::remove_xinput_hooks();
std::printf(g_failures == 0 ? "SELFTEST PASS\n" : "SELFTEST FAILED (%d)\n", g_failures);