diff options
Diffstat (limited to 'src/Ryujinx.Common')
| -rw-r--r-- | src/Ryujinx.Common/Memory/StructArrayHelpers.cs | 11 | ||||
| -rw-r--r-- | src/Ryujinx.Common/Memory/StructByteArrayHelpers.cs | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs index 94ce8d2f..762c7388 100644 --- a/src/Ryujinx.Common/Memory/StructArrayHelpers.cs +++ b/src/Ryujinx.Common/Memory/StructArrayHelpers.cs @@ -744,6 +744,17 @@ namespace Ryujinx.Common.Memory public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); } + public struct Array65<T> : IArray<T> where T : unmanaged + { + T _e0; + Array64<T> _other; + public readonly int Length => 65; + public ref T this[int index] => ref AsSpan()[index]; + + [Pure] + public Span<T> AsSpan() => MemoryMarshal.CreateSpan(ref _e0, Length); + } + public struct Array73<T> : IArray<T> where T : unmanaged { T _e0; diff --git a/src/Ryujinx.Common/Memory/StructByteArrayHelpers.cs b/src/Ryujinx.Common/Memory/StructByteArrayHelpers.cs index 3b066662..79b7d681 100644 --- a/src/Ryujinx.Common/Memory/StructByteArrayHelpers.cs +++ b/src/Ryujinx.Common/Memory/StructByteArrayHelpers.cs @@ -64,6 +64,18 @@ namespace Ryujinx.Common.Memory } [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] + public struct ByteArray3000 : IArray<byte> + { + private const int Size = 3000; + + byte _element; + + public readonly int Length => Size; + public ref byte this[int index] => ref AsSpan()[index]; + public Span<byte> AsSpan() => MemoryMarshal.CreateSpan(ref _element, Size); + } + + [StructLayout(LayoutKind.Sequential, Size = Size, Pack = 1)] public struct ByteArray4096 : IArray<byte> { private const int Size = 4096; |
