fix(apu): implement WAVE RAM blocking

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-08-02 22:37:40 -05:00
parent a549b9feef
commit 832e1b7633
1 changed files with 5 additions and 1 deletions

View File

@ -664,7 +664,11 @@ pub(crate) struct Channel3 {
impl BusIo for Channel3 {
fn read_byte(&self, addr: u16) -> u8 {
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize]
if self.enabled {
self.wave_ram[self.offset as usize]
} else {
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize]
}
}
fn write_byte(&mut self, addr: u16, byte: u8) {