Compare commits

...

4 commits

Author SHA1 Message Date
citrabot 569d8ea8b9 Canary #2753 2024-01-20 00:25:10 +00:00
citrabot b99580fa57 Merge PR 7366 2024-01-20 00:25:10 +00:00
citrabot 4393358a41 Merge PR 7355 2024-01-20 00:25:10 +00:00
citrabot fc22d9133e Merge PR 7345 2024-01-20 00:25:10 +00:00
18 changed files with 119 additions and 59 deletions

View file

@ -1,3 +1,14 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
| [7345](https://github.com/citra-emu/citra//pull/7345) | [`5250cf0bd`](https://github.com/citra-emu/citra//pull/7345/files) | frontend: Add setting for whether to use LLE applets. | [Steveice10](https://github.com/Steveice10/) | Yes |
| [7355](https://github.com/citra-emu/citra//pull/7355) | [`870625cb1`](https://github.com/citra-emu/citra//pull/7355/files) | glsl_shader_gen: Use epsilon for both ends of NDC range | [GPUCode](https://github.com/GPUCode/) | Yes |
| [7366](https://github.com/citra-emu/citra//pull/7366) | [`ab2c559a2`](https://github.com/citra-emu/citra//pull/7366/files) | shader_unit: Intialize temporaries on shader invocation | [GPUCode](https://github.com/GPUCode/) | Yes |
End of merge log. You can find the original README.md below the break.
-----
<h1 align="center"> <h1 align="center">
<br> <br>
<a href="https://citra-emu.org/"><img src="https://raw.githubusercontent.com/citra-emu/citra-assets/master/Main/citra_logo.svg" alt="Citra" width="200"></a> <a href="https://citra-emu.org/"><img src="https://raw.githubusercontent.com/citra-emu/citra-assets/master/Main/citra_logo.svg" alt="Citra" width="200"></a>

View file

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

View file

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

View file

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

View file

@ -270,6 +270,10 @@ use_virtual_sd =
# 0: Old 3DS (default), 1: New 3DS # 0: Old 3DS (default), 1: New 3DS
is_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 # 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 # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value = region_value =

View file

@ -171,6 +171,7 @@
<!-- System settings strings --> <!-- System settings strings -->
<string name="username">Username</string> <string name="username">Username</string>
<string name="new_3ds">New 3DS Mode</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="clock">Clock</string>
<string name="init_time">Offset Time</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> <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 // System
ReadSetting("System", Settings::values.is_new_3ds); ReadSetting("System", Settings::values.is_new_3ds);
ReadSetting("System", Settings::values.lle_applets);
ReadSetting("System", Settings::values.region_value); ReadSetting("System", Settings::values.region_value);
ReadSetting("System", Settings::values.init_clock); ReadSetting("System", Settings::values.init_clock);
{ {

View file

@ -294,6 +294,10 @@ nand_directory =
# 0: Old 3DS, 1: New 3DS (default) # 0: Old 3DS, 1: New 3DS (default)
is_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 # 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 # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
region_value = region_value =

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -432,6 +432,7 @@ struct Values {
Setting<bool> use_cpu_jit{true, "use_cpu_jit"}; Setting<bool> use_cpu_jit{true, "use_cpu_jit"};
SwitchableSetting<s32, true> cpu_clock_percentage{100, 5, 400, "cpu_clock_percentage"}; SwitchableSetting<s32, true> cpu_clock_percentage{100, 5, 400, "cpu_clock_percentage"};
SwitchableSetting<bool> is_new_3ds{true, "is_new_3ds"}; SwitchableSetting<bool> is_new_3ds{true, "is_new_3ds"};
SwitchableSetting<bool> lle_applets{false, "lle_applets"};
// Data Storage // Data Storage
Setting<bool> use_virtual_sd{true, "use_virtual_sd"}; 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(); capture_buffer_info.reset();
auto cfg = Service::CFG::GetModule(system); if (Settings::values.lle_applets) {
auto process = auto cfg = Service::CFG::GetModule(system);
NS::LaunchTitle(FS::MediaType::NAND, GetTitleIdForApplet(applet_id, cfg->GetRegionValue())); auto process = NS::LaunchTitle(FS::MediaType::NAND,
if (process) { GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
return ResultSuccess; if (process) {
return ResultSuccess;
}
} }
// If we weren't able to load the native applet title, try to fallback to an HLE implementation. // 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_library_launcher_slot = active_slot;
last_prepared_library_applet = applet_id; last_prepared_library_applet = applet_id;
auto cfg = Service::CFG::GetModule(system); if (Settings::values.lle_applets) {
auto process = auto cfg = Service::CFG::GetModule(system);
NS::LaunchTitle(FS::MediaType::NAND, GetTitleIdForApplet(applet_id, cfg->GetRegionValue())); auto process = NS::LaunchTitle(FS::MediaType::NAND,
if (process) { GetTitleIdForApplet(applet_id, cfg->GetRegionValue()));
return ResultSuccess; if (process) {
return ResultSuccess;
}
} }
// If we weren't able to load the native applet title, try to fallback to an HLE implementation. // 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())); static_cast<int>(Settings::values.mono_render_option.GetValue()));
AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds", AddField(Telemetry::FieldType::UserConfig, "System_IsNew3ds",
Settings::values.is_new_3ds.GetValue()); Settings::values.is_new_3ds.GetValue());
AddField(Telemetry::FieldType::UserConfig, "System_LLEApplets",
Settings::values.lle_applets.GetValue());
AddField(Telemetry::FieldType::UserConfig, "System_RegionValue", AddField(Telemetry::FieldType::UserConfig, "System_RegionValue",
Settings::values.region_value.GetValue()); Settings::values.region_value.GetValue());
} }

View file

@ -9,7 +9,10 @@
namespace Pica { namespace Pica {
ShaderUnit::ShaderUnit(GeometryEmitter* emitter) : emitter_ptr{emitter} {} ShaderUnit::ShaderUnit(GeometryEmitter* emitter) : emitter_ptr{emitter} {
const Common::Vec4<f24> temp_vec{f24::Zero(), f24::Zero(), f24::Zero(), f24::One()};
temporary.fill(temp_vec);
}
ShaderUnit::~ShaderUnit() = default; ShaderUnit::~ShaderUnit() = default;

View file

@ -39,6 +39,19 @@ layout (binding = 1, std140) uniform vs_data {
bool enable_clip1; bool enable_clip1;
vec4 clip_coef; vec4 clip_coef;
}; };
const vec2 EPSILON_Z = vec2(0.00000001f, -1.00001f);
vec4 SanitizeVertex(vec4 vtx_pos) {
float ndc_z = vtx_pos.z / vtx_pos.w;
if (ndc_z > 0.f && ndc_z < EPSILON_Z[0]) {
vtx_pos.z = 0.f;
}
if (ndc_z < -1.f && ndc_z > EPSILON_Z[1]) {
vtx_pos.z = -vtx_pos.w;
}
return vtx_pos;
}
)"; )";
static std::string GetVertexInterfaceDeclaration(bool is_output, bool use_clip_planes, static std::string GetVertexInterfaceDeclaration(bool is_output, bool use_clip_planes,
@ -94,13 +107,7 @@ std::string GenerateTrivialVertexShader(bool use_clip_planes, bool separable_sha
out += GetVertexInterfaceDeclaration(true, use_clip_planes, separable_shader); out += GetVertexInterfaceDeclaration(true, use_clip_planes, separable_shader);
out += VSUniformBlockDef; out += VSUniformBlockDef;
// Certain games render 2D elements very close to clip plane 0 resulting in very tiny
// negative/positive z values when computing with f32 precision,
// causing some vertices to get erroneously clipped. To workaround this problem,
// we can use a very small epsilon value for clip plane comparison.
out += R"( out += R"(
const float EPSILON_Z = 0.00000001f;
void main() { void main() {
primary_color = vert_color; primary_color = vert_color;
texcoord0 = vert_texcoord0; texcoord0 = vert_texcoord0;
@ -109,10 +116,7 @@ void main() {
texcoord0_w = vert_texcoord0_w; texcoord0_w = vert_texcoord0_w;
normquat = vert_normquat; normquat = vert_normquat;
view = vert_view; view = vert_view;
vec4 vtx_pos = vert_position; vec4 vtx_pos = SanitizeVertex(vert_position);
if (abs(vtx_pos.z) < EPSILON_Z) {
vtx_pos.z = 0.f;
}
gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w); gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w);
)"; )";
if (use_clip_planes) { if (use_clip_planes) {
@ -215,7 +219,6 @@ std::string GenerateVertexShader(const ShaderSetup& setup, const PicaVSConfig& c
return "1.0"; return "1.0";
}; };
out += "const float EPSILON_Z = 0.00000001f;\n\n";
out += "vec4 GetVertexQuaternion() {\n"; out += "vec4 GetVertexQuaternion() {\n";
out += " return vec4(" + semantic(VSOutputAttributes::QUATERNION_X) + ", " + out += " return vec4(" + semantic(VSOutputAttributes::QUATERNION_X) + ", " +
semantic(VSOutputAttributes::QUATERNION_Y) + ", " + semantic(VSOutputAttributes::QUATERNION_Y) + ", " +
@ -228,9 +231,7 @@ std::string GenerateVertexShader(const ShaderSetup& setup, const PicaVSConfig& c
semantic(VSOutputAttributes::POSITION_Y) + ", " + semantic(VSOutputAttributes::POSITION_Y) + ", " +
semantic(VSOutputAttributes::POSITION_Z) + ", " + semantic(VSOutputAttributes::POSITION_Z) + ", " +
semantic(VSOutputAttributes::POSITION_W) + ");\n"; semantic(VSOutputAttributes::POSITION_W) + ");\n";
out += " if (abs(vtx_pos.z) < EPSILON_Z) {\n"; out += " vtx_pos = SanitizeVertex(vtx_pos);\n";
out += " vtx_pos.z = 0.f;\n";
out += " }\n";
out += " gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w);\n"; out += " gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w);\n";
if (config.state.use_clip_planes) { if (config.state.use_clip_planes) {
out += " gl_ClipDistance[0] = -vtx_pos.z;\n"; // fixed PICA clipping plane z <= 0 out += " gl_ClipDistance[0] = -vtx_pos.z;\n"; // fixed PICA clipping plane z <= 0
@ -312,7 +313,6 @@ struct Vertex {
return "1.0"; return "1.0";
}; };
out += "const float EPSILON_Z = 0.00000001f;\n\n";
out += "vec4 GetVertexQuaternion(Vertex vtx) {\n"; out += "vec4 GetVertexQuaternion(Vertex vtx) {\n";
out += " return vec4(" + semantic(VSOutputAttributes::QUATERNION_X) + ", " + out += " return vec4(" + semantic(VSOutputAttributes::QUATERNION_X) + ", " +
semantic(VSOutputAttributes::QUATERNION_Y) + ", " + semantic(VSOutputAttributes::QUATERNION_Y) + ", " +
@ -325,9 +325,7 @@ struct Vertex {
semantic(VSOutputAttributes::POSITION_Y) + ", " + semantic(VSOutputAttributes::POSITION_Y) + ", " +
semantic(VSOutputAttributes::POSITION_Z) + ", " + semantic(VSOutputAttributes::POSITION_Z) + ", " +
semantic(VSOutputAttributes::POSITION_W) + ");\n"; semantic(VSOutputAttributes::POSITION_W) + ");\n";
out += " if (abs(vtx_pos.z) < EPSILON_Z) {\n"; out += " vtx_pos = SanitizeVertex(vtx_pos);\n";
out += " vtx_pos.z = 0.f;\n";
out += " }\n";
out += " gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w);\n"; out += " gl_Position = vec4(vtx_pos.x, vtx_pos.y, -vtx_pos.z, vtx_pos.w);\n";
if (state.use_clip_planes) { if (state.use_clip_planes) {
out += " gl_ClipDistance[0] = -vtx_pos.z;\n"; // fixed PICA clipping plane z <= 0 out += " gl_ClipDistance[0] = -vtx_pos.z;\n"; // fixed PICA clipping plane z <= 0