mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 03:46:42 +01: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;
|
s16* pattern = m_const_patterns.data() + pattern_offset;
|
||||||
|
|
||||||
u32 pos = vpb->current_pos_frac << 6; // log2(PATTERN_SIZE)
|
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)
|
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];
|
(*buffer)[i] = pattern[pos >> 16];
|
||||||
pos = (pos + step) % (PATTERN_SIZE << 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;
|
vpb->current_pos_frac = pos >> 6;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case VPB::SRC_PCM8_FROM_ARAM:
|
case VPB::SRC_PCM8_FROM_ARAM:
|
||||||
DownloadPCMSamplesFromARAM<s8>(raw_input_samples.data() + 4, vpb,
|
DownloadPCMSamplesFromARAM<s8>(raw_input_samples.data() + 4, vpb,
|
||||||
NeededRawSamplesCount(*vpb));
|
NeededRawSamplesCount(*vpb));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user