summaryrefslogtreecommitdiff
path: root/ym2612.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-03-26 22:34:41 -0700
committerMichael Pavone <pavone@retrodev.com>2019-03-26 22:34:41 -0700
commit3f867b2206be833ee764acc5cfae4c0ce2780da1 (patch)
tree28b5a9fecd1f96038619a105749bc046e134ced5 /ym2612.c
parent214af23bafaa8c40fd98c117904703fc47a9aaa3 (diff)
Zero offset should also impact output channels that a channel is panned away from
Diffstat (limited to 'ym2612.c')
-rw-r--r--ym2612.c12
1 files changed, 12 insertions, 0 deletions
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);