cleanup(shim): gate the in-process RE introspection (DumpGameDisplayState), the handcur hand/cursor log, and the producer-tick heartbeat behind kShimDebug (false) so shipping builds stay quiet and the debug tooling is clearly separated

This commit is contained in:
kinect-bot committed 2026-11-27 00:56:37 -05:00
1 parent 03f7b01f9a
commit 10dd2859ca
1 file changed
+12 -3
+12 -3
View File
@@ -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{};