aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/Loaders
diff options
context:
space:
mode:
authorThomas Guillemard <thog@protonmail.com>2018-07-17 21:14:27 +0200
committergdkchan <gab.dark.100@gmail.com>2018-07-17 16:14:27 -0300
commitc2c765b30fdfa9184df580133e22ae946eebc022 (patch)
tree3784a0bdaab54f47c6cdc0ca83ed78a0de4563f5 /Ryujinx.HLE/Loaders
parent5d698a7d8d240b9d324e385fb05c0ce9f26fb410 (diff)
hbabi: Implement argv (#272)
This commit implements the argv config key in Ryujinx (by creating a temporary copy of the homebrew executable in the sdmc VFS) to make it possible to load libnx's "romfs" files. This commit also call Os.Dispose in Ns.OnFinish to dispose all resources when exiting
Diffstat (limited to 'Ryujinx.HLE/Loaders')
-rw-r--r--Ryujinx.HLE/Loaders/Executable.cs6
-rw-r--r--Ryujinx.HLE/Loaders/Executables/IExecutable.cs2
-rw-r--r--Ryujinx.HLE/Loaders/Executables/Nro.cs6
-rw-r--r--Ryujinx.HLE/Loaders/Executables/Nso.cs4
4 files changed, 11 insertions, 7 deletions
diff --git a/Ryujinx.HLE/Loaders/Executable.cs b/Ryujinx.HLE/Loaders/Executable.cs
index 618ee241..43193245 100644
--- a/Ryujinx.HLE/Loaders/Executable.cs
+++ b/Ryujinx.HLE/Loaders/Executable.cs
@@ -2,6 +2,7 @@ using ChocolArm64.Memory;
using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.OsHle;
using System.Collections.Generic;
+using System.IO;
namespace Ryujinx.HLE.Loaders
{
@@ -15,6 +16,8 @@ namespace Ryujinx.HLE.Loaders
public string Name { get; private set; }
+ public string FilePath { get; private set; }
+
private AMemory Memory;
public long ImageBase { get; private set; }
@@ -26,8 +29,9 @@ namespace Ryujinx.HLE.Loaders
m_SymbolTable = new Dictionary<long, string>();
- Name = Exe.Name;
+ FilePath = Exe.FilePath;
+ Name = Path.GetFileNameWithoutExtension(FilePath.Replace(Homebrew.TemporaryNroSuffix, ""));
this.Memory = Memory;
this.ImageBase = ImageBase;
this.ImageEnd = ImageBase;
diff --git a/Ryujinx.HLE/Loaders/Executables/IExecutable.cs b/Ryujinx.HLE/Loaders/Executables/IExecutable.cs
index 1e8e569a..44bad614 100644
--- a/Ryujinx.HLE/Loaders/Executables/IExecutable.cs
+++ b/Ryujinx.HLE/Loaders/Executables/IExecutable.cs
@@ -2,7 +2,7 @@ namespace Ryujinx.HLE.Loaders.Executables
{
public interface IExecutable
{
- string Name { get; }
+ string FilePath { get; }
byte[] Text { get; }
byte[] RO { get; }
diff --git a/Ryujinx.HLE/Loaders/Executables/Nro.cs b/Ryujinx.HLE/Loaders/Executables/Nro.cs
index 9e2b7e90..0b5068d7 100644
--- a/Ryujinx.HLE/Loaders/Executables/Nro.cs
+++ b/Ryujinx.HLE/Loaders/Executables/Nro.cs
@@ -4,7 +4,7 @@ namespace Ryujinx.HLE.Loaders.Executables
{
class Nro : IExecutable
{
- public string Name { get; private set; }
+ public string FilePath { get; private set; }
public byte[] Text { get; private set; }
public byte[] RO { get; private set; }
@@ -16,9 +16,9 @@ namespace Ryujinx.HLE.Loaders.Executables
public int DataOffset { get; private set; }
public int BssSize { get; private set; }
- public Nro(Stream Input, string Name)
+ public Nro(Stream Input, string FilePath)
{
- this.Name = Name;
+ this.FilePath = FilePath;
BinaryReader Reader = new BinaryReader(Input);
diff --git a/Ryujinx.HLE/Loaders/Executables/Nso.cs b/Ryujinx.HLE/Loaders/Executables/Nso.cs
index a5e1a361..6a55c755 100644
--- a/Ryujinx.HLE/Loaders/Executables/Nso.cs
+++ b/Ryujinx.HLE/Loaders/Executables/Nso.cs
@@ -6,7 +6,7 @@ namespace Ryujinx.HLE.Loaders.Executables
{
class Nso : IExecutable
{
- public string Name { get; private set; }
+ public string FilePath { get; private set; }
public byte[] Text { get; private set; }
public byte[] RO { get; private set; }
@@ -31,7 +31,7 @@ namespace Ryujinx.HLE.Loaders.Executables
public Nso(Stream Input, string Name)
{
- this.Name = Name;
+ this.FilePath = FilePath;
BinaryReader Reader = new BinaryReader(Input);