Skip to content

Commit

Permalink
Fix volume mixing in DownloadAndMixWithVolume (same issue with >1.0 v…
Browse files Browse the repository at this point in the history
…olumes)
  • Loading branch information
delroth committed Dec 19, 2012
1 parent 2c10ca4 commit 071b27f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 071b27f

Please sign in to comment.