mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-23 17:13:25 +02:00
Memory changes 2.1
* Fixes a few crashes * Simplifies a few functions * Changes a few calls to use faster methods
This commit is contained in:
@@ -81,15 +81,7 @@ namespace Ryujinx.Graphics.Device
|
||||
{
|
||||
uint alignedOffset = index * RegisterSize;
|
||||
|
||||
var readCallback = Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_readCallbacks), (IntPtr)index);
|
||||
if (readCallback != null)
|
||||
{
|
||||
return readCallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetRefUnchecked<int>(alignedOffset);
|
||||
}
|
||||
return _readCallbacks[index]?.Invoke() ?? GetRefUnchecked<int>(alignedOffset);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -106,7 +98,7 @@ namespace Ryujinx.Graphics.Device
|
||||
|
||||
GetRefIntAlignedUncheck(index) = data;
|
||||
|
||||
Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_writeCallbacks), (IntPtr)index)?.Invoke(data);
|
||||
_writeCallbacks[index]?.Invoke(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +115,7 @@ namespace Ryujinx.Graphics.Device
|
||||
changed = storage != data;
|
||||
storage = data;
|
||||
|
||||
Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_writeCallbacks), (IntPtr)index)?.Invoke(data);
|
||||
_writeCallbacks[index]?.Invoke(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user