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:
@@ -151,6 +151,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// Record the state the hook just returned to the game for a slot (round-trip view).
|
||||
void note_read_state(std::uint32_t slot, const CoopPadState& state)
|
||||
{
|
||||
if (block_ != nullptr && slot < kMaxPads)
|
||||
{
|
||||
block_->status.read_state[slot] = state;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Audio render-hook diagnostics -------------------------------------
|
||||
|
||||
// Total distinct render streams the audio hook has observed.
|
||||
|
||||
@@ -90,6 +90,10 @@ DWORD query_state(DWORD user_index, XINPUT_STATE* state, bool keep_guide)
|
||||
result.Gamepad.wButtons &= ~kGuideButton;
|
||||
}
|
||||
*state = result;
|
||||
if (g_ipc != nullptr)
|
||||
{
|
||||
g_ipc->note_read_state(user_index, pad); // round-trip: what the game just read
|
||||
}
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user