Read XCIs with patches. Code style
This commit is contained in:
parent
9b09156d5b
commit
d5cce6b50c
1 changed files with 15 additions and 1 deletions
|
@ -136,6 +136,7 @@ namespace Ryujinx.HLE.HOS
|
||||||
if (Nca == null)
|
if (Nca == null)
|
||||||
{
|
{
|
||||||
Device.Log.PrintError(LogClass.Loader, "Unable to load XCI");
|
Device.Log.PrintError(LogClass.Loader, "Unable to load XCI");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +151,7 @@ namespace Ryujinx.HLE.HOS
|
||||||
}
|
}
|
||||||
|
|
||||||
Nca MainNca = null;
|
Nca MainNca = null;
|
||||||
|
Nca PatchNca = null;
|
||||||
|
|
||||||
foreach (PfsFileEntry FileEntry in Xci.SecurePartition.Files.Where(x => x.Name.EndsWith(".nca")))
|
foreach (PfsFileEntry FileEntry in Xci.SecurePartition.Files.Where(x => x.Name.EndsWith(".nca")))
|
||||||
{
|
{
|
||||||
|
@ -159,7 +161,14 @@ namespace Ryujinx.HLE.HOS
|
||||||
|
|
||||||
if (Nca.Header.ContentType == ContentType.Program)
|
if (Nca.Header.ContentType == ContentType.Program)
|
||||||
{
|
{
|
||||||
MainNca = Nca;
|
if (Nca.Sections.Any(x => x?.Type == SectionType.Romfs))
|
||||||
|
{
|
||||||
|
MainNca = Nca;
|
||||||
|
}
|
||||||
|
else if (Nca.Sections.Any(x => x?.Type == SectionType.Bktr))
|
||||||
|
{
|
||||||
|
PatchNca = Nca;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +177,8 @@ namespace Ryujinx.HLE.HOS
|
||||||
Device.Log.PrintError(LogClass.Loader, "Could not find an Application NCA in the provided XCI file");
|
Device.Log.PrintError(LogClass.Loader, "Could not find an Application NCA in the provided XCI file");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MainNca.SetBaseNca(PatchNca);
|
||||||
|
|
||||||
return MainNca;
|
return MainNca;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,6 +215,7 @@ namespace Ryujinx.HLE.HOS
|
||||||
if (Nca.Header.ContentType == ContentType.Program)
|
if (Nca.Header.ContentType == ContentType.Program)
|
||||||
{
|
{
|
||||||
LoadNca(Nca);
|
LoadNca(Nca);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,12 +231,14 @@ namespace Ryujinx.HLE.HOS
|
||||||
if (ExefsSection == null)
|
if (ExefsSection == null)
|
||||||
{
|
{
|
||||||
Device.Log.PrintError(LogClass.Loader, "No ExeFS found in NCA");
|
Device.Log.PrintError(LogClass.Loader, "No ExeFS found in NCA");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RomfsSection == null)
|
if (RomfsSection == null)
|
||||||
{
|
{
|
||||||
Device.Log.PrintError(LogClass.Loader, "No RomFS found in NCA");
|
Device.Log.PrintError(LogClass.Loader, "No RomFS found in NCA");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue