fix(apu): fix out of bounds error with channel 3 wave ram
This commit is contained in:
parent
002dae6826
commit
5482a8e75f
|
@ -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]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue