diff --git a/src/xenia/kernel/xam/xam_input.cc b/src/xenia/kernel/xam/xam_input.cc index 2034e35b1..c355b3a8e 100644 --- a/src/xenia/kernel/xam/xam_input.cc +++ b/src/xenia/kernel/xam/xam_input.cc @@ -254,6 +254,13 @@ dword_result_t XamInputGetKeystrokeEx_entry( if (XSUCCEEDED(result)) { *user_index_ptr = keystroke->user_index; + } + // Test the code EXACTLY, not with XSUCCEEDED. `X_ERROR_EMPTY` is `0x10D2` + // and XSUCCEEDED is `(s & 0xC0000000) == 0`, so an empty poll "succeeds" — + // logging on XSUCCEEDED buried two real keystrokes under 6 499 empties in + // the first run of this instrumentation. (The assignment above shares the + // quirk; it is upstream's and harmless, since the struct is zeroed.) + if (result == X_ERROR_SUCCESS) { // Rare by construction — one per physical press — so log every one. XELOGI( "[RE-INPUT] XamInputGetKeystrokeEx -> user={} vk={:04X} flags={:04X} "