Skip to content

Commit

Permalink
sound/gew.cpp: correct interpolation around sample loop point (fixes m…
Browse files Browse the repository at this point in the history
  • Loading branch information
devinacker committed Jan 20, 2024
1 parent 43e0059 commit f86f57d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/devices/sound/gew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,18 +593,19 @@ void gew_pcm_device::sound_stream_update(sound_stream &stream, std::vector<read_
}

slot.m_offset += step;

if (spos ^ (slot.m_offset >> TL_SHIFT))
{
slot.m_prev_sample = csample;
}

if (slot.m_offset >= (slot.m_sample.m_end << TL_SHIFT))
{
slot.m_offset -= (slot.m_sample.m_end - slot.m_sample.m_loop) << TL_SHIFT;
// DD-9 expects the looped silence at the end of some samples to be the same whether reversed or not
slot.m_reverse = false;
}

if (spos ^ (slot.m_offset >> TL_SHIFT))
{
slot.m_prev_sample = csample;
}

if ((slot.m_total_level >> TL_SHIFT) != slot.m_dest_total_level)
{
slot.m_total_level += slot.m_total_level_step;
Expand Down

0 comments on commit f86f57d

Please sign in to comment.