     incementScanline: ->
         @cycle = 0
         @scanline++
-        @scanline = -1 if @scanline is 262
-        @vblankInProgress = 241 <= @scanline <= 260
-        @cpu.nonMaskableInterrupt() if @scanline is 241 and @vblankGeneratesNMI
-        @frameAvailable = true if @scanline is 241
+        if @scanline is 241
+            @vblankStarted = 1
+            @frameAvailable = true
+            @cpu.nonMaskableInterrupt() if @vblankGeneratesNMI
+        else if @scanline is 262
+            @vblankStarted = 0
+            @scanline = -1
 
     readFrame: ->
         @frameAvailable = false

        @vramWritesIgnored     << 4 | # S[4]
        @spriteScalineOverflow << 5 | # S[5]
        @spriteZeroHit         << 6 | # S[6]
        @vblankInProgress      << 7   # S[7]

    setStatus: (value) ->
        @vramWritesIgnored     = (value >>> 4) & 0x01 # S[4]
        @spriteScalineOverflow = (value >>> 5) & 0x01 # S[5]
        @spriteZeroHit         = (value >>> 6) & 0x01 # S[6]
        @vblankInProgress      = (value >>> 7)        # S[7]

    ###########################################################
    # Object attribute memory access

        @incrementFineXScroll() if 1 <= @cycle <= 256 # Increments coarse X scroll each 8th fine X scroll increment
        @incrementCoarseXScroll() if @cyle is 328 or @cycle is 336 # Extra coarse X scroll
        @copyHorizontalScrollBits() if @cycle is 257
        @copyVerticalScrollBits() if @scanline is -1 and 280 <= @cycle <= 304

    incrementCycle: ->
        @cycle++
