mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-28 17:45:39 +00:00
[hle] support passing arguments to homebrew applications (#4013)
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 <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
@@ -84,6 +84,9 @@ private:
|
||||
Core::Memory::Memory m_memory;
|
||||
KCapabilities m_capabilities{};
|
||||
KProcessAddress m_code_address{};
|
||||
KProcessAddress m_arg_pointer{};
|
||||
KProcessAddress m_arg_return_address{};
|
||||
KProcessAddress m_main_thread_handle_addr{};
|
||||
KHandleTable m_handle_table;
|
||||
KProcessAddress m_plr_address{};
|
||||
ThreadList m_thread_list{};
|
||||
@@ -219,6 +222,16 @@ public:
|
||||
return m_code_address;
|
||||
}
|
||||
|
||||
void SetArgPointer(KProcessAddress addr) {
|
||||
m_arg_pointer = addr;
|
||||
}
|
||||
void SetArgReturnAddress(KProcessAddress addr) {
|
||||
m_arg_return_address = addr;
|
||||
}
|
||||
void SetMainThreadHandleAddr(KProcessAddress addr) {
|
||||
m_main_thread_handle_addr = addr;
|
||||
}
|
||||
|
||||
size_t GetMainStackSize() const {
|
||||
return m_main_thread_stack_size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user