diff --git a/core/src/gpu/mod.rs b/core/src/gpu/mod.rs index 7a3e127..228b14f 100644 --- a/core/src/gpu/mod.rs +++ b/core/src/gpu/mod.rs @@ -601,9 +601,9 @@ impl DebugRead for Gpu { fn debug_read_8(&self, addr: Addr) -> u8 { let page = (addr >> 24) as usize; match page { - PAGE_PALRAM => self.palette_ram.read_8(addr), - PAGE_VRAM => self.vram.read_8(addr), - PAGE_OAM => self.vram.read_8(addr), + PAGE_PALRAM => self.palette_ram.read_8(addr & 0x3ff), + PAGE_VRAM => self.vram.read_8(addr & ((VIDEO_RAM_SIZE as u32) - 1)), + PAGE_OAM => self.vram.read_8(addr & 0x3ff), _ => unreachable!(), } }