Fix a mess up on my part, causing a bunch of unknown events in Linux with the Wiimote. Dolphin sends out packets without the start 0x52 byte. WiiUse checks for this and adds it automatically. Wiimote is still having some problems, trying to figure it out

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3536 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1
2009-06-22 11:56:27 +00:00
parent cbff6dfde3
commit 1f590b8900
4 changed files with 81 additions and 80 deletions

View File

@ -84,29 +84,31 @@ static int state_changed(struct wiimote_t* wm);
int wiiuse_poll(struct wiimote_t** wm, int wiimotes) {
int evnt = 0;
#ifndef WIN32
int i;
#if defined(__APPLE__)
if (!wm)
return 0;
int i;
for (i = 0; i < wiimotes; ++i) {
wm[i]->event = WIIUSE_NONE;
if (!wm)
return 0;
if (wiiuse_io_read(wm[i])) {
/* propagate the event */
propagate_event(wm[i], wm[i]->event_buf[1], wm[i]->event_buf+2);
evnt += (wm[i]->event != WIIUSE_NONE);
for (i = 0; i < wiimotes; ++i) {
wm[i]->event = WIIUSE_NONE;
if (wiiuse_io_read(wm[i])) {
/* propagate the event */
propagate_event(wm[i], wm[i]->event_buf[1], wm[i]->event_buf+2);
evnt += (wm[i]->event != WIIUSE_NONE);
/* clear out the event buffer */
memset(wm[i]->event_buf, 0, sizeof(wm[i]->event_buf));
} else {
idle_cycle(wm[i]);
}
}
/* clear out the event buffer */
memset(wm[i]->event_buf, 0, sizeof(wm[i]->event_buf));
} else {
idle_cycle(wm[i]);
}
}
#else
/*
* Windows
* Windows, Unix
*/
int i;