Audio: ENABLE the engine (relax dead AWE-card gate) + diagnose the real silence (task #50)
User reported never hearing any audio. Root-caused: the KB "Audio: DONE" was wrong. The OpenAL playback chain IS fully implemented (device/buffers/sources; PlayNote really calls alSourcePlay), but three gaps kept it silent: 1. GATED OFF (the "no sound" root cause): BTL4Application::MakeAudioRenderer returned NULL unless the pod's AWE_FRONT/AWE_REAR AWE32-card env vars were set -- authentic 1995 pod behavior, dead on modern hardware, so the renderer was NEVER created. FIXED: default audio ON (BT_NO_AUDIO=1 restores silence; AWE vars still force-on). Verified: the OpenAL device now opens with no env vars ([audio] device OPENED). 2. Soundbank STUB: allPresets[2][100] (btstubs.cpp) is zero-init -> PRESET_isImplemented false -> 0 buffers load. Sample data exists (AUDIO1/2.RES: EnginePower/LaserAFire/...) but the event->sample map is gone (not in the decomp). STILL OPEN. 3. No triggering: the reconstructed game never creates AudioEntities on events. STILL OPEN. So the device opens but nothing loads/plays yet -- enabling real sound needs the soundbank reconstructed + the game triggers wired (a proper audio wave). Added a BT_AUDIO_LOG trace harness across L4AUDRND/L4AUDRES/L4AUDLVL. KB corrected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d624b9b783
commit
52440e13b0
@@ -266,7 +266,15 @@ BTL4Application::SharedData
|
||||
char *front_card = getenv(AWE_FRONT_ENV_VAR); // FUN_004dee74
|
||||
char *rear_card = getenv(AWE_REAR_ENV_VAR);
|
||||
|
||||
if (front_card == NULL || rear_card == NULL)
|
||||
// AUTHENTIC 1995 gate: the pod carried TWO AWE32 cards (front/rear) and
|
||||
// audio was OFF unless both AWE_FRONT/AWE_REAR were set. Those cards don't
|
||||
// exist on modern hardware, so this check silenced audio on every machine
|
||||
// (root cause of "no sound" -- the renderer was never created).
|
||||
// MODERNIZED (task #50, 2026-07-15): default audio ON through the WinTesla
|
||||
// OpenAL renderer (the OS default output device). BT_NO_AUDIO=1 restores
|
||||
// the silent/no-renderer behavior; the AWE vars still force it on too.
|
||||
(void)front_card; (void)rear_card;
|
||||
if (getenv("BT_NO_AUDIO"))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user