wiimote emulation improvements... wpad tries now to read out the HID attribs per SDP

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@902 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
fires.gc
2008-10-17 18:01:13 +00:00
parent 469310dc14
commit 636dfdd177
11 changed files with 1066 additions and 543 deletions

View File

@ -190,13 +190,45 @@ extern "C" void Wiimote_Output(const void* _pData, u32 _Size) {
hid_packet* hidp = (hid_packet*) data;
if(hidp->type == HID_TYPE_SET_REPORT &&
hidp->param == HID_PARAM_OUTPUT)
if ((hidp->param != HID_PARAM_INPUT) && (hidp->param != HID_PARAM_OUTPUT))
{
HidOutputReport((wm_report*)hidp->data);
} else {
PanicAlert("HidOutput: Unknown type 0x%02x", data[0]);
PanicAlert("hidp->param has a wrong parameter!!!");
}
switch(hidp->type)
{
case HID_TYPE_HANDSHAKE:
if (hidp->param == HID_PARAM_INPUT)
{
PanicAlert("HID_TYPE_HANDSHAKE - HID_PARAM_INPUT");
}
else
{
PanicAlert("HID_TYPE_HANDSHAKE - HID_PARAM_OUTPUT");
}
g_ReportingMode = 0x33;
break;
case HID_TYPE_SET_REPORT:
if (hidp->param == HID_PARAM_INPUT)
{
PanicAlert("HID_TYPE_SET_REPORT input");
}
else
{
HidOutputReport((wm_report*)hidp->data);
}
break;
case HID_TYPE_DATA:
PanicAlert("HID_TYPE_DATA %s", hidp->type, hidp->param == HID_PARAM_INPUT ? "input" : "output");
break;
default:
PanicAlert("HidOutput: Unknown type %x and param %x", hidp->type, hidp->param);
break;
}
}
extern "C" void Wiimote_Update() {

View File

@ -16,10 +16,10 @@ struct hid_packet {
u8 data[0];
};
#define HID_TYPE_HANDSHAKE 0
#define HID_TYPE_SET_REPORT 5
#define HID_TYPE_DATA 0xA
#define HID_TYPE_HANDSHAKE 0
#define HID_HANDSHAKE_SUCCESS 0
#define HID_PARAM_INPUT 1