re: generalize the two capture tools beyond weapons

idxd_tokens took the sub-record type list as an argument already but still
hard-filtered entries to those declaring a `Weapon_*` id, so it could not be
pointed at another schema. Filter on the requested type names instead -- it now
splits `EnumUnit` (Generic/Maneuver/Shield/Explosion/Frame/Turret/...) too.

gmem: honour $GMEM_FILE. `cp --sparse=always /dev/shm/xenia_memory_* snap.bin`
takes ~2 s and reads identically, which matters because a running Canary pegs
every core under lavapipe and makes repeated live reads stall unpredictably.

Groundwork for the craft (UNIT) stats. Not a finding yet: in menus only the
player craft's *name* is resident -- the flight-model object is not instantiated
until a mission loads, so that needs an in-mission snapshot.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-29 06:05:13 +00:00
parent 9daac6f1f0
commit 6a41525c41
2 changed files with 13 additions and 1 deletions

View File

@@ -61,6 +61,12 @@ def primary_va(off):
def mem_path():
# A snapshot (`cp --sparse=always /dev/shm/xenia_memory_* snap.bin`, ~2 s)
# reads identically and does not contend with the running emulator, which
# pegs every core under lavapipe. Point $GMEM_FILE at one to work offline.
env = os.environ.get("GMEM_FILE")
if env:
return env
if len(sys.argv) > 1 and sys.argv[1].startswith("/dev/shm/"):
return sys.argv.pop(1)
cands = [f"/dev/shm/{n}" for n in os.listdir("/dev/shm") if n.startswith("xenia_memory_")]