                         state.ir |= 0x04
                         updateIRQLine()
                     }
+                    if spriteCollisions > 0 && foregroundPixel != nil {
+                        state.md |= spriteCollisions
+                        state.ir |= 0x02
+                        updateIRQLine()
+                    }
                     if let spritePixel = spritePixel, let topSprite = topSprite, (state.mdp & UInt8(1 << topSprite) == 0 || foregroundPixel == nil) {
                         state.cyclePixelBuffer[i] = colors[spritePixel]
                     } else if let foregroundPixel = foregroundPixel {

    fileprivate var mmc: UInt8 = 0 // Sprite Multicolor
    fileprivate var mxe: UInt8 = 0 // Sprite X expansion
    fileprivate var mm: UInt8 = 0 // Sprite-sprite collision
    fileprivate var b0c: UInt8 = 0 // Background Color 0
    fileprivate var b1c: UInt8 = 0 // Background Color 1
    fileprivate var b2c: UInt8 = 0 // Background Color 2

            state.mxe = byte
        case 0x1E:
            state.mm = byte
        case 0x1F:
            state.md = byte
        case 0x20:
            state.ec = byte & 0x0F
        case 0x21:
