Hello, your tutorial is amazing first of all. I was just wondering why we still mirror before accessing nametables as in here:
pub fn mirror_vram_addr(&self, addr: u16) -> u16 { let mirrored_vram = addr & 0b10111111111111; // mirror down 0x3000-0x3eff to 0x2000 - 0x2eff
when we never reach that range as in:
0x2000..=0x2fff => { let result = self.internal_data_buf; self.internal_data_buf = self.vram[self.mirror_vram_addr(addr) as usize]; result } 0x3000..=0x3eff => unimplemented!("addr {} shouldn't be used in reallity", addr),
or is this an error where we need to change the range from 0x2fff to 0x3eff and get rid of the second match
? Thank you
Hello, your tutorial is amazing first of all. I was just wondering why we still mirror before accessing nametables as in here:
pub fn mirror_vram_addr(&self, addr: u16) -> u16 { let mirrored_vram = addr & 0b10111111111111; // mirror down 0x3000-0x3eff to 0x2000 - 0x2eff
when we never reach that range as in:
0x2000..=0x2fff => { let result = self.internal_data_buf; self.internal_data_buf = self.vram[self.mirror_vram_addr(addr) as usize]; result } 0x3000..=0x3eff => unimplemented!("addr {} shouldn't be used in reallity", addr),
or is this an error where we need to change the range from
0x2fff
to0x3eff
and get rid of the second match ? Thank you