diff --git a/src/xenia/kernel/xam/xam_input.cc b/src/xenia/kernel/xam/xam_input.cc index 6179f7e5f..6b869916d 100644 --- a/src/xenia/kernel/xam/xam_input.cc +++ b/src/xenia/kernel/xam/xam_input.cc @@ -193,6 +193,21 @@ dword_result_t XamInputGetKeystrokeEx_entry( keystroke.Zero(); if (kernel_state()->xam_state()->IsUIActive()) { + // RE aid: this early return hands the guest a SUCCESS with an empty + // keystroke without ever asking a driver, so scripted input goes silently + // dead for as long as any Xenia UI is up — including a dialog that was + // closed by its own [x] rather than by the menu toggle that decrements the + // counter. An invisible input blackout is expensive to diagnose from the + // outside; say so, rarely enough not to spam. + static std::atomic swallowed{0}; + const uint32_t n = swallowed.fetch_add(1, std::memory_order_relaxed); + if ((n % 600) == 0) { + XELOGW( + "[RE-INPUT] XamInputGetKeystrokeEx swallowed by IsUIActive " + "(dialogs={} nui={}, {} so far)", + kernel_state()->xam_state()->xam_dialogs_shown_.load(), + kernel_state()->xam_state()->xam_nui_dialogs_shown_.load(), n + 1); + } return X_ERROR_SUCCESS; }