From 6a41525c41610a5b5c304eaed6de42114266b6ec Mon Sep 17 00:00:00 2001 From: "Claude (auto-RE)" Date: Wed, 29 Jul 2026 06:05:13 +0000 Subject: [PATCH] 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) --- crates/sylpheed-formats/examples/idxd_tokens.rs | 8 +++++++- tools/re-capture/gmem.py | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/sylpheed-formats/examples/idxd_tokens.rs b/crates/sylpheed-formats/examples/idxd_tokens.rs index 96be88b..4cde36c 100644 --- a/crates/sylpheed-formats/examples/idxd_tokens.rs +++ b/crates/sylpheed-formats/examples/idxd_tokens.rs @@ -57,7 +57,13 @@ fn main() { let Ok(bytes) = pak.read(entry) else { continue }; let Ok(obj) = IdxdObject::parse(&bytes) else { continue }; let toks = obj.tokens(); - if !toks.iter().any(|t| t.starts_with("Weapon_")) { + // Only entries that actually declare one of the requested sub-record + // types (the pool-start heuristic can prefix one stray byte, so match a + // short suffix rather than equality -- same rule as the splitter below). + if !toks + .iter() + .any(|t| types.iter().any(|ty| t == ty || (t.ends_with(ty.as_str()) && t.len() <= ty.len() + 2))) + { continue; } diff --git a/tools/re-capture/gmem.py b/tools/re-capture/gmem.py index f62a7ee..c00b920 100644 --- a/tools/re-capture/gmem.py +++ b/tools/re-capture/gmem.py @@ -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_")]