summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.h1
-rw-r--r--src/common/settings_input.h5
-rw-r--r--src/core/hid/emulated_controller.cpp20
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp4
-rw-r--r--src/yuzu/configuration/config.cpp2
-rw-r--r--src/yuzu/configuration/configure_debug.cpp2
-rw-r--r--src/yuzu/configuration/configure_debug.ui7
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp34
8 files changed, 75 insertions, 0 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index e4e049f67..313f1fa7f 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -604,6 +604,7 @@ struct Values {
604 BasicSetting<bool> extended_logging{false, "extended_logging"}; 604 BasicSetting<bool> extended_logging{false, "extended_logging"};
605 BasicSetting<bool> use_debug_asserts{false, "use_debug_asserts"}; 605 BasicSetting<bool> use_debug_asserts{false, "use_debug_asserts"};
606 BasicSetting<bool> use_auto_stub{false, "use_auto_stub"}; 606 BasicSetting<bool> use_auto_stub{false, "use_auto_stub"};
607 BasicSetting<bool> enable_all_controllers{false, "enable_all_controllers"};
607 608
608 // Miscellaneous 609 // Miscellaneous
609 BasicSetting<std::string> log_filter{"*:Info", "log_filter"}; 610 BasicSetting<std::string> log_filter{"*:Info", "log_filter"};
diff --git a/src/common/settings_input.h b/src/common/settings_input.h
index 9e3df7376..4ff37e186 100644
--- a/src/common/settings_input.h
+++ b/src/common/settings_input.h
@@ -370,6 +370,11 @@ enum class ControllerType {
370 RightJoycon, 370 RightJoycon,
371 Handheld, 371 Handheld,
372 GameCube, 372 GameCube,
373 Pokeball,
374 NES,
375 SNES,
376 N64,
377 SegaGenesis,
373}; 378};
374 379
375struct PlayerInput { 380struct PlayerInput {
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 06ae41c3e..466ff5542 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -27,6 +27,16 @@ NpadStyleIndex EmulatedController::MapSettingsTypeToNPad(Settings::ControllerTyp
27 return NpadStyleIndex::Handheld; 27 return NpadStyleIndex::Handheld;
28 case Settings::ControllerType::GameCube: 28 case Settings::ControllerType::GameCube:
29 return NpadStyleIndex::GameCube; 29 return NpadStyleIndex::GameCube;
30 case Settings::ControllerType::Pokeball:
31 return NpadStyleIndex::Pokeball;
32 case Settings::ControllerType::NES:
33 return NpadStyleIndex::NES;
34 case Settings::ControllerType::SNES:
35 return NpadStyleIndex::SNES;
36 case Settings::ControllerType::N64:
37 return NpadStyleIndex::N64;
38 case Settings::ControllerType::SegaGenesis:
39 return NpadStyleIndex::SegaGenesis;
30 default: 40 default:
31 return NpadStyleIndex::ProController; 41 return NpadStyleIndex::ProController;
32 } 42 }
@@ -46,6 +56,16 @@ Settings::ControllerType EmulatedController::MapNPadToSettingsType(NpadStyleInde
46 return Settings::ControllerType::Handheld; 56 return Settings::ControllerType::Handheld;
47 case NpadStyleIndex::GameCube: 57 case NpadStyleIndex::GameCube:
48 return Settings::ControllerType::GameCube; 58 return Settings::ControllerType::GameCube;
59 case NpadStyleIndex::Pokeball:
60 return Settings::ControllerType::Pokeball;
61 case NpadStyleIndex::NES:
62 return Settings::ControllerType::NES;
63 case NpadStyleIndex::SNES:
64 return Settings::ControllerType::SNES;
65 case NpadStyleIndex::N64:
66 return Settings::ControllerType::N64;
67 case NpadStyleIndex::SegaGenesis:
68 return Settings::ControllerType::SegaGenesis;
49 default: 69 default:
50 return Settings::ControllerType::ProController; 70 return Settings::ControllerType::ProController;
51 } 71 }
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index dd4d954aa..04b3a68c3 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -263,6 +263,10 @@ void Controller_NPad::OnInit() {
263 style.fullkey.Assign(1); 263 style.fullkey.Assign(1);
264 style.gamecube.Assign(1); 264 style.gamecube.Assign(1);
265 style.palma.Assign(1); 265 style.palma.Assign(1);
266 style.lark.Assign(1);
267 style.lucia.Assign(1);
268 style.lagoon.Assign(1);
269 style.lager.Assign(1);
266 hid_core.SetSupportedStyleTag(style); 270 hid_core.SetSupportedStyleTag(style);
267 } 271 }
268 272
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 2c70d0548..463d500c2 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -508,6 +508,7 @@ void Config::ReadDebuggingValues() {
508 ReadBasicSetting(Settings::values.extended_logging); 508 ReadBasicSetting(Settings::values.extended_logging);
509 ReadBasicSetting(Settings::values.use_debug_asserts); 509 ReadBasicSetting(Settings::values.use_debug_asserts);
510 ReadBasicSetting(Settings::values.use_auto_stub); 510 ReadBasicSetting(Settings::values.use_auto_stub);
511 ReadBasicSetting(Settings::values.enable_all_controllers);
511 512
512 qt_config->endGroup(); 513 qt_config->endGroup();
513} 514}
@@ -1051,6 +1052,7 @@ void Config::SaveDebuggingValues() {
1051 WriteBasicSetting(Settings::values.quest_flag); 1052 WriteBasicSetting(Settings::values.quest_flag);
1052 WriteBasicSetting(Settings::values.use_debug_asserts); 1053 WriteBasicSetting(Settings::values.use_debug_asserts);
1053 WriteBasicSetting(Settings::values.disable_macro_jit); 1054 WriteBasicSetting(Settings::values.disable_macro_jit);
1055 WriteBasicSetting(Settings::values.enable_all_controllers);
1054 1056
1055 qt_config->endGroup(); 1057 qt_config->endGroup();
1056} 1058}
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp
index 07bfa0360..633fc295b 100644
--- a/src/yuzu/configuration/configure_debug.cpp
+++ b/src/yuzu/configuration/configure_debug.cpp
@@ -42,6 +42,7 @@ void ConfigureDebug::SetConfiguration() {
42 ui->quest_flag->setChecked(Settings::values.quest_flag.GetValue()); 42 ui->quest_flag->setChecked(Settings::values.quest_flag.GetValue());
43 ui->use_debug_asserts->setChecked(Settings::values.use_debug_asserts.GetValue()); 43 ui->use_debug_asserts->setChecked(Settings::values.use_debug_asserts.GetValue());
44 ui->use_auto_stub->setChecked(Settings::values.use_auto_stub.GetValue()); 44 ui->use_auto_stub->setChecked(Settings::values.use_auto_stub.GetValue());
45 ui->enable_all_controllers->setChecked(Settings::values.enable_all_controllers.GetValue());
45 ui->enable_graphics_debugging->setEnabled(runtime_lock); 46 ui->enable_graphics_debugging->setEnabled(runtime_lock);
46 ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug.GetValue()); 47 ui->enable_graphics_debugging->setChecked(Settings::values.renderer_debug.GetValue());
47 ui->enable_shader_feedback->setEnabled(runtime_lock); 48 ui->enable_shader_feedback->setEnabled(runtime_lock);
@@ -67,6 +68,7 @@ void ConfigureDebug::ApplyConfiguration() {
67 Settings::values.quest_flag = ui->quest_flag->isChecked(); 68 Settings::values.quest_flag = ui->quest_flag->isChecked();
68 Settings::values.use_debug_asserts = ui->use_debug_asserts->isChecked(); 69 Settings::values.use_debug_asserts = ui->use_debug_asserts->isChecked();
69 Settings::values.use_auto_stub = ui->use_auto_stub->isChecked(); 70 Settings::values.use_auto_stub = ui->use_auto_stub->isChecked();
71 Settings::values.enable_all_controllers = ui->enable_all_controllers->isChecked();
70 Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked(); 72 Settings::values.renderer_debug = ui->enable_graphics_debugging->isChecked();
71 Settings::values.renderer_shader_feedback = ui->enable_shader_feedback->isChecked(); 73 Settings::values.renderer_shader_feedback = ui->enable_shader_feedback->isChecked();
72 Settings::values.cpu_debug_mode = ui->enable_cpu_debugging->isChecked(); 74 Settings::values.cpu_debug_mode = ui->enable_cpu_debugging->isChecked();
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui
index b884a56b0..0f3b51c8d 100644
--- a/src/yuzu/configuration/configure_debug.ui
+++ b/src/yuzu/configuration/configure_debug.ui
@@ -198,6 +198,13 @@
198 </property> 198 </property>
199 </widget> 199 </widget>
200 </item> 200 </item>
201 <item row="1" column="1">
202 <widget class="QCheckBox" name="enable_all_controllers">
203 <property name="text">
204 <string>Enable all Controller Types</string>
205 </property>
206 </widget>
207 </item>
201 </layout> 208 </layout>
202 </widget> 209 </widget>
203 </item> 210 </item>
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index ec071d6ec..16284d5a6 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -947,6 +947,40 @@ void ConfigureInputPlayer::SetConnectableControllers() {
947 Core::HID::NpadStyleIndex::GameCube); 947 Core::HID::NpadStyleIndex::GameCube);
948 ui->comboControllerType->addItem(tr("GameCube Controller")); 948 ui->comboControllerType->addItem(tr("GameCube Controller"));
949 } 949 }
950
951 // Disable all unsupported controllers
952 if (!Settings::values.enable_all_controllers) {
953 return;
954 }
955 if (enable_all || npad_style_set.palma == 1) {
956 index_controller_type_pairs.emplace_back(ui->comboControllerType->count(),
957 Core::HID::NpadStyleIndex::Pokeball);
958 ui->comboControllerType->addItem(tr("Poke Ball Plus"));
959 }
960
961 if (enable_all || npad_style_set.lark == 1) {
962 index_controller_type_pairs.emplace_back(ui->comboControllerType->count(),
963 Core::HID::NpadStyleIndex::NES);
964 ui->comboControllerType->addItem(tr("NES Controller"));
965 }
966
967 if (enable_all || npad_style_set.lucia == 1) {
968 index_controller_type_pairs.emplace_back(ui->comboControllerType->count(),
969 Core::HID::NpadStyleIndex::SNES);
970 ui->comboControllerType->addItem(tr("SNES Controller"));
971 }
972
973 if (enable_all || npad_style_set.lagoon == 1) {
974 index_controller_type_pairs.emplace_back(ui->comboControllerType->count(),
975 Core::HID::NpadStyleIndex::N64);
976 ui->comboControllerType->addItem(tr("N64 Controller"));
977 }
978
979 if (enable_all || npad_style_set.lager == 1) {
980 index_controller_type_pairs.emplace_back(ui->comboControllerType->count(),
981 Core::HID::NpadStyleIndex::SegaGenesis);
982 ui->comboControllerType->addItem(tr("Sega Genesis"));
983 }
950 }; 984 };
951 985
952 if (!is_powered_on) { 986 if (!is_powered_on) {