 
     renderBackgroundPixel: ->
         @fetchPattern() if @fineXScroll is 0 # When coarse scroll X was incremented.
+        return 0 if not @backgroundVisible or @cycle < 9 and @backgroundClipping
         bitNumber = @fineXScroll ^ 0x07 # 7 - fineXScroll
         colorSelect1 =  (@patternLayer1Row >>> bitNumber) & 0x01
         colorSelect2 = ((@patternLayer2Row >>> bitNumber) & 0x01) << 1

    renderSpritePixel: ->
        # TODO rewrite and optimize this
        @fetchSprites() if @cycle is 1
        @spriteZeroRendered = false
        currentX = @cycle
        currentY = @scanline
        heightMask = if @bigSprites then 0x0F else 0x07
        for address in @spriteAddresses
            innerX = currentX - @objectAttributeMemory[address + 3]

    fetchSprites: ->
        @spriteScalineOverflow = 0
        @spriteAddresses = []
        bottomY = @scanline - 1
        topY = Math.max 0, bottomY - (if @bigSprites then 16 else 8)
        for spriteY, address in @objectAttributeMemory by 4
            if topY < spriteY <= bottomY
                @spriteAddresses.push address
