mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Clean up Wiiuse to allow less _WIN32 defines. Windows side now spits out regular packets, and takes in regular packets. Like a normal OS should :} This shouldn't break Windows wiimote, Linux Wiimote doesn't work with this revision. Will require the new plugin which doesn't have emulated Wiimote at all.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4591 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1854,7 +1854,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandDeleteStoredLinkKey(u8* _Input)
|
||||
|
||||
SendEventCommandComplete(HCI_CMD_DELETE_STORED_LINK_KEY, &Reply, sizeof(hci_delete_stored_link_key_rp));
|
||||
|
||||
ERROR_LOG(WII_IPC_WIIMOTE, "HCI: CommandDeleteStoredLinkKey... Probablu the security for linking has failed. Could be a problem with loading the SCONF");
|
||||
ERROR_LOG(WII_IPC_WIIMOTE, "HCI: CommandDeleteStoredLinkKey... Probably the security for linking has failed. Could be a problem with loading the SCONF");
|
||||
PanicAlert("HCI: CommandDeleteStoredLinkKey... Probably the security for linking has failed. Could be a problem with loading the SCONF");
|
||||
}
|
||||
|
||||
|
@ -690,7 +690,7 @@ void CWII_IPC_HLE_WiiMote::SendConfigurationRequest(u16 scid, u16* MTU, u16* Flu
|
||||
|
||||
void CWII_IPC_HLE_WiiMote::SDPSendServiceSearchResponse(u16 cid, u16 TransactionID, u8* pServiceSearchPattern, u16 MaximumServiceRecordCount)
|
||||
{
|
||||
// verify block... we hanlde search pattern for HID service only
|
||||
// verify block... we handle search pattern for HID service only
|
||||
{
|
||||
CBigEndianBuffer buffer(pServiceSearchPattern);
|
||||
_dbg_assert_(WII_IPC_WIIMOTE, buffer.Read8(0) == SDP_SEQ8); // data sequence
|
||||
|
@ -100,7 +100,8 @@ void SendData(u16 _channelID, const u8* _pData, u32 _Size)
|
||||
m_pCriticalSection->Enter();
|
||||
{
|
||||
SEvent WriteEvent;
|
||||
memcpy(WriteEvent.m_PayLoad, _pData + 1, _Size - 1);
|
||||
memcpy(WriteEvent.m_PayLoad, _pData, _Size);
|
||||
WriteEvent._Size = _Size - 1;
|
||||
m_EventWriteQueue.push(WriteEvent);
|
||||
|
||||
// Debugging
|
||||
@ -121,15 +122,10 @@ void ReadData()
|
||||
{
|
||||
//DEBUG_LOG(WIIMOTE, "Writing data to the Wiimote");
|
||||
SEvent& rEvent = m_EventWriteQueue.front();
|
||||
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, MAX_PAYLOAD);
|
||||
wiiuse_io_write(m_pWiiMote, (byte*)rEvent.m_PayLoad, rEvent._Size);
|
||||
m_EventWriteQueue.pop();
|
||||
|
||||
#ifdef _WIN32
|
||||
// Debugging. Move the data one step to the right first.
|
||||
memcpy(rEvent.m_PayLoad + 1, rEvent.m_PayLoad, sizeof(rEvent.m_PayLoad) - 1);
|
||||
rEvent.m_PayLoad[0] = 0xa2;
|
||||
InterruptDebugging(false, rEvent.m_PayLoad);
|
||||
#endif
|
||||
}
|
||||
|
||||
m_pCriticalSection->Leave();
|
||||
@ -145,17 +141,17 @@ void ReadData()
|
||||
m_pCriticalSection->Enter();
|
||||
|
||||
// Filter out data reports
|
||||
if (pBuffer[0] >= 0x30)
|
||||
if (pBuffer[1] >= 0x30)
|
||||
{
|
||||
// Copy Buffer to LastReport
|
||||
memcpy(m_LastReport.m_PayLoad, pBuffer, MAX_PAYLOAD);
|
||||
memcpy(m_LastReport.m_PayLoad, pBuffer + 1, MAX_PAYLOAD);
|
||||
m_LastReportValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Copy Buffer to ImportantEvent
|
||||
SEvent ImportantEvent;
|
||||
memcpy(ImportantEvent.m_PayLoad, pBuffer, MAX_PAYLOAD);
|
||||
memcpy(ImportantEvent.m_PayLoad, pBuffer + 1, MAX_PAYLOAD);
|
||||
|
||||
// Put it in the read queue right away
|
||||
m_EventReadQueue.push(ImportantEvent);
|
||||
@ -206,6 +202,7 @@ private:
|
||||
memset(m_PayLoad, 0, MAX_PAYLOAD);
|
||||
}
|
||||
byte m_PayLoad[MAX_PAYLOAD];
|
||||
u32 _Size;
|
||||
};
|
||||
typedef std::queue<SEvent> CEventQueue;
|
||||
|
||||
@ -213,10 +210,10 @@ private:
|
||||
u16 m_channelID;
|
||||
CEventQueue m_EventReadQueue; // Read from Wiimote
|
||||
CEventQueue m_EventWriteQueue; // Write to Wiimote
|
||||
bool m_LastReportValid;
|
||||
SEvent m_LastReport;
|
||||
wiimote_t* m_pWiiMote; // This is g_WiiMotesFromWiiUse[]
|
||||
Common::CriticalSection* m_pCriticalSection;
|
||||
bool m_LastReportValid;
|
||||
|
||||
// Send queued data to the core
|
||||
void SendEvent(SEvent& _rEvent)
|
||||
|
Reference in New Issue
Block a user