summaryrefslogtreecommitdiff
path: root/ym2612.c
diff options
context:
space:
mode:
Diffstat (limited to 'ym2612.c')
-rw-r--r--ym2612.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ym2612.c b/ym2612.c
index 1d08697..ea08c05 100644
--- a/ym2612.c
+++ b/ym2612.c
@@ -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++;