fix(apu): fix index out of bounds error on channel 3 write
This commit is contained in:
parent
d4407cf849
commit
c863dc835c
|
@ -671,7 +671,7 @@ impl BusIo for Channel3 {
|
||||||
|
|
||||||
fn write_byte(&mut self, addr: u16, byte: u8) {
|
fn write_byte(&mut self, addr: u16, byte: u8) {
|
||||||
if self.enabled {
|
if self.enabled {
|
||||||
self.wave_ram[self.offset as usize] = byte;
|
self.wave_ram[self.offset as usize / 2] = byte;
|
||||||
} else {
|
} else {
|
||||||
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