Esempio n. 1
0
        protected internal override void memcpy(int destination, int source, int Length, bool checkOverlap)
        {
            if (Length <= 0)
            {
                return;
            }

            destination &= addressMask;
            source      &= addressMask;
            Modules.sceDisplayModule.write(destination);

            if (!checkOverlap || source >= destination || !areOverlapping(destination, source, Length))
            {
                NativeMemoryUtils.memcpy(memory, destination, memory, source, Length);
            }
            else
            {
                // Source and destination are overlapping and source < destination,
                // copy from the tail.
                for (int i = Length - 1; i >= 0; i--)
                {
                    int b = NativeMemoryUtils.read8(memory, source + i);
                    NativeMemoryUtils.write8(memory, destination + i, b);
                }
            }
        }
Esempio n. 2
0
 public override void copyToMemory(int address, ByteBuffer source, int Length)
 {
     address &= addressMask;
     Length   = System.Math.Min(Length, source.capacity());
     if (source.Direct)
     {
         NativeMemoryUtils.copyBufferToMemory(memory, address, source, source.position(), Length);
     }
     else
     {
         for (; Length > 0; address++, Length--)
         {
             NativeMemoryUtils.write8(memory, address, source.get());
         }
     }
 }
Esempio n. 3
0
 public override void write8(int address, sbyte data)
 {
     address &= addressMask;
     NativeMemoryUtils.write8(memory, address, data);
     Modules.sceDisplayModule.write8(address);
 }