fix(apu): fix index out of bounds error on channel 3 write

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-08-03 20:23:08 -05:00
parent d4407cf849
commit c863dc835c
1 changed files with 1 additions and 1 deletions

View File

@ -671,7 +671,7 @@ impl BusIo for Channel3 {
fn write_byte(&mut self, addr: u16, byte: u8) {
if self.enabled {
self.wave_ram[self.offset as usize] = byte;
self.wave_ram[self.offset as usize / 2] = byte;
} else {
self.wave_ram[(addr - Self::WAVE_RAM_START_ADDR) as usize] = byte;
}