acdream/tools/cdb/find-cell-list-capture.cdb
Erik b35e491f12 test(p0): retail find_cell_list trace parser + cdb value-capture tooling
P0 Task 5. RetailTrace parses the [fcl] golden format (seed/pos/picked,
RetailCellPick); 4 TDD tests green. find-cell-list-capture.cdb targets
CPhysicsObj::change_cell (commit-on-diff) to capture retail's accepted
membership sequence at the doorway; README is the operator runbook
(dt offset verification + decode_retail_hex float decode). The live run
is P0's one user-gated step (Task 6 mines existing traces first).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 14:26:24 +02:00

42 lines
2.6 KiB
Text

$$ ============================================================================
$$ find-cell-list-capture.cdb — P0 conformance retail golden capture
$$ ----------------------------------------------------------------------------
$$ Captures retail's ACCEPTED membership decision at the cottage doorway so we
$$ can pin acdream's CellTransit.FindCellList against it (P0 Task 6, the P1 gate).
$$
$$ Emits one line per accepted cell change in the golden format the parser reads
$$ (tests/AcDream.Core.Tests/Conformance/RetailTrace.cs):
$$ [fcl] seed=0xHHHHHHHH px=0x<hex> py=0x<hex> pz=0x<hex> picked=0xHHHHHHHH
$$ where seed = the cell the player was in (old), picked = the cell committed (new),
$$ and px/py/pz = the player world origin (raw IEEE-754 hex; decode offline with
$$ tools/cdb/decode_retail_hex.py, then write decimals into the golden fixture).
$$
$$ Target: CPhysicsObj::change_cell @ 0x00513390 (pc:281192) — commit-on-diff.
$$ It fires ONLY on an accepted cell transition, so the doorway crossing yields a
$$ short, clean sequence (e.g. 0031 -> 0170 -> 0171), not a per-tick flood.
$$
$$ thiscall: this (CPhysicsObj*) = @ecx ; arg new_cell (CObjCell*) = poi(@esp+4)
$$
$$ OFFSETS BELOW ARE PLACEHOLDERS — VERIFY LIVE (see README). At the first break:
$$ dt acclient!CPhysicsObj @ecx $$ find m_position (Frame/Position) + cell
$$ dt acclient!CObjCell poi(@esp+4) $$ find cell_id offset
$$ dt acclient!Position <m_position> $$ find origin (x,y,z) float offsets
$$ then edit CELLID_OFF / CELLPTR_OFF / POS_OFF and re-run.
$$ ============================================================================
.logopen C:\Users\erikn\source\repos\acdream\find-cell-list-capture.log
.sympath C:\Users\erikn\source\repos\acdream\refs
.symopt+ 0x40
.reload /f acclient.exe
$$ ---- EDIT THESE after the dt dumps (hex byte offsets) ----------------------
r $t4 = 0x18 $$ CELLID_OFF : CObjCell.cell_id (acclient.h:30938 — verify)
r $t5 = 0x08 $$ CELLPTR_OFF : CPhysicsObj.cell (current cell ptr — verify)
r $t6 = 0x1C $$ POS_OFF : CPhysicsObj.m_position.origin.x (verify; y=+4, z=+8)
$$ ---------------------------------------------------------------------------
r $t0 = 0
bp acclient!CPhysicsObj::change_cell "r $t0 = @$t0 + 1; r $t1 = poi(@ecx+@$t5); r $t2 = poi(@esp+4); .printf /D \"[fcl] seed=0x%08x px=0x%08x py=0x%08x pz=0x%08x picked=0x%08x\\n\", poi(@$t1+@$t4), poi(@ecx+@$t6), poi(@ecx+@$t6+4), poi(@ecx+@$t6+8), poi(@$t2+@$t4); .if (@$t0 >= 400) { .printf /D \"=== DETACH after %d cell changes ===\\n\", @$t0; qd } .else { gc }"
.printf \"find-cell-list capture armed (change_cell). Walk SLOWLY in/out of the cottage doorway now.\\n\"
g