                 state.graphicsPixelData <<= 1
             }
         }
+        // BMM changes start appearing after 4 pixels when rising, 6 when falling
+        let bmm = !state.nextPipe.bmm && state.pipe.bmm ? i < 6 : (i > 3 ? state.nextPipe.bmm : state.pipe.bmm)
         
-        switch (state.ecm, state.bmm, mcm) {
+        switch (state.ecm, bmm, mcm) {
         case (false, false, false): // Standard text mode (ECM/BMM/MCM=0/0/0)
             if state.graphicsPixelData != 0 {
                 graphicsPixel = Int(state.pipe.graphicsColorLine)

    fileprivate var yScroll: UInt8 = 0 // Y Scroll
    fileprivate var rsel = true // (Rows selection)?
    fileprivate var den = true // Display Enable
    fileprivate var bmm = false // Bit Map Mode
    fileprivate var ecm = false // Extended Color Mode
    fileprivate var raster: UInt16 = 0 // Raster Counter
    fileprivate var me: UInt8 = 0 // Sprite Enabled

        // MCM delay takes full effect after 7 pixels, more info below
        state.pipe.mcm = state.nextPipe.mcm
        drawPixel(7)
        // BMM delay should happen after gAccess, so transfer nextPipe except BMM (no overhead as it is optimized out)
        let bmm = state.pipe.bmm
        state.pipe = state.nextPipe
        state.pipe.bmm = bmm
    }
    
    // Handling everything in a single function was causing the compiler to generate some weird and much slower code, so split up everything
