system/ppu/background.js
function initMasks() {
	var i, mask,
	    result = new Uint8Array( 0x10000 );

	for ( i = 0; i < 0x10000; i++ ) {
		mask = 3;
		if ( i & 0x2 ) {
			// right
			mask <<= 2;
		}
		if ( i & 0x40 ) {
			// bottom
			mask <<= 4;
		}

		result[ i ] = mask;
	}

	return result;
}
function initMasks() {
	var i, mask,
	    result = new Uint8Array( 0x10000 );

	for ( i = 0; i < 0x10000; i++ ) {
		mask = 3;
		if ( i & 0x2 ) {
			// right
			mask <<= 2;
		}
		if ( i & 0x40 ) {
			// bottom
			mask <<= 4;
		}

		result[ i ] = mask;
	}

	return result;
}
function initMasks ( ) { var i , mask , result = new Uint8Array ( 0x10000 ) ; for ( i = 0 ; i < 0x10000 ; i ++ ) { mask = 3 ; if ( i & 0x2 ) { // right mask <<= 2 ; } if ( i & 0x40 ) { // bottom mask <<= 4 ; } result [ i ] = mask ; } return result ; }
Inititialze mask lookup table.
Maps loopy_v values to bitmasks for attribute bytes to get the correct palette value.
Inititialze mask lookup table . Maps loopy_v values to bitmasks for attribute bytes to get the correct palette value .