         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) ->

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

    updateVBlank: ->
        if @cycleFlags & F_VB_START
            @$enterVBlank()
        else if @cycleFlags & F_VB_END
            @$leaveVBlank()

    enterVBlank: ->
        unless @suppressVBlank
            @vblankFlag = 1
            @cpu.activateInterrupt Interrupt.NMI if @nmiEnabled
        @vblankActive = 1
        @frameAvailable = true

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

    generateDelayedNMI: ->
        @cpu.activateInterrupt Interrupt.NMI
        @delayedNMI = false

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

        @cycle = 0              # Total 341 cycles per scanline (0..340)
        @cycleFlags = 0         # Flags for current cycle
        @renderedSprite = null  # Currently rendered sprite
        @suppressVBlank = false # Whether to suppress VBlank flag setting
        @supressNMI = false     # Whether to supress NMI generation
        @nmiDelay = 0           # Number of cycles after which NMI is generated
        @oddFrame = false       # Whether odd frame is being rendered

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