                 @leaveVBlank()
 
     enterVBlank: ->
-        @vblankStarted = 1
+        unless @suppressVBlank
+            @vblankFlag = 1
+            @cpu.activateInterrupt Interrupt.NMI if @nmiEnabled
         @vblankActive = 1
         @frameAvailable = true
-        @cpu.activateInterrupt Interrupt.NMI if @nmiEnabled
 
     leaveVBlank: ->
-        @vblankStarted = 0
+        @vblankFlag = 0
         @vblankActive = 0
         @spriteZeroHit = 0
+        @suppressVBlank = false
 
     generateDelayedNMI: ->
         @cpu.activateInterrupt Interrupt.NMI


    readStatus: ->
        value = @getStatus()
        @vblankStarted = 0
        @writeToogle = 0
        value

    getStatus: ->
        @vramWritesIgnored     << 4 | # S[4]
        @spriteScalineOverflow << 5 | # S[5]
        @spriteZeroHit         << 6 | # S[6]
        @vblankStarted         << 7   # S[7]

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

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

        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
        value

    setControl: (value) ->
