fix(apu): fix out of bounds error with channel 3 wave ram

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-08-03 20:35:22 -05:00
parent 002dae6826
commit 5482a8e75f
1 changed files with 1 additions and 1 deletions

View File

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