frontend: Add setting for whether to use LLE applets. (#7345)

This commit is contained in:
Steveice10 2024-01-20 12:13:06 -08:00 committed by GitHub
parent c59ef7d793
commit f26044bb88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 88 additions and 40 deletions

View file

@ -25,6 +25,7 @@ enum class IntSetting(
SCREEN_LAYOUT("layout_option", Settings.SECTION_LAYOUT, 0),
AUDIO_INPUT_TYPE("output_type", Settings.SECTION_AUDIO, 0),
NEW_3DS("is_new_3ds", Settings.SECTION_SYSTEM, 1),
LLE_APPLETS("lle_applets", Settings.SECTION_SYSTEM, 0),
CPU_CLOCK_SPEED("cpu_clock_percentage", Settings.SECTION_CORE, 100),
LINEAR_FILTERING("filter_mode", Settings.SECTION_RENDERER, 1),
SHADERS_ACCURATE_MUL("shaders_accurate_mul", Settings.SECTION_RENDERER, 0),
@ -61,6 +62,7 @@ enum class IntSetting(
EMULATED_REGION,
INIT_CLOCK,
NEW_3DS,
LLE_APPLETS,
GRAPHICS_API,
VSYNC,
DEBUG_RENDERER,

View file

@ -907,6 +907,15 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
IntSetting.NEW_3DS.defaultValue
)
)
add(
SwitchSetting(
IntSetting.LLE_APPLETS,
R.string.lle_applets,
0,
IntSetting.LLE_APPLETS.key,
IntSetting.LLE_APPLETS.defaultValue
)
)
add(
SliderSetting(
IntSetting.CPU_CLOCK_SPEED,

View file

@ -206,6 +206,7 @@ void Config::ReadValues() {
// System
ReadSetting("System", Settings::values.is_new_3ds);
ReadSetting("System", Settings::values.lle_applets);
ReadSetting("System", Settings::values.region_value);
ReadSetting("System", Settings::values.init_clock);
{

View file

@ -270,6 +270,10 @@ use_virtual_sd =
# 0: Old 3DS (default), 1: New 3DS
is_new_3ds =
# Whether to use LLE system applets, if installed
# 0 (default): No, 1: Yes
lle_applets =
# The system region that Citra will use during emulation
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value =

View file

@ -171,6 +171,7 @@
<!-- System settings strings -->
<string name="username">Username</string>
<string name="new_3ds">New 3DS Mode</string>
<string name="lle_applets">Use LLE Applets (if installed)</string>
<string name="clock">Clock</string>
<string name="init_time">Offset Time</string>
<string name="init_time_description">If the clock is set to \"Simulated clock\", this changes the fixed date and time to start at.</string>

View file

@ -203,6 +203,7 @@ void Config::ReadValues() {
// System
ReadSetting("System", Settings::values.is_new_3ds);
ReadSetting("System", Settings::values.lle_applets);
ReadSetting("System", Settings::values.region_value);
ReadSetting("System", Settings::values.init_clock);
{

View file

@ -294,6 +294,10 @@ nand_directory =
# 0: Old 3DS, 1: New 3DS (default)
is_new_3ds =
# Whether to use LLE system applets, if installed
# 0 (default): No, 1: Yes
lle_applets =
# The system region that Citra will use during emulation
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value =

View file

@ -682,6 +682,7 @@ void Config::ReadSystemValues() {
qt_config->beginGroup(QStringLiteral("System"));
ReadGlobalSetting(Settings::values.is_new_3ds);
ReadGlobalSetting(Settings::values.lle_applets);
ReadGlobalSetting(Settings::values.region_value);
if (global) {
@ -1172,6 +1173,7 @@ void Config::SaveSystemValues() {
qt_config->beginGroup(QStringLiteral("System"));
WriteGlobalSetting(Settings::values.is_new_3ds);
WriteGlobalSetting(Settings::values.lle_applets);
WriteGlobalSetting(Settings::values.region_value);
if (global) {

View file

@ -309,6 +309,7 @@ void ConfigureSystem::SetConfiguration() {
}
ui->toggle_new_3ds->setChecked(Settings::values.is_new_3ds.GetValue());
ui->toggle_lle_applets->setChecked(Settings::values.lle_applets.GetValue());
ui->plugin_loader->setChecked(Settings::values.plugin_loader_enabled.GetValue());
ui->allow_plugin_loader->setChecked(Settings::values.allow_plugin_loader.GetValue());
}
@ -415,6 +416,8 @@ void ConfigureSystem::ApplyConfiguration() {
ConfigurationShared::ApplyPerGameSetting(&Settings::values.is_new_3ds, ui->toggle_new_3ds,
is_new_3ds);
ConfigurationShared::ApplyPerGameSetting(&Settings::values.lle_applets,
ui->toggle_lle_applets, lle_applets);
Settings::values.init_clock =
static_cast<Settings::InitClock>(ui->combo_init_clock->currentIndex());
@ -434,6 +437,7 @@ void ConfigureSystem::ApplyConfiguration() {
Settings::values.init_time_offset = time_offset_days + time_offset_time;
Settings::values.is_new_3ds = ui->toggle_new_3ds->isChecked();
Settings::values.lle_applets = ui->toggle_lle_applets->isChecked();
Settings::values.plugin_loader_enabled.SetValue(ui->plugin_loader->isChecked());
Settings::values.allow_plugin_loader.SetValue(ui->allow_plugin_loader->isChecked());
@ -526,6 +530,7 @@ void ConfigureSystem::SetupPerGameUI() {
// Block the global settings if a game is currently running that overrides them
if (Settings::IsConfiguringGlobal()) {
ui->toggle_new_3ds->setEnabled(Settings::values.is_new_3ds.UsingGlobal());
ui->toggle_lle_applets->setEnabled(Settings::values.lle_applets.UsingGlobal());
return;
}
@ -569,6 +574,8 @@ void ConfigureSystem::SetupPerGameUI() {
ConfigurationShared::SetColoredTristate(ui->toggle_new_3ds, Settings::values.is_new_3ds,
is_new_3ds);
ConfigurationShared::SetColoredTristate(ui->toggle_lle_applets, Settings::values.lle_applets,
lle_applets);
}
void ConfigureSystem::DownloadFromNUS() {

View file

@ -54,6 +54,7 @@ private:
std::unique_ptr<Ui::ConfigureSystem> ui;
Core::System& system;
ConfigurationShared::CheckState is_new_3ds;
ConfigurationShared::CheckState lle_applets;
bool enabled = false;
std::shared_ptr<Service::CFG::Module> cfg;

View file

@ -29,7 +29,14 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="2" column="0">
<widget class="QCheckBox" name="toggle_lle_applets">
<property name="text">
<string>Use LLE applets (if installed)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="edit_username">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -42,21 +49,21 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_username">
<property name="text">
<string>Username</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_birthday">
<property name="text">
<string>Birthday</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_birthday2">
<item>
<widget class="QComboBox" name="combo_birthmonth">
@ -127,14 +134,14 @@
</item>
</layout>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_language">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="QComboBox" name="combo_language">
<property name="toolTip">
<string>Note: this can be overridden when region setting is auto-select</string>
@ -201,14 +208,14 @@
</item>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_sound">
<property name="text">
<string>Sound output mode</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QComboBox" name="combo_sound">
<item>
<property name="text">
@ -227,24 +234,24 @@
</item>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_country">
<property name="text">
<string>Country</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="QComboBox" name="combo_country"/>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_init_clock">
<property name="text">
<string>Clock</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<widget class="QComboBox" name="combo_init_clock">
<item>
<property name="text">
@ -258,28 +265,28 @@
</item>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_init_time">
<property name="text">
<string>Startup time</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QDateTimeEdit" name="edit_init_time">
<property name="displayFormat">
<string>yyyy-MM-ddTHH:mm:ss</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_init_time_offset">
<property name="text">
<string>Offset time</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<layout class="QGridLayout" name="edit_init_time_offset_grid">
<item row="0" column="0">
<widget class="QSpinBox" name="edit_init_time_offset_days">
@ -303,14 +310,14 @@
</item>
</layout>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_init_ticks_type">
<property name="text">
<string>Initial System Ticks</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="QComboBox" name="combo_init_ticks_type">
<item>
<property name="text">
@ -324,14 +331,14 @@
</item>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_init_ticks_value">
<property name="text">
<string>Initial System Ticks Override</string>
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QLineEdit" name="edit_init_ticks_value">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -344,35 +351,35 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_play_coins">
<property name="text">
<string>Play Coins:</string>
</property>
</widget>
</item>
<item row="11" column="1">
<item row="12" column="1">
<widget class="QSpinBox" name="spinBox_play_coins">
<property name="maximum">
<number>300</number>
</property>
</widget>
</item>
<item row="12" column="1">
<item row="13" column="1">
<widget class="QCheckBox" name="toggle_system_setup">
<property name="text">
<string>Run System Setup when Home Menu is launched</string>
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="label_console_id">
<property name="text">
<string>Console ID:</string>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="QPushButton" name="button_regenerate_console_id">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -388,35 +395,35 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="label_plugin_loader">
<property name="text">
<string>3GX Plugin Loader:</string>
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<widget class="QCheckBox" name="plugin_loader">
<property name="text">
<string>Enable 3GX plugin loader</string>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="16" column="1">
<widget class="QCheckBox" name="allow_plugin_loader">
<property name="text">
<string>Allow games to change plugin loader state</string>
</property>
</widget>
</item>
<item row="16" column="0">
<item row="17" column="0">
<widget class="QLabel" name="label_nus_download">
<property name="text">
<string>Download System Files from Nitendo servers</string>
</property>
</widget>
</item>
<item row="16" column="1">
<item row="17" column="1">
<widget class="QWidget" name="body_nus_download">
<layout class="QHBoxLayout" name="horizontalLayout_nus_download">
<item>

View file

@ -138,6 +138,7 @@ void LogSettings() {
log_setting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir));
}
log_setting("System_IsNew3ds", values.is_new_3ds.GetValue());
log_setting("System_LLEApplets", values.lle_applets.GetValue());
log_setting("System_RegionValue", values.region_value.GetValue());
log_setting("System_PluginLoader", values.plugin_loader_enabled.GetValue());
log_setting("System_PluginLoaderAllowed", values.allow_plugin_loader.GetValue());
@ -175,6 +176,7 @@ void RestoreGlobalState(bool is_powered_on) {
// Core
values.cpu_clock_percentage.SetGlobal(true);
values.is_new_3ds.SetGlobal(true);
values.lle_applets.SetGlobal(true);
// Renderer
values.graphics_api.SetGlobal(true);

View file

@ -432,6 +432,7 @@ struct Values {
Setting<bool> use_cpu_jit{true, "use_cpu_jit"};
SwitchableSetting<s32, true> cpu_clock_percentage{100, 5, 400, "cpu_clock_percentage"};
SwitchableSetting<bool> is_new_3ds{true, "is_new_3ds"};
SwitchableSetting<bool> lle_applets{false, "lle_applets"};
// Data Storage
Setting<bool> use_virtual_sd{true, "use_virtual_sd"};

View file

@ -568,11 +568,13 @@ Result AppletManager::PrepareToStartLibraryApplet(AppletId applet_id) {
capture_buffer_info.reset();
auto cfg = Service::CFG::GetModule(system);
auto process =
NS::LaunchTitle(FS::MediaType::NAND, GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
if (process) {
return ResultSuccess;
if (Settings::values.lle_applets) {
auto cfg = Service::CFG::GetModule(system);
auto process = NS::LaunchTitle(FS::MediaType::NAND,
GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
if (process) {
return ResultSuccess;
}
}
// If we weren't able to load the native applet title, try to fallback to an HLE implementation.
@ -595,11 +597,13 @@ Result AppletManager::PreloadLibraryApplet(AppletId applet_id) {
last_library_launcher_slot = active_slot;
last_prepared_library_applet = applet_id;
auto cfg = Service::CFG::GetModule(system);
auto process =
NS::LaunchTitle(FS::MediaType::NAND, GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
if (process) {
return ResultSuccess;
if (Settings::values.lle_applets) {
auto cfg = Service::CFG::GetModule(system);
auto process = NS::LaunchTitle(FS::MediaType::NAND,
GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
if (process) {
return ResultSuccess;
}
}
// If we weren't able to load the native applet title, try to fallback to an HLE implementation.

View file

@ -155,6 +155,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) {
static_cast<int>(Settings::values.mono_render_option.GetValue()));
AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds",
Settings::values.is_new_3ds.GetValue());
AddField(Telemetry::FieldType::UserConfig, "System_LLEApplets",
Settings::values.lle_applets.GetValue());
AddField(Telemetry::FieldType::UserConfig, "System_RegionValue",
Settings::values.region_value.GetValue());
}