diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2020-02-11 15:43:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-11 23:43:24 +0100 |
| commit | e7a4e0a3283b0b3669f281aa4218ed6f1ca44232 (patch) | |
| tree | e13dc3f7f5efd7b22066bc40cc0499c4e15a3dcd | |
| parent | 7e4d986a731e9cba05f24b2efd14e18ebc39e75d (diff) | |
Get program IDs for the game list from NCA headers (#928)
Previously it would try various fields from the NACP and didn't always work
| -rw-r--r-- | Ryujinx/Ui/ApplicationLibrary.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Ryujinx/Ui/ApplicationLibrary.cs b/Ryujinx/Ui/ApplicationLibrary.cs index 3707cc63..d7dc948f 100644 --- a/Ryujinx/Ui/ApplicationLibrary.cs +++ b/Ryujinx/Ui/ApplicationLibrary.cs @@ -156,7 +156,7 @@ namespace Ryujinx.Ui else { // Store the ControlFS in variable called controlFs - IFileSystem controlFs = GetControlFs(pfs); + GetControlFsAndTitleId(pfs, out IFileSystem controlFs, out titleId); // Creates NACP class from the NACP file controlFs.OpenFile(out IFile controlNacpFile, "/control.nacp", OpenMode.Read).ThrowIfFailure(); @@ -166,7 +166,7 @@ namespace Ryujinx.Ui // Get the title name, title ID, developer name and version number from the NACP version = controlData.DisplayVersion; - GetNameIdDeveloper(controlData, out titleName, out titleId, out developer); + GetNameIdDeveloper(controlData, out titleName, out _, out developer); // Read the icon from the ControlFS and store it as a byte array try @@ -409,7 +409,7 @@ namespace Ryujinx.Ui return resourceByteArray; } - private static IFileSystem GetControlFs(PartitionFileSystem pfs) + private static void GetControlFsAndTitleId(PartitionFileSystem pfs, out IFileSystem controlFs, out string titleId) { Nca controlNca = null; @@ -440,7 +440,8 @@ namespace Ryujinx.Ui } // Return the ControlFS - return controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None); + controlFs = controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None); + titleId = controlNca?.Header.TitleId.ToString("x16"); } internal static ApplicationMetadata LoadAndSaveMetaData(string titleId, Action<ApplicationMetadata> modifyFunction = null) |
