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
This commit is contained in:
transistor 2022-10-08 16:21:41 -07:00
parent 0876d85626
commit d58bae77ea

View File

@ -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();