fix(apu): increase accuracy of apu
All checks were successful
continuous-integration/drone/push Build is passing

Due to this, not all instruments work. This is a regression and will be
fixed in a later commit when presumably the implementation of the APU is
a bit more correct
This commit is contained in:
2021-07-25 17:42:09 -05:00
parent 6f6c308d84
commit 9e36e86c14
2 changed files with 191 additions and 90 deletions

View File

@@ -236,11 +236,11 @@ impl BusIo for Bus {
0x1C => self.apu.ch3.volume(),
0x1E => self.apu.ch3.freq_hi(),
0x20 => self.apu.ch4.len(),
0x21 => self.apu.ch4.envelope.into(),
0x22 => self.apu.ch4.poly.into(),
0x23 => self.apu.ch4.freq_data(),
0x24 => self.apu.ctrl.channel.into(),
0x25 => self.apu.ctrl.output.into(),
0x21 => self.apu.ch4.envelope(),
0x22 => self.apu.ch4.poly(),
0x23 => self.apu.ch4.frequency(),
0x24 => self.apu.ctrl.channel(),
0x25 => self.apu.ctrl.output(),
0x26 => self.apu.ctrl.status(&self.apu),
0x30..=0x3F => self.apu.ch3.wave_ram[addr as usize - 0xFF30],
0x40 => self.ppu.ctrl.into(),
@@ -357,12 +357,12 @@ impl BusIo for Bus {
0x1D => self.apu.ch3.set_freq_lo(byte),
0x1E => self.apu.ch3.set_freq_hi(byte),
0x20 => self.apu.ch4.set_len(byte),
0x21 => self.apu.ch4.envelope = byte.into(),
0x22 => self.apu.ch4.poly = byte.into(),
0x21 => self.apu.ch4.set_envelope(byte),
0x22 => self.apu.ch4.set_poly(byte),
0x23 => self.apu.ch4.set_freq_data(byte),
0x24 => self.apu.ctrl.channel = byte.into(),
0x25 => self.apu.ctrl.output = byte.into(),
0x26 => self.apu.ctrl.set_status(byte), // FIXME: Should we control which bytes are written to here?
0x24 => self.apu.ctrl.set_channel(byte),
0x25 => self.apu.ctrl.set_output(byte),
0x26 => self.apu.set_status(byte),
0x30..=0x3F => self.apu.ch3.wave_ram[addr as usize - 0xFF30] = byte,
0x40 => self.ppu.ctrl = byte.into(),
0x41 => self.ppu.stat.update(byte),