# HG changeset patch # User Mike Pavone # Date 1370237868 25200 # Node ID 3218e2f8d68599b0f854248774f915dab47e748a # Parent 92947faa258a79c15d8f5aced8cb2ca0d9adac3c Make shift value of operator output to modulation input a define diff -r 92947faa258a -r 3218e2f8d685 ym2612.c --- a/ym2612.c Sun Jun 02 22:33:27 2013 -0700 +++ b/ym2612.c Sun Jun 02 22:37:48 2013 -0700 @@ -156,6 +156,7 @@ } #define YM_VOLUME_DIVIDER 2 +#define YM_MOD_SHIFT 4 void ym_run(ym2612_context * context, uint32_t to_cycle) { @@ -277,21 +278,21 @@ case 0: case 2: //modulate by operator 2 - mod = context->operators[op+1].output >> 4; + mod = context->operators[op+1].output >> YM_MOD_SHIFT; break; case 1: //modulate by operator 1+2 - mod = (context->operators[op-1].output + context->operators[op+1].output) >> 4; + mod = (context->operators[op-1].output + context->operators[op+1].output) >> YM_MOD_SHIFT; break; case 5: //modulate by operator 1 - mod = context->operators[op-1].output >> 4; + mod = context->operators[op-1].output >> YM_MOD_SHIFT; } break; case 2://Operator 2 if (chan->algorithm != 1 && chan->algorithm != 2 || chan->algorithm != 7) { //modulate by Operator 1 - mod = context->operators[op-2].output >> 4; + mod = context->operators[op-2].output >> YM_MOD_SHIFT; } break; case 3://Operator 4 @@ -301,19 +302,19 @@ case 1: case 4: //modulate by operator 3 - mod = context->operators[op-2].output >> 4; + mod = context->operators[op-2].output >> YM_MOD_SHIFT; break; case 2: //modulate by operator 1+3 - mod = (context->operators[op-3].output + context->operators[op-2].output) >> 4; + mod = (context->operators[op-3].output + context->operators[op-2].output) >> YM_MOD_SHIFT; break; case 3: //modulate by operator 2+3 - mod = (context->operators[op-1].output + context->operators[op-2].output) >> 4; + mod = (context->operators[op-1].output + context->operators[op-2].output) >> YM_MOD_SHIFT; break; case 5: //modulate by operator 1 - mod = context->operators[op-3].output >> 4; + mod = context->operators[op-3].output >> YM_MOD_SHIFT; break; } break;