From 4c2d9ff3ff9d7afb1fd0bd764bee5931fa5f053c Mon Sep 17 00:00:00 2001 From: Ac_K Date: Fri, 31 Mar 2023 21:16:46 +0200 Subject: HLE: Refactoring of ApplicationLoader (#4480) * HLE: Refactoring of ApplicationLoader * Fix SDL2 Headless * Addresses gdkchan feedback * Fixes LoadUnpackedNca RomFS loading * remove useless casting * Cleanup and fixe empty application name * Remove ProcessInfo * Fixes typo * ActiveProcess to ActiveApplication * Update check * Clean using. * Use the correct filepath when loading Homebrew.npdm * Fix NRE in ProcessResult if MetaLoader is null * Add more checks for valid processId & return success * Add missing logging statement for npdm error * Return result for LoadKip() * Move error logging out of PFS load extension method This avoids logging "Could not find Main NCA" followed by "Loading main..." when trying to start hbl. * Fix GUIs not checking load results * Fix style and formatting issues * Fix formatting and wording * gtk: Refactor LoadApplication() --------- Co-authored-by: TSR Berry <20988865+TSRBerry@users.noreply.github.com> --- Ryujinx.HLE/Switch.cs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Ryujinx.HLE/Switch.cs') diff --git a/Ryujinx.HLE/Switch.cs b/Ryujinx.HLE/Switch.cs index 61e5e572..62d14a54 100644 --- a/Ryujinx.HLE/Switch.cs +++ b/Ryujinx.HLE/Switch.cs @@ -6,6 +6,7 @@ using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.HOS; using Ryujinx.HLE.HOS.Services.Apm; using Ryujinx.HLE.HOS.Services.Hid; +using Ryujinx.HLE.Loaders.Processes; using Ryujinx.HLE.Ui; using Ryujinx.Memory; using System; @@ -20,7 +21,7 @@ namespace Ryujinx.HLE public GpuContext Gpu { get; } public VirtualFileSystem FileSystem { get; } public HOS.Horizon System { get; } - public ApplicationLoader Application { get; } + public ProcessLoader Processes { get; } public PerformanceStatistics Statistics { get; } public Hid Hid { get; } public TamperMachine TamperMachine { get; } @@ -50,7 +51,7 @@ namespace Ryujinx.HLE System = new HOS.Horizon(this); Statistics = new PerformanceStatistics(); Hid = new Hid(this, System.HidStorage); - Application = new ApplicationLoader(this); + Processes = new ProcessLoader(this); TamperMachine = new TamperMachine(); System.State.SetLanguage(Configuration.SystemLanguage); @@ -64,29 +65,29 @@ namespace Ryujinx.HLE System.GlobalAccessLogMode = Configuration.FsGlobalAccessLogMode; } - public void LoadCart(string exeFsDir, string romFsFile = null) + public bool LoadCart(string exeFsDir, string romFsFile = null) { - Application.LoadCart(exeFsDir, romFsFile); + return Processes.LoadUnpackedNca(exeFsDir, romFsFile); } - public void LoadXci(string xciFile) + public bool LoadXci(string xciFile) { - Application.LoadXci(xciFile); + return Processes.LoadXci(xciFile); } - public void LoadNca(string ncaFile) + public bool LoadNca(string ncaFile) { - Application.LoadNca(ncaFile); + return Processes.LoadNca(ncaFile); } - public void LoadNsp(string nspFile) + public bool LoadNsp(string nspFile) { - Application.LoadNsp(nspFile); + return Processes.LoadNsp(nspFile); } - public void LoadProgram(string fileName) + public bool LoadProgram(string fileName) { - Application.LoadProgram(fileName); + return Processes.LoadNxo(fileName); } public bool WaitFifo() @@ -123,7 +124,7 @@ namespace Ryujinx.HLE public void EnableCheats() { - FileSystem.ModLoader.EnableCheats(Application.TitleId, TamperMachine); + FileSystem.ModLoader.EnableCheats(Processes.ActiveApplication.ProgramId, TamperMachine); } public bool IsAudioMuted() @@ -152,4 +153,4 @@ namespace Ryujinx.HLE } } } -} \ No newline at end of file +} -- cgit v1.2.3