paavohtl Claude Opus 4.6 (1M context) commited on
Commit
2516121
Β·
1 Parent(s): 886847c

feat: replace DSSound slots 7, 8 (set_master_volume, set_channel_volume)

Browse files

Add VOLUME_DB_TABLE (64 i16 entries from WA .rdata 0x6A6A60) and
volume_to_db() helper for fixed-point β†’ dB attenuation conversion.

Slot 7: iterates channel descs, computes combined master*channel volume,
calls IDirectSoundBuffer::SetVolume with dB from lookup table.

Slot 8: per-channel volume with flag-dependent master scaling.

Rename _field_10 β†’ channel_volume (per-channel volume, confirmed from
slot 8 assembly storing the clamped value there).

19/24 DSSound vtable slots now Rust.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

3 files changed +112 -7
Files changed (3)
crates/openwa-core/src/audio/dssound.rs+102-5
crates/openwa-core/src/audio/mod.rs+1
crates/openwa-wormkit/src/replacements/sound.rs+9-2