         nmiEnabledOld = @nmiEnabled
         @setControl value
         @tempAddress = (@tempAddress & 0xF3FF) | (value & 0x03) << 10 # T[11,10] = C[1,0]
-        @delayedNMI = true if @vblankFlag and not nmiEnabledOld and @nmiEnabled # Generate NMI after next instruction when its enabled (from 0 to 1) during VBlank
+        if @vblankFlag and not nmiEnabledOld and @nmiEnabled and not (@cycleFlags & F_VB_END)
+            @nmiDelay = 1  # Generate NMI after next instruction when its enabled (from 0 to 1) during VBlank
         value
 
     setControl: (value) ->

F_COPY_HS   = 1 <<  8 # Cycle where horizontal scroll bits are copied
F_COPY_VS   = 1 <<  9 # Cycle where vertical scroll bits are copied
F_VB_START  = 1 << 10 # Cycle where VBlank starts
F_VB_START2 = 1 << 11 # Few cycles at the begining of VBlank
F_VB_END    = 1 << 12 # Cycle where VBlank ends

# Tables containing flags for all cycles/scanlines

    ###########################################################

    updateVBlank: ->
        if @nmiDelay and not --@nmiDelay and @nmiEnabled and not @supressNMI
            @cpu.activateInterrupt Interrupt.NMI
        if @cycleFlags & F_VB_START
            @$enterVBlank()
        else if @cycleFlags & F_VB_END
            @$leaveVBlank()

    enterVBlank: ->
        @vblankActive = 1
        @vblankFlag = 1 unless @suppressVBlank
        @nmiDelay = 2
        @frameAvailable = true

    leaveVBlank: ->
        @vblankActive = 0
        @vblankFlag = 0
        @suppressVBlank = false
        @supressNMI = false
        @spriteZeroHit = 0

    ###########################################################
    # Scanline / cycle counters
