Implement lib_loading_type::liblv2both

This commit is contained in:
Nekotekina 2019-08-06 20:59:41 +03:00
parent 87bf0386c4
commit ae46333e99
6 changed files with 23 additions and 5 deletions

View File

@ -49,6 +49,7 @@ void fmt_class_string<lib_loading_type>::format(std::string& out, u64 arg)
case lib_loading_type::manual: return "Manually load selected libraries";
case lib_loading_type::both: return "Load automatic and manual selection";
case lib_loading_type::liblv2only: return "Load liblv2.sprx only";
case lib_loading_type::liblv2both: return "Load liblv2.sprx and manual selection";
}
return unknown;
@ -1281,7 +1282,7 @@ void ppu_load_exec(const ppu_exec_object& elf)
// Load required set of modules (lib_loading_type::both processed in sys_prx.cpp)
load_libs = g_cfg.core.load_libraries.get_set();
}
else if (g_cfg.core.lib_loading == lib_loading_type::liblv2only)
else if (g_cfg.core.lib_loading == lib_loading_type::liblv2only || g_cfg.core.lib_loading == lib_loading_type::liblv2both)
{
// Load only liblv2.sprx
load_libs.emplace("liblv2.sprx");

View File

@ -119,7 +119,7 @@ static error_code prx_load_module(const std::string& vpath, u64 flags, vm::ptr<s
bool ignore = s_prx_ignore.count(vpath) != 0;
if (ignore && g_cfg.core.lib_loading == lib_loading_type::both)
if (ignore && (g_cfg.core.lib_loading == lib_loading_type::both || g_cfg.core.lib_loading == lib_loading_type::liblv2both))
{
// Ignore ignore list if the library is selected in 'both' mode
if (g_cfg.core.load_libraries.get_set().count(name) != 0)

View File

@ -45,7 +45,8 @@ enum class lib_loading_type
automatic,
manual,
both,
liblv2only
liblv2only,
liblv2both,
};
enum sleep_timers_accuracy_level : u32

View File

@ -28,6 +28,7 @@
"auto": "Automatically selects the LLE libraries to load.\nWhile this option works fine in most cases, liblv2 is the preferred option.",
"manual": "Allows the user to manually choose the LLE libraries to load.\nIf unsure, don't use this option. Nothing will work if you use this.",
"both": "Automatically selects the LLE libraries to load and allows the user to choose additional libraries manually.\nIf unsure, don't use this option.",
"liblv2both": "Loads liblv2.sprx and chosen list of libraries.\nIf unsure, don't use this option.",
"liblv2": "This closely emulates how games can load and unload system module files on a real PlayStation 3.\nSome games require this.\nThis is the preferred option."
},
"checkboxes": {

View File

@ -309,6 +309,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
SubscribeTooltip(ui->lib_manu, json_cpu_lib["manual"].toString());
SubscribeTooltip(ui->lib_both, json_cpu_lib["both"].toString());
SubscribeTooltip(ui->lib_lv2, json_cpu_lib["liblv2"].toString());
SubscribeTooltip(ui->lib_lv2b, json_cpu_lib["liblv2both"].toString());
// creating this in ui file keeps scrambling the order...
QButtonGroup *libModeBG = new QButtonGroup(this);
@ -316,6 +317,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
libModeBG->addButton(ui->lib_manu, (int)lib_loading_type::manual);
libModeBG->addButton(ui->lib_both, (int)lib_loading_type::both);
libModeBG->addButton(ui->lib_lv2, (int)lib_loading_type::liblv2only);
libModeBG->addButton(ui->lib_lv2b, (int)lib_loading_type::liblv2both);
{// Handle lib loading options
QString selectedLib = qstr(xemu_settings->GetSetting(emu_settings::LibLoadOptions));
@ -387,7 +389,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> guiSettings, std:
auto l_OnLibButtonClicked = [=](int ind)
{
if (ind == (int)lib_loading_type::manual || ind == (int)lib_loading_type::both)
if (ind == (int)lib_loading_type::manual || ind == (int)lib_loading_type::both || ind == (int)lib_loading_type::liblv2both)
{
ui->searchBox->setEnabled(true);
ui->lleList->setEnabled(true);

View File

@ -200,6 +200,19 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="lib_lv2b">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Load liblv2.sprx and manual selection</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>