From 6c40c4747227338d597d3b5723b59d9b48ed29e7 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Thu, 22 Nov 2018 12:14:33 -0600 Subject: [PATCH] WiimoteEmu: Remove some remnants of hybrid wiimote. --- .../Core/HW/WiimoteEmu/EmuSubroutines.cpp | 40 ++----------------- Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp | 24 +---------- 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp index 06ccffb0d4..8f385f1916 100644 --- a/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/EmuSubroutines.cpp @@ -112,8 +112,7 @@ void Wiimote::HidOutputReport(const wm_report* const sr, const bool send_ack) break; case RT_REQUEST_STATUS: // 0x15 - if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index]) - RequestStatus(reinterpret_cast(sr->data)); + RequestStatus(reinterpret_cast(sr->data)); return; // sends its own ack break; @@ -122,13 +121,12 @@ void Wiimote::HidOutputReport(const wm_report* const sr, const bool send_ack) break; case RT_READ_DATA: // 0x17 - if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index]) - ReadData(reinterpret_cast(sr->data)); + ReadData(reinterpret_cast(sr->data)); return; // sends its own ack break; case RT_WRITE_SPEAKER_DATA: // 0x18 - if (WIIMOTE_SRC_EMU & g_wiimote_sources[m_index] && !m_speaker_mute) + if (!m_speaker_mute) Wiimote::SpeakerData(reinterpret_cast(sr->data)); return; // no ack break; @@ -154,9 +152,7 @@ void Wiimote::HidOutputReport(const wm_report* const sr, const bool send_ack) break; } - // send ack - if (send_ack && WIIMOTE_SRC_EMU & g_wiimote_sources[m_index]) - SendAck(sr->wm); + SendAck(sr->wm); } /* This will generate the 0x22 acknowledgement for most Input reports. @@ -215,22 +211,6 @@ void Wiimote::RequestStatus(const wm_request_status* const rs) // status values *reinterpret_cast(data + 2) = m_status; - // hybrid Wiimote stuff - if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index] && (m_extension->switch_extension <= 0)) - { - using namespace WiimoteReal; - - std::lock_guard lk(g_wiimotes_mutex); - - if (g_wiimotes[m_index]) - { - wm_request_status rpt = {}; - g_wiimotes[m_index]->QueueReport(RT_REQUEST_STATUS, &rpt, sizeof(rpt)); - } - - return; - } - // send report Core::Callback_WiimoteInterruptChannel(m_index, m_reporting_channel, data, sizeof(data)); } @@ -359,18 +339,6 @@ void Wiimote::ReadData(const wm_read_data* const rd) // ignore the 0x010000 bit address &= 0xFEFFFF; - // hybrid Wiimote stuff - // relay the read data request to real-Wiimote - if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index] && - ((0xA4 != (address >> 16)) || (m_extension->switch_extension <= 0))) - { - WiimoteReal::InterruptChannel(m_index, m_reporting_channel, ((u8*)rd) - 2, - sizeof(wm_read_data) + 2); // hacky - - // don't want emu-Wiimote to send reply - return; - } - ReadRequest rr; u8* const block = new u8[size]; diff --git a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp index e6c5fdcc2f..de8106797b 100644 --- a/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp +++ b/Source/Core/Core/HW/WiimoteEmu/WiimoteEmu.cpp @@ -923,8 +923,6 @@ void Wiimote::ControlChannel(const u16 channel_id, const void* data, u32 size) // Wii Remote disconnected // reset eeprom/register/reporting mode Reset(); - if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index]) - WiimoteReal::ControlChannel(m_index, channel_id, data, size); return; } @@ -983,27 +981,7 @@ void Wiimote::InterruptChannel(const u16 channel_id, const void* data, u32 size) case HID_PARAM_OUTPUT: { const wm_report* sr = reinterpret_cast(hidp->data); - - if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index]) - { - switch (sr->wm) - { - // these two types are handled in RequestStatus() & ReadData() - case RT_REQUEST_STATUS: - case RT_READ_DATA: - if (WIIMOTE_SRC_REAL == g_wiimote_sources[m_index]) - WiimoteReal::InterruptChannel(m_index, channel_id, data, size); - break; - - default: - WiimoteReal::InterruptChannel(m_index, channel_id, data, size); - break; - } - - HidOutputReport(sr, m_extension->switch_extension > 0); - } - else - HidOutputReport(sr); + HidOutputReport(sr); } break;