system/ppu/background.js
function() {
		var cartridge = this.memory.cartridge,

		      attrAddress = attrAddresses[ this.loopyV ],
		      attribute = cartridge.readNameTable( attrAddress & 0x1fff ),

		      nametableAddress = 0x2000 | ( this.loopyV & 0x0fff ),
		      tileIndex = cartridge.readNameTable( nametableAddress & 0x1fff ),
	          tile = cartridge.readTile( this.baseTable, tileIndex, this.y );

		if ( tile ) {
			this.renderTile(
				tile,
				palettes[ attribute & masks[ this.loopyV & 0xfff ] ]
			);
		}

		this.incrementVX();
	}
function() {
		var cartridge = this.memory.cartridge,

		      attrAddress = attrAddresses[ this.loopyV ],
		      attribute = cartridge.readNameTable( attrAddress & 0x1fff ),

		      nametableAddress = 0x2000 | ( this.loopyV & 0x0fff ),
		      tileIndex = cartridge.readNameTable( nametableAddress & 0x1fff ),
	          tile = cartridge.readTile( this.baseTable, tileIndex, this.y );

		if ( tile ) {
			this.renderTile(
				tile,
				palettes[ attribute & masks[ this.loopyV & 0xfff ] ]
			);
		}

		this.incrementVX();
	}
function ( ) { var cartridge = this . memory . cartridge , attrAddress = attrAddresses [ this . loopyV ] , attribute = cartridge . readNameTable ( attrAddress & 0x1fff ) , nametableAddress = 0x2000 | ( this . loopyV & 0x0fff ) , tileIndex = cartridge . readNameTable ( nametableAddress & 0x1fff ) , tile = cartridge . readTile ( this . baseTable , tileIndex , this . y ) ; if ( tile ) { this . renderTile ( tile , palettes [ attribute & masks [ this . loopyV & 0xfff ] ] ) ; } this . incrementVX ( ) ; }
Fetch background tile data.
Fetch background tile data .