mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Fixed the emulated Wiimote in Rayman Rabbids 1, Sonic Rings and Wii Sports
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1283 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -221,6 +221,9 @@ s32 CWII_IPC_HLE_Device_fs::ExecuteCommand(u32 _Parameter, u32 _BufferIn, u32 _B
|
||||
{
|
||||
switch(_Parameter)
|
||||
{
|
||||
case GET_STATS:
|
||||
PanicAlert("FS: GET_STATS not supported");
|
||||
break;
|
||||
case CREATE_DIR:
|
||||
{
|
||||
_dbg_assert_(WII_IPC_FILEIO, _BufferOutSize == 0);
|
||||
|
@ -43,6 +43,7 @@ private:
|
||||
|
||||
enum
|
||||
{
|
||||
GET_STATS = 0x02,
|
||||
CREATE_DIR = 0x03,
|
||||
IOCTL_READ_DIR = 0x04,
|
||||
GET_ATTR = 0x06,
|
||||
|
@ -235,17 +235,33 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendToDevice(u16 _ConnectionHandle, u8
|
||||
pWiiMote->SendACLFrame(_pData, _Size);
|
||||
}
|
||||
|
||||
|
||||
// ===================================================
|
||||
/* Here we queue the ACL frames. They will consist of header + data. The header is
|
||||
for example 07 00 41 00 which means size 0x0007 and channel 0x0041. */
|
||||
// ----------------
|
||||
void CWII_IPC_HLE_Device_usb_oh1_57e_305::SendACLFrame(u16 _ConnectionHandle, u8* _pData, u32 _Size)
|
||||
{
|
||||
LOGV(WII_IPC_WIIMOTE, 1, "Queing ACL frame.");
|
||||
|
||||
//queue the packet
|
||||
// Queue the packet
|
||||
ACLFrame frame;
|
||||
frame.ConnectionHandle = _ConnectionHandle;
|
||||
frame.data = new u8[_Size];
|
||||
memcpy(frame.data, _pData, _Size);
|
||||
frame.size = _Size;
|
||||
m_AclFrameQue.push(frame);
|
||||
|
||||
/* Debugging
|
||||
std::string Temp;
|
||||
for (u32 j = 0; j < _Size; j++)
|
||||
{
|
||||
char Buffer[128];
|
||||
sprintf(Buffer, "%02x ", frame.data[j]);
|
||||
Temp.append(Buffer);
|
||||
}
|
||||
LOGV(WII_IPC_WIIMOTE, 1, " Size: 0x%08x", _Size);
|
||||
LOGV(WII_IPC_WIIMOTE, 1, " Data: %s", Temp.c_str()); */
|
||||
|
||||
g_HCICount++;
|
||||
}
|
||||
@ -290,7 +306,9 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
||||
pHeader->PBFlag = 2;
|
||||
pHeader->Size = frame.size;
|
||||
|
||||
memcpy(Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address + sizeof(UACLHeader)), frame.data , frame.size);
|
||||
// Write the fram to the PayloadBuffer
|
||||
memcpy(Memory::GetPointer(m_pACLBuffer->PayloadBuffer[0].m_Address + sizeof(UACLHeader)),
|
||||
frame.data, frame.size);
|
||||
|
||||
// return reply buffer size
|
||||
Memory::Write_U32(sizeof(UACLHeader) + frame.size, m_pACLBuffer->m_Address + 0x4);
|
||||
@ -302,6 +320,19 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update()
|
||||
delete m_pACLBuffer;
|
||||
m_pACLBuffer = NULL;
|
||||
|
||||
|
||||
/* Debugging
|
||||
std::string Temp;
|
||||
for (u32 j = 0; j < frame.size; j++)
|
||||
{
|
||||
char Buffer[128];
|
||||
sprintf(Buffer, "%02x ", frame.data[j]);
|
||||
Temp.append(Buffer);
|
||||
}
|
||||
LOGV(WII_IPC_WIIMOTE, 1, " Size: 0x%08x", frame.size);
|
||||
LOGV(WII_IPC_WIIMOTE, 1, " Size of UACLHeader: 0x%08x", sizeof(UACLHeader));
|
||||
LOGV(WII_IPC_WIIMOTE, 1, " Data: %s", Temp.c_str()); */
|
||||
|
||||
return Addr;
|
||||
}
|
||||
|
||||
@ -894,8 +925,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom
|
||||
|
||||
u16 ocf = HCI_OCF(pMsg->Opcode);
|
||||
u16 ogf = HCI_OGF(pMsg->Opcode);
|
||||
LOG(WII_IPC_WIIMOTE, "****************************** ExecuteHCICommandMessage(0x%04x)"
|
||||
"(ocf: 0x%02x, ogf: 0x%02x)", pMsg->Opcode, ocf, ogf);
|
||||
LOG(WII_IPC_WIIMOTE, "******************************");
|
||||
LOG(WII_IPC_WIIMOTE, "ExecuteHCICommandMessage(0x%04x)(ocf: 0x%02x, ogf: 0x%02x)",
|
||||
pMsg->Opcode, ocf, ogf);
|
||||
|
||||
switch(pMsg->Opcode)
|
||||
{
|
||||
|
@ -311,6 +311,11 @@ void CWII_IPC_HLE_WiiMote::EventCommandWriteLinkPolicy()
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// ===================================================
|
||||
/* This function send ACL frams from the Wii to Wiimote_ControlChannel() in the Wiimote.
|
||||
It's called from SendToDevice() in WII_IPC_HLE_Device_usb.cpp. */
|
||||
// ----------------
|
||||
void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
|
||||
{
|
||||
// Debugger::PrintDataBuffer(LogTypes::WIIMOTE, _pData, _Size, "SendACLFrame: ");
|
||||
@ -325,7 +330,7 @@ void CWII_IPC_HLE_WiiMote::SendACLFrame(u8* _pData, u32 _Size)
|
||||
|
||||
if(pHeader->Length != DataSize)
|
||||
{
|
||||
LOG(WII_IPC_WIIMOTE, "Faulty packet. It is dropped.");
|
||||
LOGV(WII_IPC_WIIMOTE, 2, "Faulty packet. It is dropped.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -459,7 +464,7 @@ void CWII_IPC_HLE_WiiMote::CommandConnectionReq(u8 _Ident, u8* _pData, u32 _Size
|
||||
|
||||
void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Size)
|
||||
{
|
||||
LOGV(WII_IPC_WIIMOTE, 1, "=======================================================");
|
||||
LOGV(WII_IPC_WIIMOTE, 1, "*******************************************************");
|
||||
u32 Offset = 0;
|
||||
SL2CAP_CommandConfigurationReq* pCommandConfigReq = (SL2CAP_CommandConfigurationReq*)_pData;
|
||||
|
||||
@ -524,7 +529,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
|
||||
}
|
||||
|
||||
SendCommandToACL(_Ident, L2CAP_CONF_RSP, RespLen, TempBuffer);
|
||||
LOGV(WII_IPC_WIIMOTE, 1, "=======================================================");
|
||||
LOGV(WII_IPC_WIIMOTE, 1, "*******************************************************");
|
||||
}
|
||||
|
||||
void CWII_IPC_HLE_WiiMote::CommandConnectionResponse(u8 _Ident, u8* _pData, u32 _Size)
|
||||
|
Reference in New Issue
Block a user