public void Write(UInt16 address, Cartridge.MirrorMode mirrorMode, byte data) { UInt16 maskedAddress = Nametable.MaskAddress(address); int id = Nametable.MirrorNametable(maskedAddress, mirrorMode); int offset = Nametable.Offset(maskedAddress); nameTable[id, offset] = data; }
public byte Read(UInt16 address, Cartridge.MirrorMode mirrorMode) { UInt16 maskedAddress = Nametable.MaskAddress(address); int id = Nametable.MirrorNametable(maskedAddress, mirrorMode); int offset = Nametable.Offset(maskedAddress); return(nameTable[id, offset]); }