diff --git a/fallback/windows-nui/src/sensor.cpp b/fallback/windows-nui/src/sensor.cpp index 9c62658..a2ac20a 100644 --- a/fallback/windows-nui/src/sensor.cpp +++ b/fallback/windows-nui/src/sensor.cpp @@ -19,7 +19,15 @@ VirtualKinectSensor* g_sensor = nullptr; CRITICAL_SECTION g_sensor_lock; INIT_ONCE g_sensor_lock_once = INIT_ONCE_STATIC_INIT; -// --- Diagnostic: read the game's own display-manager state directly. --- +// Set true (and rebuild) to re-enable the in-process reverse-engineering +// instrumentation: DumpGameDisplayState() below plus the per-frame "handcur:" +// hand/cursor log in BuildSkeletonFrame. These read the game's own live memory +// (the shim runs inside gamekdm.dll) and are the tools that cracked skeleton +// rendering and the menu hand-cursor. OFF in shipping builds so kinect_shim.log +// stays quiet. Every address they read is mapped in docs/game-internals.md. +constexpr bool kShimDebug = false; + +// --- Debug-only (kShimDebug): read the game's own state directly. --- // The shim is loaded in gamekdm.dll's process, so it can inspect the game's // hid::Natal display manager to see why the camera panels never populate. // Decompile facts (image base 0x10000000): @@ -784,7 +792,7 @@ void VirtualKinectSensor::BuildSkeletonFrame(const SourceFrame& src) { } static unsigned hand_calls = 0; - if ((hand_calls++ % 15u) == 0u) { + if (kShimDebug && (hand_calls++ % 15u) == 0u) { const NUI_SKELETON_DATA& d0 = frame.SkeletonData[0]; auto& P = d0.SkeletonPositions; // Read the game's live cursor + state at the SAME instant as the joints so @@ -916,6 +924,7 @@ void VirtualKinectSensor::ProducerLoop() { } } } + if (kShimDebug) ShimLog("producer tick=%u src_open=%d got_frame=%d has_player=%d depth_nonzero=%zu streams_open=%d skel_enabled=%d", frame_number, source_.is_open() ? 1 : 0, got ? 1 : 0, got && src.has_player ? 1 : 0, depth_nonzero, @@ -924,7 +933,7 @@ void VirtualKinectSensor::ProducerLoop() { ? 1 : 0, skeleton_enabled_ ? 1 : 0); - DumpGameDisplayState(); + if (kShimDebug) DumpGameDisplayState(); } if (!got) { src = SourceFrame{};