fix(apu): implement WAVE RAM blocking
This commit is contained in:
parent
a549b9feef
commit
832e1b7633
|
@ -664,8 +664,12 @@ pub(crate) struct Channel3 {
|
||||||
|
|
||||||
impl BusIo for Channel3 {
|
impl BusIo for Channel3 {
|
||||||
fn read_byte(&self, addr: u16) -> u8 {
|
fn read_byte(&self, addr: u16) -> u8 {
|
||||||
|
if self.enabled {
|
||||||
|
self.wave_ram[self.offset as usize]
|
||||||
|
} else {
|
||||||
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize]
|
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn write_byte(&mut self, addr: u16, byte: u8) {
|
fn write_byte(&mut self, addr: u16, byte: u8) {
|
||||||
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize] = byte;
|
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize] = byte;
|
||||||
|
|
Loading…
Reference in New Issue