public void deleteFrames(int index, int num)
        {
            if (index + num >= MovieLength)
            {
                return;
            }

            // Copy later values to an earlier place
            IntPtr cPtr = (IntPtr)memoryStart + (index + num) * 12;
            int    cLen = memoryEnd - (int)cPtr;

            byte[] copypaste = Mem.ReadMemory(cPtr, cLen);
            Mem.WriteMemory(cPtr - num * 12, copypaste);
            MovieLength -= num;

            // Clear old values
            FrameInput setTo = new FrameInput();

            for (int i = 0; i < num; i++)
            {
                setInput(i + MovieLength, setTo);
            }
            FrameEdited(index, num);
        }
 public void setInput(int index, FrameInput f)
 {
     Mem.WriteMemory((IntPtr)memoryStart + index * 12, f.Bytes);
     FrameEdited(index);
 }