Make a hack optional to fix 48KHz output mode with NewAX
This commit is contained in:
parent
0b275c20af
commit
6a1241c03e
|
@ -100,12 +100,17 @@ inline bool WritePB(u32 addr, AXPBWii &PB)
|
||||||
template<class ParamBlockType>
|
template<class ParamBlockType>
|
||||||
inline void MixAddVoice(ParamBlockType &pb,
|
inline void MixAddVoice(ParamBlockType &pb,
|
||||||
int *templbuffer, int *temprbuffer,
|
int *templbuffer, int *temprbuffer,
|
||||||
int _iSize)
|
int _iSize, bool resample = true)
|
||||||
{
|
{
|
||||||
if (pb.running)
|
if (pb.running)
|
||||||
{
|
{
|
||||||
const u32 ratio = (u32)(((pb.src.ratio_hi << 16) + pb.src.ratio_lo)
|
float ratioFactor;
|
||||||
* /*ratioFactor:*/((float)AudioInterface::GetAIDSampleRate() / (float)soundStream->GetMixer()->GetSampleRate()));
|
if (resample)
|
||||||
|
ratioFactor = (float)AudioInterface::GetAIDSampleRate() / (float)soundStream->GetMixer()->GetSampleRate();
|
||||||
|
else
|
||||||
|
ratioFactor = 1.0;
|
||||||
|
|
||||||
|
const u32 ratio = (u32)(((pb.src.ratio_hi << 16) + pb.src.ratio_lo) * ratioFactor);
|
||||||
u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo;
|
u32 sampleEnd = (pb.audio_addr.end_addr_hi << 16) | pb.audio_addr.end_addr_lo;
|
||||||
u32 loopPos = (pb.audio_addr.loop_addr_hi << 16) | pb.audio_addr.loop_addr_lo;
|
u32 loopPos = (pb.audio_addr.loop_addr_hi << 16) | pb.audio_addr.loop_addr_lo;
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ void CUCode_NewAX::ProcessPBList(u32 pb_addr)
|
||||||
VoiceHacks(pb);
|
VoiceHacks(pb);
|
||||||
|
|
||||||
MixAddVoice(pb, m_samples_left + spms * curr_ms,
|
MixAddVoice(pb, m_samples_left + spms * curr_ms,
|
||||||
m_samples_right + spms * curr_ms, spms);
|
m_samples_right + spms * curr_ms, spms, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
WritePB(pb_addr, pb);
|
WritePB(pb_addr, pb);
|
||||||
|
|
Loading…
Reference in New Issue