diff options
author | Mary <me@thog.eu> | 2020-07-04 01:58:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 01:58:01 +0200 |
commit | 2c48750ff078e28bd395e43f0e4686c47b13c762 (patch) | |
tree | f928a703529b067ead750948b089a1e50755c9fb /Ryujinx.HLE/HOS/ProgramLoader.cs | |
parent | e13154c83d52d9e1c26c55bc5655a5df641e26a9 (diff) |
Fix compilation warnings and use new LibHac APIs for executable loading (#1350)
* Fix compilation warnings and use new LibHac APIs for executable loading
* Migrate NSO loader to the new reader and fix kip loader
* Fix CS0162 restore
* Remove extra return lines
* Address Moose's comment
Diffstat (limited to 'Ryujinx.HLE/HOS/ProgramLoader.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/ProgramLoader.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Ryujinx.HLE/HOS/ProgramLoader.cs b/Ryujinx.HLE/HOS/ProgramLoader.cs index 1158925a..cf5b15ba 100644 --- a/Ryujinx.HLE/HOS/ProgramLoader.cs +++ b/Ryujinx.HLE/HOS/ProgramLoader.cs @@ -32,7 +32,7 @@ namespace Ryujinx.HLE.HOS int codePagesCount = codeSize / KMemoryManager.PageSize; - ulong codeBaseAddress = (kip.Header.Flags & 0x10) != 0 ? 0x8000000UL : 0x200000UL; + ulong codeBaseAddress = kip.Is64BitAddressSpace ? 0x8000000UL : 0x200000UL; ulong codeAddress = codeBaseAddress + (ulong)kip.TextOffset; @@ -45,27 +45,27 @@ namespace Ryujinx.HLE.HOS mmuFlags |= 0x20; } - if ((kip.Header.Flags & 0x10) != 0) + if (kip.Is64BitAddressSpace) { mmuFlags |= (int)AddressSpaceType.Addr39Bits << 1; } - if ((kip.Header.Flags & 0x08) != 0) + if (kip.Is64Bit) { mmuFlags |= 1; } ProcessCreationInfo creationInfo = new ProcessCreationInfo( - kip.Header.Name, - kip.Header.ProcessCategory, - kip.Header.TitleId, + kip.Name, + kip.Version, + kip.ProgramId, codeAddress, codePagesCount, mmuFlags, 0, 0); - MemoryRegion memoryRegion = (kip.Header.Flags & 0x20) != 0 + MemoryRegion memoryRegion = kip.UsesSecureMemory ? MemoryRegion.Service : MemoryRegion.Application; @@ -105,9 +105,9 @@ namespace Ryujinx.HLE.HOS return false; } - process.DefaultCpuCore = kip.Header.DefaultCore; + process.DefaultCpuCore = kip.IdealCoreId; - result = process.Start(kip.Header.MainThreadPriority, (ulong)kip.Header.Sections[1].Attribute); + result = process.Start(kip.Priority, (ulong)kip.StackSize); if (result != KernelResult.Success) { |