aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.HLE/Loaders/Processes/ProcessResult.cs')
-rw-r--r--Ryujinx.HLE/Loaders/Processes/ProcessResult.cs36
1 files changed, 13 insertions, 23 deletions
diff --git a/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs b/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs
index b9596c8f..2801e4e0 100644
--- a/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs
+++ b/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs
@@ -5,6 +5,7 @@ using Ryujinx.Cpu;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Loaders.Processes.Extensions;
using Ryujinx.Horizon.Common;
+using System.Linq;
namespace Ryujinx.HLE.Loaders.Processes
{
@@ -21,8 +22,9 @@ namespace Ryujinx.HLE.Loaders.Processes
public readonly ApplicationControlProperty ApplicationControlProperties;
public readonly ulong ProcessId;
- public string Name;
- public ulong ProgramId;
+ public readonly string Name;
+ public readonly string DisplayVersion;
+ public readonly ulong ProgramId;
public readonly string ProgramIdText;
public readonly bool Is64Bit;
public readonly bool DiskCacheEnabled;
@@ -52,20 +54,17 @@ namespace Ryujinx.HLE.Loaders.Processes
{
ulong programId = metaLoader.GetProgramId();
- if (ApplicationControlProperties.Title.ItemsRo.Length > 0)
- {
- var langIndex = ApplicationControlProperties.Title.ItemsRo.Length > (int)titleLanguage ? (int)titleLanguage : 0;
+ Name = ApplicationControlProperties.Title[(int)titleLanguage].NameString.ToString();
- Name = ApplicationControlProperties.Title[langIndex].NameString.ToString();
- }
- else
+ if (string.IsNullOrWhiteSpace(Name))
{
- Name = metaLoader.GetProgramName();
+ Name = ApplicationControlProperties.Title.ItemsRo.ToArray().FirstOrDefault(x => x.Name[0] != 0).NameString.ToString();
}
- ProgramId = programId;
- ProgramIdText = $"{programId:x16}";
- Is64Bit = metaLoader.IsProgram64Bit();
+ DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString();
+ ProgramId = programId;
+ ProgramIdText = $"{programId:x16}";
+ Is64Bit = metaLoader.IsProgram64Bit();
}
DiskCacheEnabled = diskCacheEnabled;
@@ -85,20 +84,11 @@ namespace Ryujinx.HLE.Loaders.Processes
}
// TODO: LibHac npdm currently doesn't support version field.
- string version;
-
- if (ProgramId > 0x0100000000007FFF)
- {
- version = ApplicationControlProperties.DisplayVersionString.ToString();
- }
- else
- {
- version = device.System.ContentManager.GetCurrentFirmwareVersion().VersionString;
- }
+ string version = ProgramId > 0x0100000000007FFF ? DisplayVersion : device.System.ContentManager.GetCurrentFirmwareVersion()?.VersionString ?? "?";
Logger.Info?.Print(LogClass.Loader, $"Application Loaded: {Name} v{version} [{ProgramIdText}] [{(Is64Bit ? "64-bit" : "32-bit")}]");
return true;
}
}
-} \ No newline at end of file
+}