         topY = Math.max 0, bottomY - spriteHeight
         for spriteY, address in @primaryOAM by 4 when topY < spriteY <= bottomY
             @fetchSprite address, spriteHeight, bottomY - spriteY
-            if @secondaryOAM.length >= 8
-                @spriteScalineOverflow = 1
-                return
+            @spriteScalineOverflow = 1 if @secondaryOAM.length is 8 
+            # We allow more than 8 sprites on scanline, otherwise it looks ugly in some games.
 
     fetchSprite: (address, height, rowNumber) ->
         patternNumber = @primaryOAM[++address]


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

        else
            backgroundColor

    setFramePixel: (color) ->
        colorPosition = color << 2 # Each RGBA color is 4B.
        @frameBuffer[@framePosition++] = RGBA_COLORS[colorPosition++]
        @frameBuffer[@framePosition++] = RGBA_COLORS[colorPosition++]
        @frameBuffer[@framePosition++] = RGBA_COLORS[colorPosition]
        @framePosition++ # Skip alpha because it was already set to 0xFF.

    updateScrolling: ->
        if 1 <= @cycle <= 256
            @incrementFineXScroll()
            @incrementFineYScroll() if @cycle is 256
        else if @cycle is 257
            @copyHorizontalScrollBits()
        else if @scanline is -1 and 280 <= @cycle <= 304
            @copyVerticalScrollBits() 

    incrementCycle: ->
        @cycle++
