diff --git a/fallback/windows-nui/src/sensor.cpp b/fallback/windows-nui/src/sensor.cpp index 0190045..ed49deb 100644 --- a/fallback/windows-nui/src/sensor.cpp +++ b/fallback/windows-nui/src/sensor.cpp @@ -86,6 +86,32 @@ void DumpGameDisplayState() { "depth[num=%u tex=0x%08X last=%u] color[num=%u tex=0x%08X last=%u]", mgr, nui, mask, committed, flags, en_depth & 0xFFu, en_color & 0xFFu, fp0, fp1, nui_status, d_num, d_tex, dedupe_d, c_num, c_tex, dedupe_c); + + // Skeleton-selection introspection: the game's orientation-validation + // (gamekdm FUN_10018570) reads a reference direction at mgr+0x20 and a gravity + // vector at mgr+0x2c; the picker writes the chosen tracked IDs to mgr+0x1684/ + // 0x1688. Logging the live values lets us reproduce the validation exactly. + uint32_t ref0 = 0, ref1 = 0, ref2 = 0, grav0 = 0, grav1 = 0, grav2 = 0; + uint32_t sel0 = 0, sel1 = 0, mode = 0, r20sel = 0; + SafeReadU32(mgr + 0x20u, &ref0); + SafeReadU32(mgr + 0x24u, &ref1); + SafeReadU32(mgr + 0x28u, &ref2); + SafeReadU32(mgr + 0x2cu, &grav0); + SafeReadU32(mgr + 0x30u, &grav1); + SafeReadU32(mgr + 0x34u, &grav2); + SafeReadU32(mgr + 0x1684u, &sel0); + SafeReadU32(mgr + 0x1688u, &sel1); + SafeReadU32(mgr + 0x17f4u, &mode); + SafeReadU32(mgr + 0x15f0u, &r20sel); // the sensor-side copy fed to SetTrackedSkeletons + auto asf = [](uint32_t u) { + float v; + std::memcpy(&v, &u, sizeof(v)); + return v; + }; + ShimLog("game-skel: ref(+20)=(%.3f,%.3f,%.3f) grav(+2c)=(%.3f,%.3f,%.3f) " + "selIDs(+1684)=[%u,%u] fedID(+15f0)=%u mode(+17f4)=%u", + asf(ref0), asf(ref1), asf(ref2), asf(grav0), asf(grav1), asf(grav2), + sel0, sel1, r20sel, mode & 0xFFu); } BOOL CALLBACK InitSensorLock(PINIT_ONCE, PVOID, PVOID*) {