         @framePosition++ # Skip alpha because it was already set to 0xFF.
 
     renderFramePixel: ->
-        backgroundColor = if @backgroundVisible then @renderBackgroundPixel() else 0
-        spriteColor = if @spritesVisible then @renderSpritePixel() else 0
+        backgroundColor = @renderBackgroundPixel()
+        spriteColor = @renderSpritePixel()
         if (spriteColor & 0x03) and (backgroundColor & 0x03) # Both bagckground and sprite pixels are visible
             @spriteZeroHit |= @spriteZeroRendered
             if @spriteInFront then spriteColor else backgroundColor


    renderBackgroundPixel: ->
        @fetchPattern() if @fineXScroll is 0 # When coarse scroll X was incremented.
        bitNumber = @fineXScroll ^ 0x07 # 7 - fineXScroll
        colorSelect1 =  (@patternLayer1Row >>> bitNumber) & 0x01
        colorSelect2 = ((@patternLayer2Row >>> bitNumber) & 0x01) << 1

    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
