Fix volume mixing in DownloadAndMixWithVolume (same issue with >1.0 volumes)

This commit is contained in:
Pierre Bourdon 2012-12-19 05:56:57 +01:00
parent 2c10ca4e46
commit 071b27f0bb
1 changed files with 4 additions and 3 deletions

View File

@ -362,14 +362,15 @@ void CUCode_AX::DownloadAndMixWithVolume(u32 addr, u16 vol_main, u16 vol_auxa, u
for (u32 i = 0; i < 3; ++i)
{
int* ptr = (int*)HLEMemory_Get_Pointer(addr);
s16 volume = (s16)volumes[i];
u16 volume = volumes[i];
for (u32 j = 0; j < 3; ++j)
{
int* buffer = buffers[i][j];
for (u32 k = 0; k < 5 * 32; ++k)
{
s64 sample = 2 * (s32)Common::swap32(*ptr++) * volume;
buffer[k] += (s32)(sample >> 16);
s64 sample = (s64)(s32)Common::swap32(*ptr++);
sample *= volume;
buffer[k] += (s32)(sample >> 15);
}
}
}