From d58bae77ea1b03d59fb1ce4066269ecc0c1e6302 Mon Sep 17 00:00:00 2001 From: transistor Date: Sat, 8 Oct 2022 16:21:41 -0700 Subject: [PATCH] Fixed the biasing of DAC data in ym2612 It was using the DAC value as a positive offset, which makes a slight click at the start and end of the SEGA voice at the start of a game. now subtracts half the value and amplifies it a bit so that it crosses the 0 value --- emulator/peripherals/yamaha/src/ym2612.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emulator/peripherals/yamaha/src/ym2612.rs b/emulator/peripherals/yamaha/src/ym2612.rs index be51e71..1342f62 100644 --- a/emulator/peripherals/yamaha/src/ym2612.rs +++ b/emulator/peripherals/yamaha/src/ym2612.rs @@ -272,7 +272,7 @@ impl Steppable for Ym2612 { if self.dac_enabled { if let Some(data) = self.dac.pop_front() { - sample += data as f32 / 255.0; + sample += ((data as f32 - 128.0) / 255.0) * 2.0; } } else if self.channels[6].on != 0 { sample += self.channels[6].get_sample();