From 03f0c21484354439f81a9a500b8a1168c643ff49 Mon Sep 17 00:00:00 2001 From: arcattack Date: Wed, 15 Jul 2026 19:40:44 -0500 Subject: [PATCH] KB: audio in-game triggering works (mech-level); subsystem audio pending subsystem waves (task #50) Co-Authored-By: Claude Opus 4.8 (1M context) --- context/wintesla-port.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/context/wintesla-port.md b/context/wintesla-port.md index 55afbaa..c9a6606 100644 --- a/context/wintesla-port.md +++ b/context/wintesla-port.md @@ -30,12 +30,25 @@ on top of it. Full detail: `docs/PROGRESS_LOG.md §5b, §8`. `AWE_FRONT`/`AWE_REAR` env-var gate in `MakeAudioRenderer` was **relaxed to default-on** (`BT_NO_AUDIO=1` disables). **Soundbank recovered**: 241 samples cracked from `AUDIO1/2.RES` (SF2 v1.0) by `tools/sf2extract.py` → `content/AUDIO/*.wav` + the `allPresets[2][128]` table (`audiopresets.cpp`, - replacing the zero-init btstubs stub); all 241 load (`alErr=0`). **The ONLY remaining gap**: the - reconstructed game **never creates AudioEntities** — nothing triggers `PlayNote` on weapon fire / - footsteps / engine / explosion during play, so gameplay is still silent (a `BT_AUDIO_TEST` hook plays - buffer0 as proof-of-life). Diagnostic harness: `BT_AUDIO_LOG` traces the chain; `BT_AUDIO_TEST` plays - a sample. NOTE: the `AUDIO1/2.RES` were SF2 v1.0 (16-byte shdr records; sample rate assumed 22050 Hz - — may need tuning if pitch is off). + replacing the zero-init btstubs stub); all 241 load (`alErr=0`). **In-game triggering now WORKS** (commit 7b1e469): enabling audio unlocked + `L4AudioRenderer::CreateEntityAudioObjects`, which binds `AudioStateWatcher`s to entity/subsystem + state attrs BY NAME (the **attribute-pointer** databinding, same as gauges) and calls + `AddAudioWatcher` on the resolved `StateIndicator`. The reconstruction had pointed the Mech's state + attrs at the scalar read-pad `attrPad` (fine for a gauge that READs a value, fatal for a state watcher + that calls a METHOD → AV in `SChainOf::Add` on 0xCDCDCDCD). FIXED: the Mech's `AnimationState`/ + `ReplicantAnimationState` (driven from `SetBodyAnimation`) and `CollisionState` (driven from + `ProcessCollision` via `collisionTemporaryState`) are now real `StateIndicator` members — **verified: + walking fires `SetupPatch`+`PlayNote`/`alSourcePlay` (footstep/gait patches 78/80/116)**. So mech + movement/animation/collision audio is live. **Remaining for 100%**: audio also binds ~40 attrs across + ~15 subsystems still stubbed as `ReconSubsystemStub` (Generators A-D `GeneratorState`/`GeneratorOn`, + Condensers 1-6 `CondenserState`, Myomers/Avionics/all `ReportLeak`, Torso `SpeedOfTorsoHorizontal`/ + `MotionState`, Reservoir/ControlsMapper …) — those need their state models + attribute tables + reconstructed (a per-subsystem audio wave). Until then, **bring-up guards** [T3, temporary, + self-clearing] keep audio-on stable: a NULL subsystem attr → inert pad (was a fatal `Fail`); an + `AudioStateWatcher` on an unconstructed indicator → skip (was an AV). Both pass automatically once the + subsystem is built. Diagnostics: `BT_AUDIO_LOG` (chain + skips/redirects), `BT_ATTRBIND_LOG` (every + attr bind), `BT_AUDIO_TEST` (proof-of-life buffer0). NOTE: `AUDIO1/2.RES` were SF2 v1.0 (16-byte shdr; + sample rate assumed 22050 Hz — may need tuning if pitch is off). - **L4 HAL on Windows + the VS build system: DONE.** [T1] - **Red Planet game logic: COMPLETE & buildable** — `VTV/VTVMPPR/WEAPSYS/...`. RP is at/near playable. [T1] - **Multiplayer: the DOS `NETNUB` driver is already replaced by a ~3.5k-line WinSock2 TCP