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

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

        @framePosition++ # Skip alpha because it was already set to 0xFF.

    renderFramePixel: ->
        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
