From 3f867b2206be833ee764acc5cfae4c0ce2780da1 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 26 Mar 2019 22:34:41 -0700 Subject: Zero offset should also impact output channels that a channel is panned away from --- ym2612.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ym2612.c') diff --git a/ym2612.c b/ym2612.c index e7301d9..f3cd5ef 100644 --- a/ym2612.c +++ b/ym2612.c @@ -592,9 +592,21 @@ void ym_run(ym2612_context * context, uint32_t to_cycle) } if (context->channels[i].lr & 0x80) { left += (value * context->volume_mult) / context->volume_div; + } else if (context->zero_offset) { + if (value >= 0) { + left += (context->zero_offset * context->volume_mult) / context->volume_div; + } else { + left -= (context->zero_offset * context->volume_mult) / context->volume_div; + } } if (context->channels[i].lr & 0x40) { right += (value * context->volume_mult) / context->volume_div; + } else if (context->zero_offset) { + if (value >= 0) { + right += (context->zero_offset * context->volume_mult) / context->volume_div; + } else { + right -= (context->zero_offset * context->volume_mult) / context->volume_div; + } } } render_put_stereo_sample(context->audio, left, right); -- cgit v1.2.3