Merge pull request #298 from Cyuubi/npdm

Add Npdm parsing into Ryujinx.HLE
This commit is contained in:
emmauss 2018-08-02 22:59:14 +03:00 committed by GitHub
commit d137405e94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -1,4 +1,5 @@
using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.Loaders.Npdm;
using Ryujinx.HLE.Logging; using Ryujinx.HLE.Logging;
using Ryujinx.HLE.OsHle.Handles; using Ryujinx.HLE.OsHle.Handles;
using System; using System;
@ -76,6 +77,25 @@ namespace Ryujinx.HLE.OsHle
} }
} }
void LoadNpdm(string FileName)
{
string File = Directory.GetFiles(ExeFsDir, FileName)[0];
Ns.Log.PrintInfo(LogClass.Loader, "Loading Title Metadata...");
using (FileStream Input = new FileStream(File, FileMode.Open))
{
SystemStateMgr.TitleMetadata = new Npdm(Input);
}
}
LoadNpdm("*.npdm");
if (!SystemStateMgr.TitleMetadata.Is64Bits)
{
throw new Exception("32-bit titles are unsupported!");
}
LoadNso("rtld"); LoadNso("rtld");
MainProcess.SetEmptyArgs(); MainProcess.SetEmptyArgs();

View file

@ -1,9 +1,12 @@
using Ryujinx.HLE.Loaders.Npdm;
using System; using System;
namespace Ryujinx.HLE.OsHle namespace Ryujinx.HLE.OsHle
{ {
public class SystemStateMgr public class SystemStateMgr
{ {
internal static Npdm TitleMetadata { get; set; }
internal static string[] LanguageCodes = new string[] internal static string[] LanguageCodes = new string[]
{ {
"ja", "ja",