Skip to content

Commit

Permalink
Another day, another sync bug. Don't leave the m_nNextOffset set to t…
Browse files Browse the repository at this point in the history
…he old value! Fixes the bug in Defender where the engine noise seems to change pitch after certain other sound effects: the reason was that the frequencies for noise generators were being set in the order offset-then-octave order while sync bit was set. For clarity and avoinding more bugs, explicitly clear bIgnoreOffsetData too; and also make the same changes in the SetFreqOctave path (don't leave the m_nNextOctave set to the old value either)
  • Loading branch information
davidhooper-bpi committed Jul 14, 2019
1 parent 30b2406 commit aced95d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SAAFreq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ void CSAAFreq::SetFreqOffset(BYTE nOffset)
{
// updates straightaway if m_bSync
m_bNewData=false;
m_bIgnoreOffsetData = false;
m_nCurrentOffset = nOffset;
m_nNextOffset = nOffset;
m_nCurrentOctave = m_nNextOctave;
SetAdd();
}
Expand All @@ -80,7 +82,9 @@ void CSAAFreq::SetFreqOctave(BYTE nOctave)
{
// updates straightaway if m_bSync
m_bNewData=false;
m_bIgnoreOffsetData = false;
m_nCurrentOctave = nOctave;
m_nNextOctave = nOctave;
m_nCurrentOffset = m_nNextOffset;
SetAdd();
}
Expand Down

0 comments on commit aced95d

Please sign in to comment.