diff options
| author | mageven <62494521+mageven@users.noreply.github.com> | 2020-06-20 23:08:14 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-20 19:38:14 +0200 |
| commit | 1c2af7ce926bd6f48309247dc65012d410d77bee (patch) | |
| tree | d9c280ebdd4bda537abe39e953de08f47c50101a /Ryujinx.HLE/HOS/ApplicationLoader.cs | |
| parent | 4d56f97f1e62cf3d5a5de3088f5b755a7dcf5f51 (diff) | |
Implement aoc:u and support loading AddOnContent (#1221)
* Initial rebased AddOnContent support
* Fix bounds calculation
* Use existing GameCard in VFS per Xpl0itR's suggestion
+ Add dummy IPurchaseEventManager per AcK's suggestion
* Support multiple containers
* Add option to selectively disable addons
* Import tickets from AOC FS
* Load all nsps in base directory automatically
* Revert LoadNsp renaming
Removes conflicts with Mods PR. Not much is lost, old names were fine.
* Address AcK's comments
* Address Thog's comments
Dispose opened nsp files
Fix potential bug by clearing metadata on load
Diffstat (limited to 'Ryujinx.HLE/HOS/ApplicationLoader.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/ApplicationLoader.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/ApplicationLoader.cs b/Ryujinx.HLE/HOS/ApplicationLoader.cs index c44c40b5..5ca67445 100644 --- a/Ryujinx.HLE/HOS/ApplicationLoader.cs +++ b/Ryujinx.HLE/HOS/ApplicationLoader.cs @@ -146,6 +146,20 @@ namespace Ryujinx.HLE.HOS _contentManager.LoadEntries(_device); + _contentManager.ClearAocData(); + _contentManager.AddAocData(securePartition, xciFile, mainNca.Header.TitleId); + + // Check all nsp's in the base directory for AOC + foreach (var fn in new FileInfo(xciFile).Directory.EnumerateFiles("*.nsp")) + { + using (FileStream fs = fn.OpenRead()) + using (IStorage storage = fs.AsStorage()) + using (PartitionFileSystem pfs = new PartitionFileSystem(storage)) + { + _contentManager.AddAocData(pfs, fn.FullName, mainNca.Header.TitleId); + } + } + LoadNca(mainNca, patchNca, controlNca); } @@ -179,6 +193,21 @@ namespace Ryujinx.HLE.HOS if (mainNca != null) { + _contentManager.ClearAocData(); + _contentManager.AddAocData(nsp, nspFile, mainNca.Header.TitleId); + + // Check all nsp's in the base directory for AOC + foreach (var fn in new FileInfo(nspFile).Directory.EnumerateFiles("*.nsp")) + { + if (fn.FullName == nspFile) continue; + using (FileStream fs = fn.OpenRead()) + using (IStorage storage = fs.AsStorage()) + using (PartitionFileSystem pfs = new PartitionFileSystem(storage)) + { + _contentManager.AddAocData(pfs, fn.FullName, mainNca.Header.TitleId); + } + } + LoadNca(mainNca, patchNca, controlNca); return; |
