Fix PSG output a bit

This commit is contained in:
cam900 2024-04-02 20:44:37 +09:00
parent 68612bc777
commit 5b086e103e

View file

@ -347,7 +347,7 @@ namespace nds_sound_emu
case 3: // PSG or Noise case 3: // PSG or Noise
m_sample = 0; m_sample = 0;
if (m_psg) // psg if (m_psg) // psg
m_sample = (duty() == 7) ? -0x8000 : ((m_cur_bitaddr < s32(u32(7) - duty())) ? -0x8000 : 0x7fff); m_sample = (duty() == 7) ? -0x7fff : ((m_cur_bitaddr < s32(u32(7) - duty())) ? -0x7fff : 0x7fff);
else if (m_noise) // noise else if (m_noise) // noise
m_sample = m_lfsr_out; m_sample = m_lfsr_out;
break; break;
@ -398,7 +398,7 @@ namespace nds_sound_emu
if (bitfield(m_lfsr, 0)) if (bitfield(m_lfsr, 0))
{ {
m_lfsr = (m_lfsr >> 1) ^ 0x6000; m_lfsr = (m_lfsr >> 1) ^ 0x6000;
m_lfsr_out = -0x8000; m_lfsr_out = -0x7fff;
} }
else else
{ {