apu handle all addrs

This commit is contained in:
Alex Janka 2023-02-13 13:29:53 +11:00
parent f0a8a978b2
commit f343075599

View file

@ -47,11 +47,10 @@ impl Apu {
self.mem[reg(addr)] = (self.mem[reg(addr)] & 0b10111111) | (data & 0b01000000) self.mem[reg(addr)] = (self.mem[reg(addr)] & 0b10111111) | (data & 0b01000000)
} }
0xFF26 => self.mem[reg(addr)] = (self.mem[reg(addr)] & 0b1111111) | (data & 0b10000000), 0xFF26 => self.mem[reg(addr)] = (self.mem[reg(addr)] & 0b1111111) | (data & 0b10000000),
0xFF11 | 0xFF14 | 0xFF16 | 0xFF19 | 0xFF1E => self.mem[reg(addr)] = data, 0xFF11..0xFF1A | 0xFF1B | 0xFF1D..0xFF23 | 0xFF24..0xFF40 => {
0xFF15 | 0xFF1F | 0xFF27 | 0xFF28 | 0xFF29 => {
println!("BANNED write in APU: {data:#X} to {addr:#X}") println!("BANNED write in APU: {data:#X} to {addr:#X}")
} }
_ => panic!("non-apu addr in apu"), 0x0..0xFF10 | 0xFF40..0xFFFF | 0xFFFF => panic!("non-apu addr in apu"),
} }
} }