Revert "Add Support for Wii Motion Plus INSIDE Wii Remotes on Mac OS X."
This reverts commit c9dfcf8cf7
.
That commit attempted to support all Wii Remotes on Mac OS X, but the
logic was incorrect, and as a result the original (non-TR) Wii Remotes
were broken by that change.
Future patches will address this problem in a better way.
This commit is contained in:
parent
9c9e593479
commit
af8690a7d8
|
@ -129,7 +129,7 @@ int FindWiimotes(Wiimote **wm, int max_wiimotes)
|
||||||
[bti setInquiryLength: 5];
|
[bti setInquiryLength: 5];
|
||||||
[bti setSearchCriteria: kBluetoothServiceClassMajorAny
|
[bti setSearchCriteria: kBluetoothServiceClassMajorAny
|
||||||
majorDeviceClass: kBluetoothDeviceClassMajorPeripheral
|
majorDeviceClass: kBluetoothDeviceClassMajorPeripheral
|
||||||
minorDeviceClass: kBluetoothDeviceClassMinorAny
|
minorDeviceClass: kBluetoothDeviceClassMinorPeripheral2Joystick
|
||||||
];
|
];
|
||||||
[bti setUpdateNewDeviceNames: NO];
|
[bti setUpdateNewDeviceNames: NO];
|
||||||
|
|
||||||
|
@ -177,10 +177,6 @@ bool Wiimote::Connect()
|
||||||
if (IsConnected())
|
if (IsConnected())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ([btd remoteNameRequest:nil] == kIOReturnSuccess)
|
|
||||||
m_motion_plus_inside =
|
|
||||||
static_cast<bool>([[btd getName] hasSuffix:@"-TR"]);
|
|
||||||
|
|
||||||
[btd openL2CAPChannelSync: &cchan
|
[btd openL2CAPChannelSync: &cchan
|
||||||
withPSM: kBluetoothL2CAPPSMHIDControl delegate: cbt];
|
withPSM: kBluetoothL2CAPPSMHIDControl delegate: cbt];
|
||||||
[btd openL2CAPChannelSync: &ichan
|
[btd openL2CAPChannelSync: &ichan
|
||||||
|
@ -248,7 +244,7 @@ int Wiimote::IOWrite(unsigned char *buf, int len)
|
||||||
if (!IsConnected())
|
if (!IsConnected())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = [ichan writeAsync: buf length: len refcon: nil];
|
ret = [cchan writeAsync: buf length: len refcon: nil];
|
||||||
|
|
||||||
if (ret == kIOReturnSuccess)
|
if (ret == kIOReturnSuccess)
|
||||||
return len;
|
return len;
|
||||||
|
|
|
@ -50,7 +50,6 @@ Wiimote::Wiimote(const unsigned int _index)
|
||||||
#endif
|
#endif
|
||||||
, leds(0), m_last_data_report(Report((u8 *)NULL, 0))
|
, leds(0), m_last_data_report(Report((u8 *)NULL, 0))
|
||||||
, m_channel(0), m_connected(false)
|
, m_channel(0), m_connected(false)
|
||||||
, m_motion_plus_inside(false)
|
|
||||||
{
|
{
|
||||||
#if defined(__linux__) && HAVE_BLUEZ
|
#if defined(__linux__) && HAVE_BLUEZ
|
||||||
bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}};
|
bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}};
|
||||||
|
@ -143,16 +142,15 @@ void Wiimote::InterruptChannel(const u16 channel, const void* const data, const
|
||||||
rpt.second = (u8)size;
|
rpt.second = (u8)size;
|
||||||
memcpy(rpt.first, (u8*)data, size);
|
memcpy(rpt.first, (u8*)data, size);
|
||||||
|
|
||||||
// Convert output DATA packets to SET_REPORT packets for non-TR
|
// Convert output DATA packets to SET_REPORT packets.
|
||||||
// Wiimotes. Nintendo Wiimotes work without this translation, but 3rd
|
// Nintendo Wiimotes work without this translation, but 3rd
|
||||||
// party ones don't.
|
// party ones don't.
|
||||||
u8 head = m_motion_plus_inside ? 0xa2 : 0x52;
|
|
||||||
if (rpt.first[0] == 0xa2)
|
if (rpt.first[0] == 0xa2)
|
||||||
{
|
{
|
||||||
rpt.first[0] = head;
|
rpt.first[0] = 0x52;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rpt.first[0] == head && rpt.first[1] == 0x18 && rpt.second == 23)
|
if (rpt.first[0] == 0x52 && rpt.first[1] == 0x18 && rpt.second == 23)
|
||||||
{
|
{
|
||||||
m_audio_reports.Push(rpt);
|
m_audio_reports.Push(rpt);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -95,7 +95,6 @@ private:
|
||||||
void ThreadFunc();
|
void ThreadFunc();
|
||||||
|
|
||||||
bool m_connected;
|
bool m_connected;
|
||||||
bool m_motion_plus_inside;
|
|
||||||
std::thread m_wiimote_thread;
|
std::thread m_wiimote_thread;
|
||||||
Common::FifoQueue<Report> m_read_reports;
|
Common::FifoQueue<Report> m_read_reports;
|
||||||
Common::FifoQueue<Report> m_write_reports;
|
Common::FifoQueue<Report> m_write_reports;
|
||||||
|
|
Loading…
Reference in New Issue