diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-05 03:34:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-05 03:34:21 +0200 |
commit | 52d6f2e656c21c3e6693df93a3f09cd2e6a4e40e (patch) | |
tree | 7a1ff997fe97c4ccf7e423931471d506174f9cae /Ryujinx.HLE/Loaders/Processes/ProcessResult.cs | |
parent | c9bc4eaf58ca0d693a37b1229bb6fc210ce71474 (diff) |
hle: Set ProcessResult name from NACP (#4633)1.1.695
* Extract titleName from nacp
* Address formatting feedback
* Check if the desired language is actually available
Diffstat (limited to 'Ryujinx.HLE/Loaders/Processes/ProcessResult.cs')
-rw-r--r-- | Ryujinx.HLE/Loaders/Processes/ProcessResult.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs b/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs index 6bbeee1b..b9596c8f 100644 --- a/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs +++ b/Ryujinx.HLE/Loaders/Processes/ProcessResult.cs @@ -2,6 +2,7 @@ using LibHac.Ns; using Ryujinx.Common.Logging; using Ryujinx.Cpu; +using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.Horizon.Common; @@ -9,7 +10,7 @@ namespace Ryujinx.HLE.Loaders.Processes { public struct ProcessResult { - public static ProcessResult Failed => new(null, new ApplicationControlProperty(), false, false, null, 0, 0, 0); + public static ProcessResult Failed => new(null, new ApplicationControlProperty(), false, false, null, 0, 0, 0, TitleLanguage.AmericanEnglish); private readonly byte _mainThreadPriority; private readonly uint _mainThreadStackSize; @@ -35,7 +36,8 @@ namespace Ryujinx.HLE.Loaders.Processes IDiskCacheLoadState diskCacheLoadState, ulong pid, byte mainThreadPriority, - uint mainThreadStackSize) + uint mainThreadStackSize, + TitleLanguage titleLanguage) { _mainThreadPriority = mainThreadPriority; _mainThreadStackSize = mainThreadStackSize; @@ -50,7 +52,17 @@ namespace Ryujinx.HLE.Loaders.Processes { ulong programId = metaLoader.GetProgramId(); - Name = metaLoader.GetProgramName(); + if (ApplicationControlProperties.Title.ItemsRo.Length > 0) + { + var langIndex = ApplicationControlProperties.Title.ItemsRo.Length > (int)titleLanguage ? (int)titleLanguage : 0; + + Name = ApplicationControlProperties.Title[langIndex].NameString.ToString(); + } + else + { + Name = metaLoader.GetProgramName(); + } + ProgramId = programId; ProgramIdText = $"{programId:x16}"; Is64Bit = metaLoader.IsProgram64Bit(); |