From 5b086e103e8f1744868f3c9eeb4e0de57557dc33 Mon Sep 17 00:00:00 2001 From: cam900 Date: Tue, 2 Apr 2024 20:44:37 +0900 Subject: [PATCH] Fix PSG output a bit --- src/engine/platform/sound/nds.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/sound/nds.cpp b/src/engine/platform/sound/nds.cpp index fa44542b2..e0b138878 100644 --- a/src/engine/platform/sound/nds.cpp +++ b/src/engine/platform/sound/nds.cpp @@ -347,7 +347,7 @@ namespace nds_sound_emu case 3: // PSG or Noise m_sample = 0; 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 m_sample = m_lfsr_out; break; @@ -398,7 +398,7 @@ namespace nds_sound_emu if (bitfield(m_lfsr, 0)) { m_lfsr = (m_lfsr >> 1) ^ 0x6000; - m_lfsr_out = -0x8000; + m_lfsr_out = -0x7fff; } else {