Esempio n. 1
0
        /// <summary>
        /// Generate the bytes for the <see cref="MMFile"/>.
        /// </summary>
        /// <param name="start">Start of virtual file</param>
        /// <returns>Bytes</returns>
        public byte[] GetFileData(uint start, uint length)
        {
            var bytes = new byte[length];

            // Zero out file bytes
            Array.Clear(bytes, 0, bytes.Length);

            foreach (var data in _data)
            {
                if (start <= data.Address)
                {
                    // Get address relative to our MMFile
                    var addr = data.Address - start;
                    ReadWriteUtils.Arr_Insert(data.Bytes, 0, data.Bytes.Length, bytes, (int)addr);
                }
            }

            return(bytes);
        }