Пример #1
0
        public unsafe void MoveDown(uint aDest, uint aSrc, uint aCount)
        {
            byte *xDest = (byte *)(Base + aDest);
            byte *xSrc  = (byte *)(Base + aSrc);

            MemoryOperations.Copy(xDest, xSrc, (int)aCount);
        }
Пример #2
0
        /// <summary>
        /// Copy ManagedMemoryBlock into MemoryBlock
        /// </summary>
        /// <param name="block">ManagedMemoryBlock to copy.</param>
        public unsafe void Copy(ManagedMemoryBlock block)
        {
            byte *xDest    = (byte *)(Base);
            byte *aDataPtr = (byte *)block.Offset;

            MemoryOperations.Copy(xDest, aDataPtr, (int)block.Size);
        }
Пример #3
0
        /// <summary>
        /// Copy MemoryBlock into ManagedMemoryBlock
        /// </summary>
        /// <param name="block">MemoryBlock to copy.</param>
        public unsafe void Copy(MemoryBlock block)
        {
            byte *xDest    = (byte *)(this.Offset);
            byte *aDataPtr = (byte *)block.Base;

            MemoryOperations.Copy(xDest, aDataPtr, (int)block.Size);
        }
Пример #4
0
        /// <summary>
        /// Copy data from the buffer array to the memory block.
        /// </summary>
        /// <param name="aByteOffset">Starting point offset in bytes</param>
        /// <param name="aData">A data buffer array.</param>
        /// <param name="aIndex">A staring index in the source data buffer array.</param>
        /// <param name="aCount">Number of integers to copy.</param>
        public unsafe void Copy(int aByteOffset, int[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            int *xDest = (int *)(Base + aByteOffset);

            fixed(int *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }
Пример #5
0
        unsafe public void Copy(uint aStart, uint[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            uint *xDest = (uint *)(Base + aStart);

            Global.mDebugger.SendInternal($"Base is {Base} xDest is {(uint)xDest}");
            fixed(uint *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }
Пример #6
0
        /// <summary>
        /// Convert part for the memory block to array.
        /// </summary>
        /// <param name="aStart">A starting position of the data at the source memory block.</param>
        /// <param name="aIndex">A index to be the staring index at the destination array.</param>
        /// <param name="aCount">Number of bytes to get.</param>
        /// <returns>uint array.</returns>
        public unsafe uint[] ToArray(int aStart, int aIndex, int aCount)
        {
            uint *xDest = (uint *)(Base + aStart);

            uint[] array = new uint[aCount];
            fixed(uint *aArrayPtr = array)
            {
                MemoryOperations.Copy(aArrayPtr + aIndex, xDest, aCount);
            }

            return(array);
        }
Пример #7
0
        public unsafe void Copy(int aStart, int[] aData, int aIndex, int aCount)
        {
            // TODO thow exception if aStart and aCount are not in bound. I've tried to do this but Bochs dies :-(
            int *xDest;

            fixed(byte *aArrayPtr = this.memory)
            {
                xDest = (int *)(aArrayPtr + aStart);
            }

            fixed(int *aDataPtr = aData)
            {
                MemoryOperations.Copy(xDest, aDataPtr + aIndex, aCount);
            }
        }