diff --git a/docs/re/structures/isl-builtins.md b/docs/re/structures/isl-builtins.md index 1572a9b..915f859 100644 --- a/docs/re/structures/isl-builtins.md +++ b/docs/re/structures/isl-builtins.md @@ -174,9 +174,38 @@ gets **0 every time**, so "immobile things get a meaningless value" does not explain the turrets either. So: ✅ a craft-class-dependent scalar in speed's range and with speed's ordering; -❌ not `set_speed` as a plain reading. **Left unnamed.** The handler writes -`[unit+196]`, initialised from `[unit+192]` at spawn — reading its consumer is -what would settle it. +❌ not `set_speed` as a plain reading. **Left unnamed.** + +#### ✅ The write side, read directly + +`0x8232C7CC` in the unit message pump switches on `[msg+36]` three ways: + +| mode | effect | +|---|---| +| 1 | `[unit+196] = [unit+192]` — restore the unit's stored default | +| 2 | `[unit+196] = [r27+13912]` — a global constant | +| 3 | `[unit+196] = [msg+40]` — the value the script passed | + +So the field has a **per-unit default at `+192`** and a distinguished global +value, and built-in 15 either sets it, restores it, or hands it the constant. +The shipped scripts only ever use mode 3: slot 8 is the double tag in +**1961/1961** call sites, so the two defaulting modes are never exercised. + +#### ❌ The consumer is NOT identified — two filters failed + +Recorded so the next attempt does not repeat them: + +* Searching the flight/AI range for `196(rN)` gives **170** hits, almost all on + unrelated structs — the same `N(rM)` trap this file already warns about. +* Narrowing to functions that touch **both** `+192` and `+196` still leaves + **50**. The pair is not distinctive either. +* `crates/sylpheed-formats/data/unit_definition_layout.txt` names offsets 192 and + 196 as `AV_PitchMinus_Max` / `AV_PitchMinus_Min` — **but that is the unit + *definition* object** (vtable `0x820af844`), not the spawned entity built-in 15 + writes to. It does not apply here, and it would be an easy wrong turn. + +What would settle it is the object's identity: pin the spawned-entity struct +first, then read `+196`'s consumers within it. ### ✅ Four built-ins are TUTORIAL-ONLY — 85 sites, every one in S18–S23