src/memory/mappers/std_banked.cc
/*
 * Reads the value at the given address from vram, accounting
 * for mirroring.
 */
Reads the value at the given address from vram, accounting
for mirroring.
Reads the value at the given address from vram accounting for mirroring .
DataWord StdBanked::VramRead(DoubleWord addr) {
  addr &= VRAM_BUS_MASK;
  if (addr < NAMETABLE_OFFSET) {
    return pattern_table_[addr & PATTERN_TABLE_MASK];
  } else if (addr < PALETTE_OFFSET) {
    DataWord table = (addr & NAMETABLE_SELECT_MASK) >> 10U;
    return nametable_[table][addr & NAMETABLE_ADDR_MASK];
  } else {
    return PaletteRead(addr);
  }
}
DataWord StdBanked :: VramRead ( DoubleWord addr ) { addr &= VRAM_BUS_MASK ; if ( addr < NAMETABLE_OFFSET ) { return pattern_table_ [ addr & PATTERN_TABLE_MASK ] ; } else if ( addr < PALETTE_OFFSET ) { DataWord table = ( addr & NAMETABLE_SELECT_MASK ) >> 10U ; return nametable_ [ table ] [ addr & NAMETABLE_ADDR_MASK ] ; } else { return PaletteRead ( addr ) ; } }
Reads the value at the given address from vram, accounting
 for mirroring.
Reads the value at the given address from vram accounting for mirroring .
// Mask out any extra bits. // Determine which part of VRAM is being accessed. // Pattern table is being accessed. // Nametable is being accessed. // Palette is being accessed.