mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 14:00:16 +02:00
Config: Add the ability to inject command line arguments
Simple enough since we control the full emulation
This commit is contained in:
1 parent
da48020882
commit
c9319a768f
2 files changed
+13
No files matched your search
@@ -115,6 +115,13 @@
|
||||
"This can be useful for setting environment variables that thunks can pick up.",
|
||||
"Typically isn't necessary since the guest libc isn't thunked. But is possible."
|
||||
]
|
||||
},
|
||||
"AdditionalArguments": {
|
||||
"Type": "strarray",
|
||||
"Default": "",
|
||||
"Desc": [
|
||||
"Allows the user to pass additional arguments to the application"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Debug": {
|
||||
|
||||
@@ -255,6 +255,11 @@ class ELFCodeLoader2 final : public FEXCore::CodeLoader {
|
||||
Args.erase(Args.begin());
|
||||
}
|
||||
|
||||
// Append any additional arguments from config
|
||||
for (auto &Arg : AdditionalArguments.All()) {
|
||||
Args.emplace_back(Arg);
|
||||
}
|
||||
|
||||
if (!MainElf.InterpreterElf.empty()) {
|
||||
if (!InterpElf.ReadElf(ResolveRootfsFile(MainElf.InterpreterElf, RootFS)) && !InterpElf.ReadElf(MainElf.InterpreterElf))
|
||||
return;
|
||||
@@ -651,5 +656,6 @@ class ELFCodeLoader2 final : public FEXCore::CodeLoader {
|
||||
uint64_t ArgumentBackingSize{};
|
||||
uint64_t EnvironmentBackingSize{};
|
||||
uint64_t BaseOffset{};
|
||||
FEX_CONFIG_OPT(AdditionalArguments, ADDITIONALARGUMENTS);
|
||||
|
||||
};
|
||||
Reference in new issue
Block a user