From 78a1cd0533fd4b6d5be77f9f6f2a87ca6b509d03 Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 15 Jun 2026 03:02:33 +0200 Subject: [hle] support passing arguments to homebrew applications (#4013) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Homebrew (.NRO) program args support Adds a 'program_args' setting and delivers it to NRO homebrews via libnx's homebrew ABI. NROs previously had no way to receive CLI flags (e.g. NZ:P's -noglsl). Setting: program_args, Category::System, startup-only. Surfaced in Qt + Android Debug sections. NRO loader: builds a 4-entry 'ConfigEntry' table + argv at the data segment tail; prepends 'homebrew ' so user args land at argv[1]; scans for 'svc #7' to use as LR. Drops the stale NSO-style argdata append. KProcess: stores loader-provided guest addresses; 'Run' switches to the homebrew entry (x0=config_ptr, x1=-1, lr=svc7) and patches the real MainThreadHandle into the ConfigEntry slot. Legacy NSO path unchanged. Tested on NZP — args reach 'argv' correctly. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4013 Reviewed-by: Lizzie Reviewed-by: MaranBr --- src/common/settings.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/common/settings.h') diff --git a/src/common/settings.h b/src/common/settings.h index be9c080bc6..5f6e1a2206 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -779,7 +779,13 @@ struct Values { bool record_frame_times; Setting use_gdbstub{linkage, false, "use_gdbstub", Category::Debugging}; Setting gdbstub_port{linkage, 6543, "gdbstub_port", Category::Debugging}; - Setting program_args{linkage, std::string(), "program_args", Category::Debugging}; + SwitchableSetting program_args{linkage, + std::string(), + "program_args", + Category::System, + Specialization::Default, + true, // save_ — persist in config file + false}; // runtime_modifiable_ — startup-only Setting dump_exefs{linkage, false, "dump_exefs", Category::Debugging}; Setting dump_nso{linkage, false, "dump_nso", Category::Debugging}; Setting dump_shaders{ -- cgit v1.2.3