diff options
| author | emmauss <emmausssss@gmail.com> | 2018-08-02 22:59:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-02 22:59:14 +0300 |
| commit | d137405e941c18ba0db0c3e06a2306ede9af8779 (patch) | |
| tree | e197a202c8859736157959366075eb12ccf4b5bf | |
| parent | b92189cb711fcf39255e04d3256c2728f271dbfd (diff) | |
| parent | 4b8a65fd84fcab991f62cf9cfdd8484c2e55501e (diff) | |
Merge pull request #298 from Cyuubi/npdm
Add Npdm parsing into Ryujinx.HLE
| -rw-r--r-- | Ryujinx.HLE/OsHle/Horizon.cs | 20 | ||||
| -rw-r--r-- | Ryujinx.HLE/OsHle/SystemStateMgr.cs | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/Ryujinx.HLE/OsHle/Horizon.cs b/Ryujinx.HLE/OsHle/Horizon.cs index 70ae24be..4c117fa4 100644 --- a/Ryujinx.HLE/OsHle/Horizon.cs +++ b/Ryujinx.HLE/OsHle/Horizon.cs @@ -1,4 +1,5 @@ using Ryujinx.HLE.Loaders.Executables; +using Ryujinx.HLE.Loaders.Npdm; using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Handles; 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"); MainProcess.SetEmptyArgs(); diff --git a/Ryujinx.HLE/OsHle/SystemStateMgr.cs b/Ryujinx.HLE/OsHle/SystemStateMgr.cs index e78082c4..32c88994 100644 --- a/Ryujinx.HLE/OsHle/SystemStateMgr.cs +++ b/Ryujinx.HLE/OsHle/SystemStateMgr.cs @@ -1,9 +1,12 @@ +using Ryujinx.HLE.Loaders.Npdm; using System; namespace Ryujinx.HLE.OsHle { public class SystemStateMgr { + internal static Npdm TitleMetadata { get; set; } + internal static string[] LanguageCodes = new string[] { "ja", |
