fix length timer
This commit is contained in:
parent
6676276706
commit
a790e4cbd1
|
@ -371,8 +371,8 @@ impl WaveChannel {
|
|||
|
||||
pub(super) fn length_tick(&mut self) {
|
||||
if self.length_enable && self.enabled {
|
||||
self.length_timer += 1;
|
||||
if self.length_timer >= 64 {
|
||||
self.length_timer = self.length_timer.saturating_add(1);
|
||||
if self.length_timer == 0xFF {
|
||||
self.enabled = false;
|
||||
}
|
||||
}
|
||||
|
@ -528,6 +528,7 @@ impl NoiseChannel {
|
|||
fn trigger(&mut self) {
|
||||
self.enabled = true;
|
||||
self.envelope = self.queued_envelope;
|
||||
self.lfsr.register = 0;
|
||||
}
|
||||
|
||||
pub fn tick(&mut self, steps: usize) -> Vec<f32> {
|
||||
|
|
Loading…
Reference in a new issue