Improved GPU command lists decoding (#499)
* Better implementation of the DMA pusher, misc fixes * Remove some debug code * Correct RGBX8 format * Add support for linked Texture Sampler Control * Attempt to fix upside down screen issue
This commit is contained in:
parent
a56f7e8f68
commit
5357291c36
1 changed files with 24 additions and 2 deletions
|
@ -409,9 +409,31 @@ namespace ChocolArm64.Memory
|
||||||
|
|
||||||
public void WriteBytes(long position, byte[] data)
|
public void WriteBytes(long position, byte[] data)
|
||||||
{
|
{
|
||||||
EnsureRangeIsValid(position, (uint)data.Length);
|
long endAddr = position + data.Length;
|
||||||
|
|
||||||
Marshal.Copy(data, 0, (IntPtr)TranslateWrite(position), data.Length);
|
if ((ulong)endAddr < (ulong)position)
|
||||||
|
{
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
int offset = 0;
|
||||||
|
|
||||||
|
while ((ulong)position < (ulong)endAddr)
|
||||||
|
{
|
||||||
|
long pageLimit = (position + PageSize) & ~(long)PageMask;
|
||||||
|
|
||||||
|
if ((ulong)pageLimit > (ulong)endAddr)
|
||||||
|
{
|
||||||
|
pageLimit = endAddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int copySize = (int)(pageLimit - position);
|
||||||
|
|
||||||
|
Marshal.Copy(data, offset, (IntPtr)TranslateWrite(position), copySize);
|
||||||
|
|
||||||
|
position += copySize;
|
||||||
|
offset += copySize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteBytes(long position, byte[] data, int startIndex, int size)
|
public void WriteBytes(long position, byte[] data, int startIndex, int size)
|
||||||
|
|
Loading…
Reference in a new issue