aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS
diff options
context:
space:
mode:
authorMary <me@thog.eu>2020-07-04 01:58:01 +0200
committerGitHub <noreply@github.com>2020-07-04 01:58:01 +0200
commit2c48750ff078e28bd395e43f0e4686c47b13c762 (patch)
treef928a703529b067ead750948b089a1e50755c9fb /Ryujinx.HLE/HOS
parente13154c83d52d9e1c26c55bc5655a5df641e26a9 (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')
-rw-r--r--Ryujinx.HLE/HOS/ApplicationLoader.cs8
-rw-r--r--Ryujinx.HLE/HOS/ProgramLoader.cs18
-rw-r--r--Ryujinx.HLE/HOS/Services/Bluetooth/IBluetoothDriver.cs4
-rw-r--r--Ryujinx.HLE/HOS/Services/Sockets/Nsd/Manager/FqdnResolver.cs2
4 files changed, 17 insertions, 15 deletions
diff --git a/Ryujinx.HLE/HOS/ApplicationLoader.cs b/Ryujinx.HLE/HOS/ApplicationLoader.cs
index f6ab5ba9..bc7016bd 100644
--- a/Ryujinx.HLE/HOS/ApplicationLoader.cs
+++ b/Ryujinx.HLE/HOS/ApplicationLoader.cs
@@ -415,13 +415,13 @@ namespace Ryujinx.HLE.HOS
bool isNro = Path.GetExtension(filePath).ToLower() == ".nro";
- IExecutable nro;
+ IExecutable executable;
if (isNro)
{
FileStream input = new FileStream(filePath, FileMode.Open);
NroExecutable obj = new NroExecutable(input);
- nro = obj;
+ executable = obj;
// homebrew NRO can actually have some data after the actual NRO
if (input.Length > obj.FileSize)
@@ -493,7 +493,7 @@ namespace Ryujinx.HLE.HOS
}
else
{
- nro = new NsoExecutable(new LocalStorage(filePath, FileAccess.Read));
+ executable = new NsoExecutable(new LocalStorage(filePath, FileAccess.Read));
}
_contentManager.LoadEntries(_device);
@@ -502,7 +502,7 @@ namespace Ryujinx.HLE.HOS
TitleId = metaData.Aci0.TitleId;
TitleIs64Bit = metaData.Is64Bit;
- ProgramLoader.LoadNsos(_device.System.KernelContext, metaData, executables: nro);
+ ProgramLoader.LoadNsos(_device.System.KernelContext, metaData, executables: executable);
}
private Npdm GetDefaultNpdm()
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)
{
diff --git a/Ryujinx.HLE/HOS/Services/Bluetooth/IBluetoothDriver.cs b/Ryujinx.HLE/HOS/Services/Bluetooth/IBluetoothDriver.cs
index 8bbf26b2..d94030fa 100644
--- a/Ryujinx.HLE/HOS/Services/Bluetooth/IBluetoothDriver.cs
+++ b/Ryujinx.HLE/HOS/Services/Bluetooth/IBluetoothDriver.cs
@@ -9,9 +9,9 @@ namespace Ryujinx.HLE.HOS.Services.Bluetooth
[Service("btdrv")]
class IBluetoothDriver : IpcService
{
-#pragma warning disable CS0169
+#pragma warning disable CS0414
private string _unknownLowEnergy;
-#pragma warning restore CS0169
+#pragma warning restore CS0414
public IBluetoothDriver(ServiceCtx context) { }
diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Nsd/Manager/FqdnResolver.cs b/Ryujinx.HLE/HOS/Services/Sockets/Nsd/Manager/FqdnResolver.cs
index 246c92bd..3bdf15a1 100644
--- a/Ryujinx.HLE/HOS/Services/Sockets/Nsd/Manager/FqdnResolver.cs
+++ b/Ryujinx.HLE/HOS/Services/Sockets/Nsd/Manager/FqdnResolver.cs
@@ -32,7 +32,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd.Manager
return ResultCode.Success;
}
+#pragma warning disable CS0162
return ResultCode.NullOutputObject;
+#pragma warning restore CS0162
}
}