diff options
Diffstat (limited to 'Ryujinx.HLE/Utilities')
| -rw-r--r-- | Ryujinx.HLE/Utilities/UInt128.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Ryujinx.HLE/Utilities/UInt128.cs b/Ryujinx.HLE/Utilities/UInt128.cs index aa348e7e..8f5fc28f 100644 --- a/Ryujinx.HLE/Utilities/UInt128.cs +++ b/Ryujinx.HLE/Utilities/UInt128.cs @@ -9,12 +9,20 @@ namespace Ryujinx.HLE.Utilities public long High { get; private set; } public long Low { get; private set; } + public bool IsNull => (Low | High) == 0; + public UInt128(long low, long high) { Low = low; High = high; } + public UInt128(byte[] bytes) + { + Low = BitConverter.ToInt64(bytes, 0); + High = BitConverter.ToInt64(bytes, 8); + } + public UInt128(string hex) { if (hex == null || hex.Length != 32 || !hex.All("0123456789abcdefABCDEF".Contains)) @@ -42,4 +50,4 @@ namespace Ryujinx.HLE.Utilities return (Low | High) == 0; } } -} +}
\ No newline at end of file |
