mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
ZeldaHLE: really fix the constant pattern variable step computation.
This time tested by comparing pattern indexes across LLE and HLE with the same inputs. Matches on the 3-4 test cases I made.
This commit is contained in:
parent
fddb3f0d3c
commit
c6c0f69c6b
@ -1341,21 +1341,22 @@ void ZeldaAudioRenderer::LoadInputSamples(MixingBuffer* buffer, VPB* vpb)
|
||||
s16* pattern = m_const_patterns.data() + pattern_offset;
|
||||
|
||||
u32 pos = vpb->current_pos_frac << 6; // log2(PATTERN_SIZE)
|
||||
u32 step = vpb->resampling_ratio << 5;
|
||||
|
||||
for (size_t i = 0; i < buffer->size(); ++i)
|
||||
{
|
||||
u32 step = vpb->resampling_ratio << 5;
|
||||
if (pattern_info.variable_step)
|
||||
step += (u32)((u16)m_buf_back_right[i] * vpb->resampling_ratio) >> 26;
|
||||
|
||||
(*buffer)[i] = pattern[pos >> 16];
|
||||
pos = (pos + step) % (PATTERN_SIZE << 16);
|
||||
if (pattern_info.variable_step)
|
||||
pos = ((pos << 10) + m_buf_back_right[i] * vpb->resampling_ratio) >> 10;
|
||||
}
|
||||
|
||||
vpb->current_pos_frac = pos >> 6;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
case VPB::SRC_PCM8_FROM_ARAM:
|
||||
DownloadPCMSamplesFromARAM<s8>(raw_input_samples.data() + 4, vpb,
|
||||
NeededRawSamplesCount(*vpb));
|
||||
|
Loading…
Reference in New Issue
Block a user