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
This commit is contained in:
parent
4d56f97f1e
commit
1c2af7ce92
5 changed files with 317 additions and 14 deletions
|
@ -372,17 +372,26 @@ namespace Ryujinx.HLE.HOS.Services.Fs
|
|||
byte[] padding = context.RequestData.ReadBytes(7);
|
||||
long titleId = context.RequestData.ReadInt64();
|
||||
|
||||
// We do a mitm here to find if the request is for an AOC.
|
||||
// This is because AOC can be distributed over multiple containers in the emulator.
|
||||
if (context.Device.System.ContentManager.GetAocDataStorage((ulong)titleId, out LibHac.Fs.IStorage aocStorage))
|
||||
{
|
||||
Logger.PrintInfo(LogClass.Loader, $"Opened AddOnContent Data TitleID={titleId:X16}");
|
||||
|
||||
MakeObject(context, new FileSystemProxy.IStorage(aocStorage));
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
NcaContentType contentType = NcaContentType.Data;
|
||||
|
||||
StorageId installedStorage =
|
||||
context.Device.System.ContentManager.GetInstalledStorage(titleId, contentType, storageId);
|
||||
StorageId installedStorage = context.Device.System.ContentManager.GetInstalledStorage(titleId, contentType, storageId);
|
||||
|
||||
if (installedStorage == StorageId.None)
|
||||
{
|
||||
contentType = NcaContentType.PublicData;
|
||||
|
||||
installedStorage =
|
||||
context.Device.System.ContentManager.GetInstalledStorage(titleId, contentType, storageId);
|
||||
installedStorage = context.Device.System.ContentManager.GetInstalledStorage(titleId, contentType, storageId);
|
||||
}
|
||||
|
||||
if (installedStorage != StorageId.None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue