Implement ContentManager and related services (#438)

* Implement contentmanager and related services

* small changes

* read system firmware version from nand

* add pfs support, write directoryentry info for romfs files

* add file check in fsp-srv:8

* add support for open fs of internal files

* fix filename when accessing pfs

* use switch style paths for contentpath

* close nca after verifying type

* removed publishing profiles, align directory entry

* fix style

* lots of style fixes

* yasf(yet another style fix)

* yasf(yet another style fix) plus symbols

* enforce path check on every fs access

* change enum type to default

* fix typo
This commit is contained in:
emmauss 2018-11-18 21:37:41 +02:00 committed by gdkchan
parent e603b7afbc
commit fe8fbb6fb9
38 changed files with 2179 additions and 173 deletions

View file

@ -1,5 +1,6 @@
using LibHac;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.FileSystem.Content;
using Ryujinx.HLE.HOS.Font;
using Ryujinx.HLE.HOS.Kernel;
using Ryujinx.HLE.HOS.SystemState;
@ -42,6 +43,8 @@ namespace Ryujinx.HLE.HOS
internal SharedFontManager Font { get; private set; }
internal ContentManager ContentManager { get; private set; }
internal KEvent VsyncEvent { get; private set; }
internal Keyset KeySet { get; private set; }
@ -90,6 +93,8 @@ namespace Ryujinx.HLE.HOS
VsyncEvent = new KEvent(this);
LoadKeySet();
ContentManager = new ContentManager(Device);
}
public void LoadCart(string ExeFsDir, string RomFsFile = null)
@ -156,6 +161,8 @@ namespace Ryujinx.HLE.HOS
LoadNso("subsdk*");
LoadNso("sdk");
ContentManager.LoadEntries();
MainProcess.Run();
}
@ -174,6 +181,8 @@ namespace Ryujinx.HLE.HOS
return;
}
ContentManager.LoadEntries();
LoadNca(MainNca, ControlNca);
}
@ -412,6 +421,8 @@ namespace Ryujinx.HLE.HOS
LoadNso("subsdk");
LoadNso("sdk");
ContentManager.LoadEntries();
MainProcess.Run();
}
@ -419,13 +430,13 @@ namespace Ryujinx.HLE.HOS
{
bool IsNro = Path.GetExtension(FilePath).ToLower() == ".nro";
string Name = Path.GetFileNameWithoutExtension(FilePath);
string Name = Path.GetFileNameWithoutExtension(FilePath);
string SwitchFilePath = Device.FileSystem.SystemPathToSwitchPath(FilePath);
if (IsNro && (SwitchFilePath == null || !SwitchFilePath.StartsWith("sdmc:/")))
{
string SwitchPath = $"sdmc:/switch/{Name}{Homebrew.TemporaryNroSuffix}";
string TempPath = Device.FileSystem.SwitchPathToSystemPath(SwitchPath);
string TempPath = Device.FileSystem.SwitchPathToSystemPath(SwitchPath);
string SwitchDir = Path.GetDirectoryName(TempPath);
@ -449,6 +460,9 @@ namespace Ryujinx.HLE.HOS
}
MainProcess.SetEmptyArgs();
ContentManager.LoadEntries();
MainProcess.Run(IsNro);
}