diff options
Diffstat (limited to 'ym2612.c')
-rw-r--r-- | ym2612.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -298,6 +298,10 @@ void ym_run(ym2612_context * context, uint32_t to_cycle) ym_operator * operator = context->operators + op; ym_channel * channel = context->channels + op/4; uint8_t rate; + if (operator->env_phase == PHASE_DECAY && operator->envelope >= operator->sustain_level) { + //operator->envelope = operator->sustain_level; + operator->env_phase = PHASE_SUSTAIN; + } for(;;) { rate = operator->rates[operator->env_phase]; if (rate) { @@ -348,10 +352,6 @@ void ym_run(ym2612_context * context, uint32_t to_cycle) if (operator->envelope > MAX_ENVELOPE) { operator->envelope = MAX_ENVELOPE; } - if (operator->env_phase == PHASE_DECAY && operator->envelope >= operator->sustain_level) { - //operator->envelope = operator->sustain_level; - operator->env_phase = PHASE_SUSTAIN; - } } } context->current_env_op++; |