mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +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)
|
for (u32 i = 0; i < 32; ++i)
|
||||||
{
|
{
|
||||||
s64 sample = 2 * (s16)input[i] * (s16)volume;
|
s64 sample = input[i];
|
||||||
out[i] += (s32)(sample >> 16);
|
sample *= volume;
|
||||||
|
sample >>= 15;
|
||||||
|
|
||||||
|
out[i] += (s32)sample;
|
||||||
volume += volume_delta;
|
volume += volume_delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue