mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-21 03:54:57 +00:00
Fix MixAdd with volume. The previous volume formula completely failed with volumes >= 1.0 (0x8000). Fixes Tomb Raider Legends (GC) music.
This commit is contained in:
parent
faaaa97c9e
commit
1cecbaedce
1 changed files with 5 additions and 2 deletions
|
@ -337,8 +337,11 @@ void MixAdd(int* out, const s16* input, u16* pvol, bool ramp)
|
|||
|
||||
for (u32 i = 0; i < 32; ++i)
|
||||
{
|
||||
s64 sample = 2 * (s16)input[i] * (s16)volume;
|
||||
out[i] += (s32)(sample >> 16);
|
||||
s64 sample = input[i];
|
||||
sample *= volume;
|
||||
sample >>= 15;
|
||||
|
||||
out[i] += (s32)sample;
|
||||
volume += volume_delta;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue