summaryrefslogtreecommitdiff
path: root/ym2612.c
diff options
context:
space:
mode:
Diffstat (limited to 'ym2612.c')
-rw-r--r--ym2612.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ym2612.c b/ym2612.c
index a0ec8e0..4ba38ae 100644
--- a/ym2612.c
+++ b/ym2612.c
@@ -595,7 +595,10 @@ uint32_t ym_calc_phase_inc(ym2612_context * context, ym_operator * operator, uin
uint32_t inc, detune;
if (chan_num == 2 && context->ch3_mode && (op < (2*4 + 3))) {
//supplemental fnum registers are in a different order than normal slot paramters
- int index = (op-2*4) ^ 2;
+ int index = op-2*4;
+ if (index < 2) {
+ index ^= 1;
+ }
inc = context->ch3_supp[index].fnum;
if (channel->pms) {
inc = inc * 2 + lfo_pm_table[(inc & 0x7F0) * 16 + channel->pms + context->lfo_pm_step];