Mercurial > repos > blastem
changeset 379:3218e2f8d685
Make shift value of operator output to modulation input a define
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 02 Jun 2013 22:37:48 -0700 |
parents | 92947faa258a |
children | 1c8d74f2ab0b |
files | ym2612.c |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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;