diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index 0c35f3015f..cf35bbef9f 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -197,9 +197,9 @@ u32 sceSasSetPause(u32 core, int voicebit, int pause) return 0; } -u32 sceSasSetVolume(u32 core, int voiceNum, int l, int r, int el, int er) +u32 sceSasSetVolume(u32 core, int voiceNum, int leftVol, int rightVol, int effectLeftVol, int effectRightVol) { - DEBUG_LOG(HLE,"sceSasSetVolume(%08x, %i, %i, %i, %i, %i)", core, voiceNum, l, r, el, er); + DEBUG_LOG(HLE,"sceSasSetVolume(%08x, %i, %i, %i, %i, %i)", core, voiceNum, leftVol, rightVol, effectLeftVol, effectRightVol); if (voiceNum >= PSP_SAS_VOICES_MAX || voiceNum < 0) { WARN_LOG(HLE, "%s: invalid voicenum %d", __FUNCTION__, voiceNum); @@ -207,8 +207,10 @@ u32 sceSasSetVolume(u32 core, int voiceNum, int l, int r, int el, int er) } SasVoice &v = sas->voices[voiceNum]; - v.volumeLeft = l; - v.volumeRight = r; + v.volumeLeft = (leftVol << 3); + v.volumeRight = (rightVol << 3); + v.effectLeft = effectLeftVol; + v.effectRight = effectRightVol; return 0; } diff --git a/Core/HW/SasAudio.cpp b/Core/HW/SasAudio.cpp index 27ca606715..ea43814e50 100644 --- a/Core/HW/SasAudio.cpp +++ b/Core/HW/SasAudio.cpp @@ -284,10 +284,10 @@ void SasInstance::Mix(u32 outAddr) { // We mix into this 32-bit temp buffer and clip in a second loop // Ideally, the shift right should be there too but for now I'm concerned about // not overflowing. - mixBuffer[i * 2] += sample * voice.volumeLeft >> 12; - mixBuffer[i * 2 + 1] += sample * voice.volumeRight >> 12; - sendBuffer[i * 2] += sample * voice.volumeLeftSend >> 12; - sendBuffer[i * 2 + 1] += sample * voice.volumeRightSend >> 12; + mixBuffer[i * 2] += sample * voice.volumeLeft >> 15; + mixBuffer[i * 2 + 1] += sample * voice.volumeRight >> 15; + sendBuffer[i * 2] += sample * voice.volumeLeftSend >> 15; + sendBuffer[i * 2 + 1] += sample * voice.volumeRightSend >> 15; voice.envelope.Step(); } voice.sampleFrac = sampleFrac; diff --git a/Core/HW/SasAudio.h b/Core/HW/SasAudio.h index 6a05543995..7ae8e8cca4 100644 --- a/Core/HW/SasAudio.h +++ b/Core/HW/SasAudio.h @@ -199,6 +199,8 @@ struct SasVoice int volumeRight; int volumeLeftSend; // volume to "Send" (audio-lingo) to the effects processing engine, like reverb int volumeRightSend; + int effectLeft; + int effectRight; s16 resampleHist[2]; ADSREnvelope envelope;