diff options
Diffstat (limited to 'Ryujinx.Tests.Unicorn/Native')
| -rw-r--r-- | Ryujinx.Tests.Unicorn/Native/Interface.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.Tests.Unicorn/Native/UnicornArch.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Tests.Unicorn/Native/UnicornMode.cs | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/Ryujinx.Tests.Unicorn/Native/Interface.cs b/Ryujinx.Tests.Unicorn/Native/Interface.cs index 006585b5..59b1da07 100644 --- a/Ryujinx.Tests.Unicorn/Native/Interface.cs +++ b/Ryujinx.Tests.Unicorn/Native/Interface.cs @@ -16,11 +16,13 @@ namespace Ryujinx.Tests.Unicorn.Native public static void MarshalArrayOf<T>(IntPtr input, int length, out T[] output) { int size = Marshal.SizeOf(typeof(T)); + output = new T[length]; for (int i = 0; i < length; i++) { IntPtr item = new IntPtr(input.ToInt64() + i * size); + output[i] = Marshal.PtrToStructure<T>(item); } } @@ -29,7 +31,7 @@ namespace Ryujinx.Tests.Unicorn.Native public static extern uint uc_version(out uint major, out uint minor); [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern UnicornError uc_open(uint arch, uint mode, out IntPtr uc); + public static extern UnicornError uc_open(UnicornArch arch, UnicornMode mode, out IntPtr uc); [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] public static extern UnicornError uc_close(IntPtr uc); diff --git a/Ryujinx.Tests.Unicorn/Native/UnicornArch.cs b/Ryujinx.Tests.Unicorn/Native/UnicornArch.cs index 73710faa..ff633293 100644 --- a/Ryujinx.Tests.Unicorn/Native/UnicornArch.cs +++ b/Ryujinx.Tests.Unicorn/Native/UnicornArch.cs @@ -1,6 +1,6 @@ namespace Ryujinx.Tests.Unicorn.Native { - public enum UnicornArch + public enum UnicornArch : uint { UC_ARCH_ARM = 1, // ARM architecture (including Thumb, Thumb-2) UC_ARCH_ARM64, // ARM-64, also called AArch64 diff --git a/Ryujinx.Tests.Unicorn/Native/UnicornMode.cs b/Ryujinx.Tests.Unicorn/Native/UnicornMode.cs index 5cd83516..8045f2da 100644 --- a/Ryujinx.Tests.Unicorn/Native/UnicornMode.cs +++ b/Ryujinx.Tests.Unicorn/Native/UnicornMode.cs @@ -1,7 +1,7 @@ // ReSharper disable InconsistentNaming namespace Ryujinx.Tests.Unicorn.Native { - public enum UnicornMode + public enum UnicornMode : uint { UC_MODE_LITTLE_ENDIAN = 0, // little-endian mode (default mode) UC_MODE_BIG_ENDIAN = 1 << 30, // big-endian mode |
