aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs
diff options
context:
space:
mode:
authormageven <62494521+mageven@users.noreply.github.com>2020-07-09 10:01:15 +0530
committerGitHub <noreply@github.com>2020-07-09 14:31:15 +1000
commit189c0c9c726b3a700272831cd5cf10b2fc817cc2 (patch)
tree724e5d808c061917ae686e1e557c504fff3cd24f /Ryujinx.HLE/FileSystem/VirtualFileSystem.cs
parentc050994995268494d46a6cac1d4ffa931effa0f6 (diff)
Implement modding support (#1249)
* Implement Modding Support * Executables: Rewrite to use contiguous mem and Spans * Reorder ExeFs, Npdm, ControlData and SaveData calls After discussion with gdkchan, it was decided it's best to call LoadExeFs after all other loads are done as it starts the guest process. * Build RomFs manually instead of Layering FS Layered FS approach has considerable latency when building the final romfs. So, we manually replace files in a single romfs instance. * Add RomFs modding via storage file * Fix and cleanup MemPatch * Add dynamically loaded NRO patching * Support exefs file replacement * Rewrite ModLoader to use mods-search architecture * Disable PPTC when exefs patches are detected Disable PPTC on exefs replacements too * Rewrite ModLoader, again * Increased maintainability and matches Atmosphere closely * Creates base mods structure if it doesn't exist * Add Exefs partition replacement * IPSwitch: Fix nsobid parsing * Move mod logs to new LogClass * Allow custom suffixes to title dirs again * Address nits * Add a per-App "Open Mods Directory" context menu item Creates the path if not present. * Normalize tooltips verbiage * Use LocalStorage and remove unused namespaces
Diffstat (limited to 'Ryujinx.HLE/FileSystem/VirtualFileSystem.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/VirtualFileSystem.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs
index 347b4fa4..58890995 100644
--- a/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs
+++ b/Ryujinx.HLE/FileSystem/VirtualFileSystem.cs
@@ -17,11 +17,12 @@ namespace Ryujinx.HLE.FileSystem
public const string NandPath = "bis";
public const string SdCardPath = "sdcard";
public const string SystemPath = "system";
+ public const string ModsPath = "mods";
public static string SafeNandPath = Path.Combine(NandPath, "safe");
public static string SystemNandPath = Path.Combine(NandPath, "system");
public static string UserNandPath = Path.Combine(NandPath, "user");
-
+
private static bool _isInitialized = false;
public Keyset KeySet { get; private set; }
@@ -30,9 +31,12 @@ namespace Ryujinx.HLE.FileSystem
public EmulatedGameCard GameCard { get; private set; }
public EmulatedSdCard SdCard { get; private set; }
+ public ModLoader ModLoader {get; private set;}
+
private VirtualFileSystem()
{
Reload();
+ ModLoader = new ModLoader(); // Should only be created once
}
public Stream RomFs { get; private set; }
@@ -73,6 +77,14 @@ namespace Ryujinx.HLE.FileSystem
return fullPath;
}
+ public string GetBaseModsPath()
+ {
+ var baseModsDir = Path.Combine(GetBasePath(), "mods");
+ ModLoader.EnsureBaseDirStructure(baseModsDir);
+
+ return baseModsDir;
+ }
+
public string GetSdCardPath() => MakeFullPath(SdCardPath);
public string GetNandPath() => MakeFullPath(NandPath);