mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-31 15:53:17 +00:00
CLI: Add argument to pass an argument to the game (#2135)
This commit is contained in:
parent
1ea5f8f092
commit
3b92cd1c1a
6 changed files with 61 additions and 9 deletions
|
@ -52,7 +52,7 @@ Linker::Linker() : memory{Memory::Instance()} {}
|
|||
|
||||
Linker::~Linker() = default;
|
||||
|
||||
void Linker::Execute() {
|
||||
void Linker::Execute(const std::vector<std::string> args) {
|
||||
if (Config::debugDump()) {
|
||||
DebugDump();
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ void Linker::Execute() {
|
|||
|
||||
memory->SetupMemoryRegions(fmem_size, use_extended_mem1, use_extended_mem2);
|
||||
|
||||
main_thread.Run([this, module](std::stop_token) {
|
||||
main_thread.Run([this, module, args](std::stop_token) {
|
||||
Common::SetCurrentThreadName("GAME_MainThread");
|
||||
LoadSharedLibraries();
|
||||
|
||||
|
@ -109,6 +109,12 @@ void Linker::Execute() {
|
|||
EntryParams params{};
|
||||
params.argc = 1;
|
||||
params.argv[0] = "eboot.bin";
|
||||
if (!args.empty()) {
|
||||
params.argc = args.size() + 1;
|
||||
for (int i = 0; i < args.size() && i < 32; i++) {
|
||||
params.argv[i + 1] = args[i].c_str();
|
||||
}
|
||||
}
|
||||
params.entry_addr = module->GetEntryAddress();
|
||||
RunMainEntry(¶ms);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue