wiimote for osx WIP

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3109 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
tmator
2009-04-30 14:23:45 +00:00
parent 63f84a491a
commit 3917941ae1
8 changed files with 222 additions and 40 deletions

View File

@ -631,7 +631,7 @@ static void handle_expansion(struct wiimote_t* wm, byte* msg) {
* a handshake with the expansion.
*/
void handshake_expansion(struct wiimote_t* wm, byte* data, unsigned short len) {
int id;
int wid;
if (!data) {
byte* handshake_buf;
@ -649,7 +649,7 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, unsigned short len) {
wiiuse_write_data(wm, WM_EXP_MEM_ENABLE, &buf, 1);
/* get the calibration data */
handshake_buf = malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
handshake_buf = (byte *)malloc(EXP_HANDSHAKE_LEN * sizeof(byte));
wiiuse_read_data_cb(wm, handshake_expansion, handshake_buf, WM_EXP_MEM_CALIBR, EXP_HANDSHAKE_LEN);
/* tell the wiimote to send expansion data */
@ -658,10 +658,10 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, unsigned short len) {
return;
}
id = BIG_ENDIAN_LONG(*(int*)(data + 220));
wid = BIG_ENDIAN_LONG(*(int*)(data + 220));
/* call the corresponding handshake function for this expansion */
switch (id) {
switch (wid) {
case EXP_ID_CODE_NUNCHUK:
{
if (nunchuk_handshake(wm, &wm->exp.nunchuk, data, len))
@ -682,7 +682,7 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, unsigned short len) {
}
default:
{
WIIUSE_WARNING("Unknown expansion type. Code: 0x%x", id);
WIIUSE_WARNING("Unknown expansion type. Code: 0x%x", wid);
break;
}
}