Skip to content

Commit

Permalink
Fix YM2413 volume
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 14, 2024
1 parent d622f8f commit d4e65ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void Audio::Reset(bool bPAL)
m_pYM2413->Enable(false);
m_bPSGEnabled = true;
m_pApu->reset();
m_pApu->volume(0.4);
m_pApu->volume(1.0);
m_pBuffer->clear();
m_pBuffer->clock_rate(m_bPAL ? GS_MASTER_CLOCK_PAL : GS_MASTER_CLOCK_NTSC);
m_pYM2413->Reset(m_bPAL ? GS_MASTER_CLOCK_PAL : GS_MASTER_CLOCK_NTSC);
Expand Down Expand Up @@ -107,7 +107,7 @@ void Audio::EndFrame(s16* pSampleBuffer, int* pSampleCount)
if (!m_bMute)
{
pSampleBuffer[i] += m_bPSGEnabled ? m_pSampleBuffer[(i >= psg_count) ? psg_count-1 : i] : 0;
pSampleBuffer[i] += (m_bYM2413Enabled && !m_bYM2413ForceDisabled) ? m_pYM2413Buffer[i] : 0;
pSampleBuffer[i] += (m_bYM2413Enabled && !m_bYM2413ForceDisabled) ? m_pYM2413Buffer[i] * 4 : 0;
}
}
}
Expand Down Expand Up @@ -145,6 +145,6 @@ void Audio::LoadState(std::istream& stream)
m_pYM2413->LoadState(stream);

m_pApu->reset();
m_pApu->volume(0.4);
m_pApu->volume(1.0);
m_pBuffer->clear();
}

0 comments on commit d4e65ab

Please sign in to comment.