feat(snd): implement ch 1,2,3 and 4 length function

This commit is contained in:
2021-06-24 00:59:39 -05:00
parent b8b3563bca
commit 67e2a6ad79
2 changed files with 146 additions and 65 deletions

View File

@@ -221,16 +221,16 @@ impl BusIo for Bus {
0x07 => self.timer.ctrl.into(),
0x0F => self.interrupt_flag().into(),
0x10 => self.snd.ch1.sweep.into(),
0x11 => self.snd.ch1.duty.into(),
0x11 => self.snd.ch1.duty(),
0x12 => self.snd.ch1.envelope.into(),
0x14 => self.snd.ch1.freq_hi(),
0x16 => self.snd.ch2.duty.into(),
0x16 => self.snd.ch2.duty(),
0x17 => self.snd.ch2.envelope.into(),
0x19 => self.snd.ch2.freq_hi(),
0x1A => self.snd.ch3.enabled(),
0x1B => self.snd.ch3.len,
0x1B => self.snd.ch3.len(),
0x1C => self.snd.ch3.volume(),
0x1E => self.snd.ch3.freq_hi.into(),
0x1E => self.snd.ch3.freq_hi(),
0x20 => self.snd.ch4.len(),
0x21 => self.snd.ch4.envelope.into(),
0x22 => self.snd.ch4.poly.into(),
@@ -335,19 +335,19 @@ impl BusIo for Bus {
0x07 => self.timer.ctrl = byte.into(),
0x0F => self.set_interrupt_flag(byte),
0x10 => self.snd.ch1.sweep = byte.into(),
0x11 => self.snd.ch1.duty = byte.into(),
0x11 => self.snd.ch1.set_duty(byte),
0x12 => self.snd.ch1.envelope = byte.into(),
0x13 => self.snd.ch1.freq_lo = byte,
0x14 => self.snd.ch1.set_freq_hi(byte),
0x16 => self.snd.ch2.duty = byte.into(),
0x16 => self.snd.ch2.set_duty(byte),
0x17 => self.snd.ch2.envelope = byte.into(),
0x18 => self.snd.ch2.freq_lo = byte,
0x19 => self.snd.ch2.set_freq_hi(byte),
0x1A => self.snd.ch3.set_enabled(byte),
0x1B => self.snd.ch3.len = byte,
0x1B => self.snd.ch3.set_len(byte),
0x1C => self.snd.ch3.set_volume(byte),
0x1D => self.snd.ch3.freq_lo = byte,
0x1E => self.snd.ch3.freq_hi = byte.into(),
0x1E => self.snd.ch3.set_freq_hi(byte),
0x20 => self.snd.ch4.set_len(byte),
0x21 => self.snd.ch4.envelope = byte.into(),
0x22 => self.snd.ch4.poly = byte.into(),