From de9faf183ac9f5eeb00596cd7b75e3b35a3bc571 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 3 Feb 2025 19:45:05 -0600 Subject: [PATCH 1/2] misc: chore: [ci skip] wrong element order --- src/Ryujinx/Utilities/PlayReportAnalyzer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs index 80bef13bc..f71642b7d 100644 --- a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs +++ b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs @@ -180,8 +180,8 @@ namespace Ryujinx.Ava.Utilities /// /// A delegate factory you can use to always return the specified /// in a . - /// The string to always return for this delegate instance. /// + /// The string to always return for this delegate instance. public static PlayReportValueFormatter AlwaysReturns(string formattedValue) => _ => formattedValue; } } From 7a9b62884ae475f8523c2c0c0a75aa066ff7a26d Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Mon, 3 Feb 2025 19:56:02 -0600 Subject: [PATCH 2/2] misc: chore: type-specific value accessors on PlayReportValue --- src/Ryujinx/Utilities/PlayReport.cs | 4 ++-- src/Ryujinx/Utilities/PlayReportAnalyzer.cs | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx/Utilities/PlayReport.cs b/src/Ryujinx/Utilities/PlayReport.cs index f8e361333..f518fb902 100644 --- a/src/Ryujinx/Utilities/PlayReport.cs +++ b/src/Ryujinx/Utilities/PlayReport.cs @@ -38,7 +38,7 @@ namespace Ryujinx.Ava.Utilities => value.BoxedValue is 1 ? "Playing Master Mode" : PlayReportFormattedValue.ForceReset; private static PlayReportFormattedValue TearsOfTheKingdom_CurrentField(PlayReportValue value) => - value.PackedValue.AsDouble() switch + value.DoubleValue switch { > 800d => "Exploring the Sky Islands", < -201d => "Exploring the Depths", @@ -55,7 +55,7 @@ namespace Ryujinx.Ava.Utilities => value.BoxedValue is 0 ? "Playing Super Mario 3D World" : "Playing Bowser's Fury"; private static PlayReportFormattedValue MarioKart8Deluxe_Mode(PlayReportValue value) - => value.BoxedValue switch + => value.StringValue switch { // Single Player "Single" => "Single Player", diff --git a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs index f71642b7d..e22969bb9 100644 --- a/src/Ryujinx/Utilities/PlayReportAnalyzer.cs +++ b/src/Ryujinx/Utilities/PlayReportAnalyzer.cs @@ -265,6 +265,24 @@ namespace Ryujinx.Ava.Utilities /// so use and the AsX (where X is a numerical type name i.e. Int32) methods for that. /// public object BoxedValue => PackedValue.ToObject(); + + #region AsX accessors + + public bool BooleanValue => PackedValue.AsBoolean(); + public byte ByteValye => PackedValue.AsByte(); + public sbyte SByteValye => PackedValue.AsSByte(); + public short ShortValye => PackedValue.AsInt16(); + public ushort UShortValye => PackedValue.AsUInt16(); + public int IntValye => PackedValue.AsInt32(); + public uint UIntValye => PackedValue.AsUInt32(); + public long LongValye => PackedValue.AsInt64(); + public ulong ULongValye => PackedValue.AsUInt64(); + public float FloatValue => PackedValue.AsSingle(); + public double DoubleValue => PackedValue.AsDouble(); + public string StringValue => PackedValue.AsString(); + public Span BinaryValue => PackedValue.AsBinary(); + + #endregion } ///