fix(apu): abstract wave RAM behind BusIO trait

This commit is contained in:
2021-07-25 18:03:11 -05:00
parent 9e36e86c14
commit e4d77d66ba
2 changed files with 17 additions and 3 deletions

View File

@@ -242,7 +242,7 @@ impl BusIo for Bus {
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],
0x30..=0x3F => self.apu.ch3.read_byte(addr),
0x40 => self.ppu.ctrl.into(),
0x41 => self.ppu.stat.into(),
0x42 => self.ppu.pos.scroll_y,
@@ -363,7 +363,7 @@ impl BusIo for Bus {
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,
0x30..=0x3F => self.apu.ch3.write_byte(addr, byte),
0x40 => self.ppu.ctrl = byte.into(),
0x41 => self.ppu.stat.update(byte),
0x42 => self.ppu.pos.scroll_y = byte,