diff --git a/Source/Core/Core/BootManager.cpp b/Source/Core/Core/BootManager.cpp index 200074c589..eeeccee467 100644 --- a/Source/Core/Core/BootManager.cpp +++ b/Source/Core/Core/BootManager.cpp @@ -290,7 +290,7 @@ bool BootCore(std::unique_ptr boot) { controls_section->Get(StringFromFormat("WiimoteSource%u", i), &source, -1); if (source != -1 && g_wiimote_sources[i] != (unsigned)source && - source >= WIIMOTE_SRC_NONE && source <= WIIMOTE_SRC_HYBRID) + source >= WIIMOTE_SRC_NONE && source <= WIIMOTE_SRC_REAL) { config_cache.bSetWiimoteSource[i] = true; g_wiimote_sources[i] = source; diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index 178ee75540..0a06b084a8 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -135,17 +135,21 @@ void Pause() // An L2CAP packet is passed from the Core to the Wiimote on the HID CONTROL channel. void ControlChannel(int number, u16 channel_id, const void* data, u32 size) { - if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number]) + if (g_wiimote_sources[number]) + { static_cast(s_config.GetController(number)) ->ControlChannel(channel_id, data, size); + } } // An L2CAP packet is passed from the Core to the Wiimote on the HID INTERRUPT channel. void InterruptChannel(int number, u16 channel_id, const void* data, u32 size) { - if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number]) + if (g_wiimote_sources[number]) + { static_cast(s_config.GetController(number)) ->InterruptChannel(channel_id, data, size); + } } bool ButtonPressed(int number) diff --git a/Source/Core/Core/HW/Wiimote.h b/Source/Core/Core/HW/Wiimote.h index 1c637f4998..1e3e9c9c2a 100644 --- a/Source/Core/Core/HW/Wiimote.h +++ b/Source/Core/Core/HW/Wiimote.h @@ -43,7 +43,6 @@ enum WIIMOTE_SRC_NONE = 0, WIIMOTE_SRC_EMU = 1, WIIMOTE_SRC_REAL = 2, - WIIMOTE_SRC_HYBRID = 3, // emu + real }; extern unsigned int g_wiimote_sources[MAX_BBMOTES]; diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index c4130ee15b..f2346480bd 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -722,84 +722,6 @@ void Wiimote::Update() if (rptf.ext) GetExtData(data + rptf.ext); - // hybrid Wii Remote stuff (for now, it's not supported while recording) - if (WIIMOTE_SRC_HYBRID == g_wiimote_sources[m_index] && !Movie::IsRecordingInput()) - { - using namespace WiimoteReal; - - std::lock_guard lk(g_wiimotes_mutex); - if (g_wiimotes[m_index]) - { - Report& rpt = g_wiimotes[m_index]->ProcessReadQueue(); - if (!rpt.empty()) - { - u8* real_data = rpt.data(); - switch (real_data[1]) - { - // use data reports - default: - if (real_data[1] >= RT_REPORT_CORE) - { - const ReportFeatures& real_rptf = - reporting_mode_features[real_data[1] - RT_REPORT_CORE]; - - // force same report type from real-Wiimote - if (&real_rptf != &rptf) - rptf_size = 0; - - // core - // mix real-buttons with emu-buttons in the status struct, and in the report - if (real_rptf.core && rptf.core) - { - m_status.buttons.hex |= - reinterpret_cast(real_data + real_rptf.core)->hex; - *reinterpret_cast(data + rptf.core) = m_status.buttons; - } - - // accel - // use real-accel data always i guess - if (real_rptf.accel && rptf.accel) - memcpy(data + rptf.accel, real_data + real_rptf.accel, sizeof(wm_accel)); - - // ir - // TODO - - // ext - // use real-ext data if an emu-extention isn't chosen - if (real_rptf.ext && rptf.ext && (0 == m_extension->switch_extension)) - memcpy(data + rptf.ext, real_data + real_rptf.ext, - sizeof(wm_nc)); // TODO: Why NC specific? - } - else if (real_data[1] != RT_ACK_DATA || m_extension->active_extension > 0) - rptf_size = 0; - else - // use real-acks if an emu-extension isn't chosen - rptf_size = -1; - break; - - // use all status reports, after modification of the extension bit - case RT_STATUS_REPORT: - if (m_extension->active_extension) - reinterpret_cast(real_data + 2)->extension = 1; - rptf_size = -1; - break; - - // use all read-data replies - case RT_READ_DATA_REPLY: - rptf_size = -1; - break; - } - - // copy over report from real-Wiimote - if (-1 == rptf_size) - { - std::copy(rpt.begin(), rpt.end(), data); - rptf_size = (s8)(rpt.size()); - } - } - } - } - Movie::CallWiiInputManip(data, rptf, m_index, m_extension->active_extension, m_ext_key); } if (NetPlay::IsNetPlayRunning()) diff --git a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp index cb62e6e50d..ad94caa1a2 100644 --- a/Source/Core/DolphinQt2/Config/ControllersWindow.cpp +++ b/Source/Core/DolphinQt2/Config/ControllersWindow.cpp @@ -42,9 +42,6 @@ static const std::map s_gc_types = { {SerialInterface::SIDEVICE_DANCEMAT, 4}, {SerialInterface::SIDEVICE_GC_TARUKONGA, 5}, {SerialInterface::SIDEVICE_GC_GBA, 6}, {SerialInterface::SIDEVICE_GC_KEYBOARD, 7}}; -static const std::map s_wiimote_types = { - {WIIMOTE_SRC_NONE, 0}, {WIIMOTE_SRC_EMU, 1}, {WIIMOTE_SRC_REAL, 2}, {WIIMOTE_SRC_HYBRID, 3}}; - static int ToGCMenuIndex(const SerialInterface::SIDevices sidevice) { return s_gc_types.at(sidevice); @@ -57,18 +54,6 @@ static SerialInterface::SIDevices FromGCMenuIndex(const int menudevice) return it->first; } -static int ToWiimoteMenuIndex(const int device) -{ - return s_wiimote_types.at(device); -} - -static int FromWiimoteMenuIndex(const int menudevice) -{ - auto it = std::find_if(s_wiimote_types.begin(), s_wiimote_types.end(), - [=](auto pair) { return pair.second == menudevice; }); - return it->first; -} - ControllersWindow::ControllersWindow(QWidget* parent) : QDialog(parent) { setWindowTitle(tr("Controller Settings")); @@ -189,11 +174,8 @@ void ControllersWindow::CreateWiimoteLayout() auto* wm_box = m_wiimote_boxes[i] = new QComboBox(); auto* wm_button = m_wiimote_buttons[i] = new QPushButton(tr("Configure")); - for (const auto& item : - {tr("None"), tr("Emulated Wii Remote"), tr("Real Wii Remote"), tr("Hybrid Wii Remote")}) - { + for (const auto& item : {tr("None"), tr("Emulated Wii Remote"), tr("Real Wii Remote")}) wm_box->addItem(item); - } int wm_row = m_wiimote_layout->rowCount(); m_wiimote_layout->addWidget(wm_label, wm_row, 1); @@ -458,9 +440,6 @@ void ControllersWindow::OnWiimoteConfigure() case 1: // Emulated Wii Remote type = MappingWindow::Type::MAPPING_WIIMOTE_EMU; break; - case 3: // Hybrid Wii Remote - type = MappingWindow::Type::MAPPING_WIIMOTE_HYBRID; - break; default: return; } @@ -482,7 +461,7 @@ void ControllersWindow::LoadSettings() for (size_t i = 0; i < m_wiimote_groups.size(); i++) { m_gc_controller_boxes[i]->setCurrentIndex(ToGCMenuIndex(SConfig::GetInstance().m_SIDevice[i])); - m_wiimote_boxes[i]->setCurrentIndex(ToWiimoteMenuIndex(g_wiimote_sources[i])); + m_wiimote_boxes[i]->setCurrentIndex(g_wiimote_sources[i]); } m_wiimote_real_balance_board->setChecked(g_wiimote_sources[WIIMOTE_BALANCE_BOARD] == WIIMOTE_SRC_REAL); @@ -513,7 +492,7 @@ void ControllersWindow::SaveSettings() for (size_t i = 0; i < m_wiimote_groups.size(); i++) { const int index = m_wiimote_boxes[i]->currentIndex(); - g_wiimote_sources[i] = FromWiimoteMenuIndex(index); + g_wiimote_sources[i] = index; m_wiimote_buttons[i]->setEnabled(index != 0 && index != 2); } diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp index 34f10b64e3..e375cb96a6 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp @@ -271,7 +271,6 @@ void MappingWindow::SetMappingType(MappingWindow::Type type) AddWidget(tr("Microphone"), widget); break; case Type::MAPPING_WIIMOTE_EMU: - case Type::MAPPING_WIIMOTE_HYBRID: { auto* extension = new WiimoteEmuExtension(this); widget = new WiimoteEmuGeneral(this, extension); diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.h b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.h index b3849de1ca..242087c014 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.h +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.h @@ -42,7 +42,6 @@ public: MAPPING_GC_MICROPHONE, // Wii MAPPING_WIIMOTE_EMU, - MAPPING_WIIMOTE_HYBRID, // Hotkeys MAPPING_HOTKEYS }; diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp index dbc91c0b8d..2e223725c1 100644 --- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp +++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp @@ -94,8 +94,7 @@ void ControllerConfigDiag::UpdateUI() SConfig::GetInstance().bWii || Core::GetState() == Core::State::Uninitialized; if (Core::WantsDeterminism() || !wii_game_started) m_wiimote_sources[i]->Disable(); - if (!wii_game_started || - (g_wiimote_sources[i] != WIIMOTE_SRC_EMU && g_wiimote_sources[i] != WIIMOTE_SRC_HYBRID)) + if (!wii_game_started || g_wiimote_sources[i] != WIIMOTE_SRC_EMU) m_wiimote_configure_button[i]->Disable(); } @@ -309,8 +308,8 @@ wxSizer* ControllerConfigDiag::CreatePassthroughBTConfigSizer() wxSizer* ControllerConfigDiag::CreateEmulatedBTConfigSizer() { - const std::array src_choices{ - {_("None"), _("Emulated Wii Remote"), _("Real Wii Remote"), _("Hybrid Wii Remote")}}; + const std::array src_choices{ + {_("None"), _("Emulated Wii Remote"), _("Real Wii Remote")}}; const int space5 = FromDIP(5); @@ -507,11 +506,7 @@ void ControllerConfigDiag::OnWiimoteSourceChanged(wxCommandEvent& event) if (index != WIIMOTE_BALANCE_BOARD) { WiimoteReal::ChangeWiimoteSource(index, event.GetInt()); - if (g_wiimote_sources[index] != WIIMOTE_SRC_EMU && - g_wiimote_sources[index] != WIIMOTE_SRC_HYBRID) - m_wiimote_configure_button[index]->Disable(); - else - m_wiimote_configure_button[index]->Enable(); + m_wiimote_configure_button[index]->Enable(g_wiimote_sources[index] == WIIMOTE_SRC_EMU); } else {