From c5aafab3efd471cbc45f0cad0c142b18d4b80474 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 24 Jun 2021 01:28:00 -0500 Subject: [PATCH] feat(snd): implement trigger event behaviour for lfsr --- src/sound.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sound.rs b/src/sound.rs index f85a143..3ab9299 100644 --- a/src/sound.rs +++ b/src/sound.rs @@ -749,6 +749,9 @@ pub(crate) struct Channel4 { // Length Functionality length_timer: u16, + + /// Linear Feedback Shift Register (15-bit) + lfsr: u16, } impl Channel4 { @@ -781,6 +784,9 @@ impl Channel4 { if self.length_timer == 0 { self.length_timer = 64; } + + // LFSR behaviour during trigger event + self.lfsr = 0x7FFF; } } }