diag(windows-nui): read the game's live menu cursor (DAT_103d2bb8 controller +0x108/+0x10c) to correlate hand->cursor directly
This commit is contained in:
1 parent
256a9056c0
commit
4981a4c768
1 file changed
+24
@@ -178,6 +178,30 @@ void DumpGameDisplayState() {
|
||||
ShimLog("game-skel4: mgrFrame num=%u flags=0x%X SkelData0.state=%u id=%u "
|
||||
"pos=(%.3f,%.3f,%.3f)",
|
||||
fnum, fflags, st, tid, asf(px), asf(py), asf(pz));
|
||||
|
||||
// Live menu cursor: gamekdm global DAT_103d2bb8 is the cursor-controller
|
||||
// object pointer; FUN_1007fbf0 stores the 1P cursor at (*obj)+0x108/+0x10c and
|
||||
// the 2P cursor at +0x110/+0x114 (see FUN_10073b60 reading +0x108). Reading it
|
||||
// live lets us correlate our published hand against the game's actual cursor.
|
||||
uint32_t curobj = 0;
|
||||
SafeReadU32(base + 0x3d2bb8u, &curobj);
|
||||
if (curobj != 0) {
|
||||
uint32_t inner = 0;
|
||||
SafeReadU32(curobj, &inner);
|
||||
uint32_t dx = 0, dy = 0, dx2 = 0, dy2 = 0, ix = 0, iy = 0;
|
||||
SafeReadU32(curobj + 0x108u, &dx);
|
||||
SafeReadU32(curobj + 0x10cu, &dy);
|
||||
SafeReadU32(curobj + 0x110u, &dx2);
|
||||
SafeReadU32(curobj + 0x114u, &dy2);
|
||||
if (inner != 0) {
|
||||
SafeReadU32(inner + 0x108u, &ix);
|
||||
SafeReadU32(inner + 0x10cu, &iy);
|
||||
}
|
||||
ShimLog("game-cursor: obj=0x%08X inner=0x%08X direct1P=(%.1f,%.1f) "
|
||||
"direct2P=(%.1f,%.1f) innerD1P=(%.1f,%.1f)",
|
||||
curobj, inner, asf(dx), asf(dy), asf(dx2), asf(dy2), asf(ix),
|
||||
asf(iy));
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CALLBACK InitSensorLock(PINIT_ONCE, PVOID, PVOID*) {
|
||||
|
||||
Reference in new issue
Block a user