core: Add "toggle unique data console type" option (#1826)

This commit is contained in:
PabloMK7 2026-03-06 01:23:35 +01:00 committed by GitHub
parent 8d284aeccf
commit 2207be30a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 51 additions and 6 deletions

View File

@ -114,6 +114,7 @@ foreach(KEY IN ITEMS
"enable_rpc_server"
"log_filter"
"log_regex_filter"
"toggle_unique_data_console_type"
"use_integer_scaling"
"layouts_to_cycle"
"camera_inner_flip"

View File

@ -102,6 +102,7 @@ object SettingKeys {
external fun gdbstub_port(): String
external fun instant_debug_log(): String
external fun enable_rpc_server(): String
external fun toggle_unique_data_console_type(): String
external fun log_filter(): String
external fun log_regex_filter(): String
external fun use_integer_scaling(): String

View File

@ -20,6 +20,7 @@ enum class BooleanSetting(
SWAP_SCREEN(SettingKeys.swap_screen(), Settings.SECTION_LAYOUT, false),
INSTANT_DEBUG_LOG(SettingKeys.instant_debug_log(), Settings.SECTION_DEBUG, false),
ENABLE_RPC_SERVER(SettingKeys.enable_rpc_server(), Settings.SECTION_DEBUG, false),
TOGGLE_UNIQUE_DATA_CONSOLE_TYPE(SettingKeys.toggle_unique_data_console_type(), Settings.SECTION_DEBUG, false),
SWAP_EYES_3D(SettingKeys.swap_eyes_3d(),Settings.SECTION_RENDERER, false),
PERF_OVERLAY_ENABLE(SettingKeys.performance_overlay_enable(), Settings.SECTION_LAYOUT, false),
PERF_OVERLAY_SHOW_FPS(SettingKeys.performance_overlay_show_fps(), Settings.SECTION_LAYOUT, true),
@ -82,6 +83,7 @@ enum class BooleanSetting(
REQUIRED_ONLINE_LLE_MODULES,
NEW_3DS,
LLE_APPLETS,
TOGGLE_UNIQUE_DATA_CONSOLE_TYPE,
VSYNC,
DEBUG_RENDERER,
CPU_JIT,

View File

@ -1817,6 +1817,15 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
BooleanSetting.ENABLE_RPC_SERVER.defaultValue
)
)
add(
SwitchSetting(
BooleanSetting.TOGGLE_UNIQUE_DATA_CONSOLE_TYPE,
R.string.toggle_unique_data_console_type,
R.string.toggle_unique_data_console_type_desc,
BooleanSetting.TOGGLE_UNIQUE_DATA_CONSOLE_TYPE.key,
BooleanSetting.TOGGLE_UNIQUE_DATA_CONSOLE_TYPE.defaultValue
)
)
add(
SwitchSetting(
BooleanSetting.DELAY_START_LLE_MODULES,

View File

@ -315,6 +315,7 @@ void Config::ReadValues() {
ReadSetting("Debugging", Settings::values.gdbstub_port);
ReadSetting("Debugging", Settings::values.instant_debug_log);
ReadSetting("Debugging", Settings::values.enable_rpc_server);
ReadSetting("Debugging", Settings::values.toggle_unique_data_console_type);
for (const auto& service_module : Service::service_module_map) {
bool use_lle =

View File

@ -539,6 +539,10 @@ static const char* android_config_default_file_content = (BOOST_HANA_STRING(R"(
# 0 (default): Off, 1: On
)") DECLARE_KEY(enable_rpc_server) BOOST_HANA_STRING(R"(
# Enables toggling the unique data console type (Old 3DS <-> New 3DS) to be able to download the opposite system firmware type from system settings.
# 0 (default): Off, 1: On
)") DECLARE_KEY(toggle_unique_data_console_type) BOOST_HANA_STRING(R"(
# Delay the start of apps when LLE modules are enabled
# 0: Off, 1 (default): On
)") DECLARE_KEY(delay_start_for_lle_modules) BOOST_HANA_STRING(R"(

View File

@ -357,6 +357,8 @@
<string name="deterministic_async_operations_description">Makes async operations deterministic for debugging. Enabling this may cause freezes.</string>
<string name="enable_rpc_server">Enable RPC Server</string>
<string name="enable_rpc_server_desc">Enables the RPC server on port 45987. This allows remotely reading/writing guest memory.</string>
<string name="toggle_unique_data_console_type">Toggle unique data console type</string>
<string name="toggle_unique_data_console_type_desc">Toggles the unique data console type (Old 3DS &#8596; New 3DS) to be able to download the opposite system firmware type from system settings.</string>
<string name="shader_jit">Enable Shader JIT</string>
<string name="shader_jit_description">Use the JIT engine instead of the interpreter for software shader emulation.</string>

View File

@ -504,6 +504,7 @@ void QtConfig::ReadDebuggingValues() {
ReadBasicSetting(Settings::values.dump_command_buffers);
ReadBasicSetting(Settings::values.instant_debug_log);
ReadBasicSetting(Settings::values.enable_rpc_server);
ReadBasicSetting(Settings::values.toggle_unique_data_console_type);
qt_config->beginGroup(QStringLiteral("LLE"));
for (const auto& service_module : Service::service_module_map) {
@ -1084,6 +1085,7 @@ void QtConfig::SaveDebuggingValues() {
WriteBasicSetting(Settings::values.renderer_debug);
WriteBasicSetting(Settings::values.instant_debug_log);
WriteBasicSetting(Settings::values.enable_rpc_server);
WriteBasicSetting(Settings::values.toggle_unique_data_console_type);
qt_config->beginGroup(QStringLiteral("LLE"));
for (const auto& service_module : Settings::values.lle_modules) {

View File

@ -74,6 +74,7 @@ ConfigureDebug::ConfigureDebug(bool is_powered_on_, QWidget* parent)
ui->toggle_renderer_debug->setEnabled(!is_powered_on);
ui->toggle_dump_command_buffers->setEnabled(!is_powered_on);
ui->enable_rpc_server->setEnabled(!is_powered_on);
ui->toggle_unique_data_console_type->setEnabled(!is_powered_on);
// Set a minimum width for the label to prevent the slider from changing size.
// This scales across DPIs. (This value should be enough for "xxx%")
@ -109,6 +110,8 @@ void ConfigureDebug::SetConfiguration() {
#ifndef ENABLE_SCRIPTING
ui->enable_rpc_server->setVisible(false);
#endif // !ENABLE_SCRIPTING
ui->toggle_unique_data_console_type->setChecked(
Settings::values.toggle_unique_data_console_type.GetValue());
ui->toggle_renderer_debug->setChecked(Settings::values.renderer_debug.GetValue());
ui->toggle_dump_command_buffers->setChecked(Settings::values.dump_command_buffers.GetValue());
@ -148,6 +151,8 @@ void ConfigureDebug::ApplyConfiguration() {
Settings::values.deterministic_async_operations =
ui->deterministic_async_operations->isChecked();
Settings::values.enable_rpc_server = ui->enable_rpc_server->isChecked();
Settings::values.toggle_unique_data_console_type =
ui->toggle_unique_data_console_type->isChecked();
Settings::values.renderer_debug = ui->toggle_renderer_debug->isChecked();
Settings::values.dump_command_buffers = ui->toggle_dump_command_buffers->isChecked();
Settings::values.instant_debug_log = ui->instant_debug_log->isChecked();
@ -172,6 +177,7 @@ void ConfigureDebug::SetupPerGameUI() {
ui->groupBox->setVisible(false);
ui->groupBox_2->setVisible(false);
ui->enable_rpc_server->setVisible(false);
ui->toggle_unique_data_console_type->setVisible(false);
ui->toggle_cpu_jit->setVisible(false);
}

View File

@ -270,6 +270,16 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="toggle_unique_data_console_type">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Toggles the unique data console type (Old 3DS &#8596; New 3DS) to be able to download the opposite system firmware type from system settings.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Toggle unique data console type</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="deterministic_async_operations">
<property name="text">
<string>Force deterministic async operations</string>
@ -279,7 +289,7 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QCheckBox" name="enable_rpc_server">
<property name="text">
<string>Enable RPC server</string>

View File

@ -163,6 +163,8 @@ void LogSettings() {
log_setting("Debugging_UseGdbstub", values.use_gdbstub.GetValue());
log_setting("Debugging_GdbstubPort", values.gdbstub_port.GetValue());
log_setting("Debugging_InstantDebugLog", values.instant_debug_log.GetValue());
log_setting("Debugging_ToggleUniqueDataConsoleType",
values.toggle_unique_data_console_type.GetValue());
}
bool IsConfiguringGlobal() {

View File

@ -635,6 +635,7 @@ struct Values {
Setting<u16> gdbstub_port{24689, Keys::gdbstub_port};
Setting<bool> instant_debug_log{false, Keys::instant_debug_log};
Setting<bool> enable_rpc_server{false, Keys::enable_rpc_server};
Setting<bool> toggle_unique_data_console_type{false, Keys::toggle_unique_data_console_type};
// Miscellaneous
Setting<std::string> log_filter{"*:Info", Keys::log_filter};

View File

@ -2852,11 +2852,15 @@ void Module::Interface::GetDeviceID(Kernel::HLERequestContext& ctx) {
}
u32 deviceID = otp.GetDeviceID();
if (am->force_new_device_id) {
deviceID |= 0x80000000;
}
if (am->force_old_device_id) {
deviceID &= ~0x80000000;
if (am->force_new_device_id || am->force_old_device_id) {
if (am->force_new_device_id) {
deviceID |= 0x80000000;
}
if (am->force_old_device_id) {
deviceID &= ~0x80000000;
}
} else if (Settings::values.toggle_unique_data_console_type) {
deviceID ^= 0x80000000;
}
IPC::RequestBuilder rb = rp.MakeBuilder(3, 0);