diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-01-13 01:50:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-13 01:50:14 +0100 |
| commit | 4d2c8e2a442d2859a75c6c9162a192a0a9a221be (patch) | |
| tree | c6a9bfe24c089f1c748dcc6ef34aa2e5262c5b8e /Ryujinx.Horizon/Sdk/Ncm | |
| parent | 8fa248ceb4cbc9d199bbac1d968df8b168106c2c (diff) | |
Prepo: Fix SaveSystemReport* IPC definitions (#4278)
* Prepo: Fix SaveSystemReport IPC definitions
* Follow original code
* Fix args index in HipcGenerator
* Addresses feedback
* oops
Diffstat (limited to 'Ryujinx.Horizon/Sdk/Ncm')
| -rw-r--r-- | Ryujinx.Horizon/Sdk/Ncm/ApplicationId.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Ryujinx.Horizon/Sdk/Ncm/ApplicationId.cs b/Ryujinx.Horizon/Sdk/Ncm/ApplicationId.cs new file mode 100644 index 00000000..37b4cbfb --- /dev/null +++ b/Ryujinx.Horizon/Sdk/Ncm/ApplicationId.cs @@ -0,0 +1,52 @@ +namespace Ryujinx.Horizon.Sdk.Ncm +{ + readonly struct ApplicationId + { + public readonly ulong Id; + + public static int Length => sizeof(ulong); + + public static ApplicationId First => new(0x0100000000010000); + + public static ApplicationId Last => new(0x01FFFFFFFFFFFFFF); + + public static ApplicationId Invalid => new(0); + + public bool IsValid => Id >= First.Id && Id <= Last.Id; + + public ApplicationId(ulong id) + { + Id = id; + } + + public override bool Equals(object obj) + { + return obj is ApplicationId applicationId && applicationId.Equals(this); + } + + public bool Equals(ApplicationId other) + { + return other.Id == Id; + } + + public override int GetHashCode() + { + return Id.GetHashCode(); + } + + public static bool operator ==(ApplicationId lhs, ApplicationId rhs) + { + return lhs.Equals(rhs); + } + + public static bool operator !=(ApplicationId lhs, ApplicationId rhs) + { + return !lhs.Equals(rhs); + } + + public override string ToString() + { + return $"0x{Id:x}"; + } + } +}
\ No newline at end of file |
