diff --git a/src/nba/src/hw/apu/channel/envelope.hpp b/src/nba/src/hw/apu/channel/envelope.hpp index f76a00721..37af151f8 100644 --- a/src/nba/src/hw/apu/channel/envelope.hpp +++ b/src/nba/src/hw/apu/channel/envelope.hpp @@ -9,6 +9,14 @@ namespace nba::core { +/** + * TODO: + * - Figure out how the envelope timer behaves when the envelope speed (divider) changes mid-note. + * - Is the new value loaded into the counter right away or on the next reload? + * - Is the timer ticked when the envelope is deactivated (divider == 0)? + * - If so, what value is loaded into the timer on channel restart? + */ + class Envelope { public: void Reset() { @@ -25,7 +33,7 @@ class Envelope { } void Tick() { - if(step == 0) { + if(step == 1) { step = divider; if(active && divider != 0) { @@ -44,7 +52,7 @@ class Envelope { } } } else { - step--; + step = (step - 1) & 7; } } diff --git a/src/nba/src/hw/apu/channel/sweep.hpp b/src/nba/src/hw/apu/channel/sweep.hpp index 827ddc35c..42aa53047 100644 --- a/src/nba/src/hw/apu/channel/sweep.hpp +++ b/src/nba/src/hw/apu/channel/sweep.hpp @@ -9,6 +9,11 @@ namespace nba::core { +/** + * TODO: figure out specifics of how the sweep timer works when the sweep speed (divider) is set to zero + * or changed in the middle of a note. + */ + class Sweep { public: void Reset() {