benilla-re systems structs docs

s_ambienceCategoryVolume

global · sound

Address
0x87cefc · 4 bytes, up to 0x87ceff
Type
float
Meaning
Holds the Ambience category factor, 0.5 until the CVar handler sets it
Confidence
verified, proof one
Finding
sound/engine#volume-of-a-sound

Finding: Volume of a sound in sound: the engine

Sound::SetVolume2(v) stores v at +0x74 and, with a channel, calls FSOUND_SetVolume(ch, ftol(c · v · g · 255.0)) with g the distance gain +0x78 and c the MusicVolume factor for flag 0x2, else AmbienceVolume for 0x8, else none for 0x10, else SoundVolume. The product is in the x87 register and __ftol truncates. Sound::SetVolume(level) passes level · (1/255). Sound::UpdateVolume reapplies +0x74, or level 0 for a sound on the fade list. 0x7a5d70 reads a level back as the low byte of the float v · 255 + 512.5: it rounds, wraps once v · 255 ≥ 255.5 (v ≥ 1.00196), and holds only while v · 255 + 512.5 < 1024.

The derivation is in the doc.