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

                        state.ir |= 0x04
                        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 {

            let value = state.mm
            state.mm = 0
            return value
        case 0x1F:
            let value = state.md
            state.md = 0
            return value
        case 0x20:
            return state.ec | 0xF0
        case 0x21:
