mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
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:
10
Externals/WiiUseSrc/Src/events.c
vendored
10
Externals/WiiUseSrc/Src/events.c
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user