Reimplement config selection for game startup

* Implement manual selection of config file.
* Implement default config option.
* Fix bug which led to 'force global config' to not work in some games. (any game using process relaunch such most game collections, RDR, MGS4 etc)
* Relax CLI config purpose - instead the emulator forever ignoring any other config except for the one provided in arg, use it only for the CLI-booted game.
This commit is contained in:
Eladash 2021-09-08 15:23:50 +03:00 committed by Megamouse
parent df080fbc53
commit 1cbcf7e1ad
8 changed files with 102 additions and 53 deletions

View file

@ -411,7 +411,8 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr<sys_exit2_param> ar
if (disc.empty() && !Emu.GetTitleID().empty())
disc = vfs::get(Emu.GetDir());
Emu.CallAfter([path = std::move(path), argv = std::move(argv), envp = std::move(envp), data = std::move(data), disc = std::move(disc), hdd1 = std::move(hdd1), klic = g_fxo->get<loaded_npdrm_keys>().devKlic.load()]() mutable
Emu.CallAfter([path = std::move(path), argv = std::move(argv), envp = std::move(envp), data = std::move(data), disc = std::move(disc)
, hdd1 = std::move(hdd1), klic = g_fxo->get<loaded_npdrm_keys>().devKlic.load(), old_config = Emu.GetUsedConfig()]() mutable
{
sys_process.success("Process finished -> %s", argv[0]);
Emu.SetForceBoot(true);
@ -429,7 +430,7 @@ void _sys_process_exit2(ppu_thread& ppu, s32 status, vm::ptr<sys_exit2_param> ar
Emu.SetForceBoot(true);
auto res = Emu.BootGame(path, "", true);
auto res = Emu.BootGame(path, "", true, false, old_config);
if (res != game_boot_result::no_errors)
{