aboutsummaryrefslogtreecommitdiff
path: root/src/chips/opal/opal.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chips/opal/opal.hpp')
-rw-r--r--src/chips/opal/opal.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/chips/opal/opal.hpp b/src/chips/opal/opal.hpp
index c383bd5..e13dd28 100644
--- a/src/chips/opal/opal.hpp
+++ b/src/chips/opal/opal.hpp
@@ -953,11 +953,11 @@ int16_t Opal::Operator::Output(uint16_t /*keyscalenum*/, uint32_t phase_step, in
// Attack stage
case EnvAtt: {
+ uint16_t add = ((AttackAdd >> AttackTab[Master->Clock >> AttackShift & 7]) * ~EnvelopeLevel) >> 3;
if (AttackRate == 0)
- break;
+ add = 0;
if (AttackMask && (Master->Clock & AttackMask))
- break;
- uint16_t add = ((AttackAdd >> AttackTab[Master->Clock >> AttackShift & 7]) * ~EnvelopeLevel) >> 3;
+ add = 0;
EnvelopeLevel += add;
if (EnvelopeLevel <= 0) {
EnvelopeLevel = 0;
@@ -968,11 +968,11 @@ int16_t Opal::Operator::Output(uint16_t /*keyscalenum*/, uint32_t phase_step, in
// Decay stage
case EnvDec: {
+ uint16_t add = DecayAdd >> DecayTab[Master->Clock >> DecayShift & 7];
if (DecayRate == 0)
- break;
+ add = 0;
if (DecayMask && (Master->Clock & DecayMask))
- break;
- uint16_t add = DecayAdd >> DecayTab[Master->Clock >> DecayShift & 7];
+ add = 0;
EnvelopeLevel += add;
if (EnvelopeLevel >= SustainLevel) {
EnvelopeLevel = SustainLevel;
@@ -991,11 +991,11 @@ int16_t Opal::Operator::Output(uint16_t /*keyscalenum*/, uint32_t phase_step, in
// Release stage
case EnvRel: {
+ uint16_t add = ReleaseAdd >> ReleaseTab[Master->Clock >> ReleaseShift & 7];
if (ReleaseRate == 0)
- break;
+ add = 0;
if (ReleaseMask && (Master->Clock & ReleaseMask))
- break;
- uint16_t add = ReleaseAdd >> ReleaseTab[Master->Clock >> ReleaseShift & 7];
+ add = 0;
EnvelopeLevel += add;
if (EnvelopeLevel >= 0x1FF) {
EnvelopeLevel = 0x1FF;