2008-12-08 04:58:11 +00:00
|
|
|
/*
|
|
|
|
* wiiuse
|
|
|
|
*
|
|
|
|
* Written By:
|
|
|
|
* Michael Laforest < para >
|
|
|
|
* Email: < thepara (--AT--) g m a i l [--DOT--] com >
|
|
|
|
*
|
|
|
|
* Copyright 2006-2007
|
|
|
|
*
|
|
|
|
* This file is part of wiiuse.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief General wiimote operations.
|
|
|
|
*
|
|
|
|
* The file includes functions that handle general
|
|
|
|
* tasks. Most of these are functions that are part
|
|
|
|
* of the API.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2010-10-13 09:57:13 +00:00
|
|
|
#include <string.h>
|
2008-12-08 04:58:11 +00:00
|
|
|
|
2010-08-18 00:22:08 +00:00
|
|
|
#ifndef _WIN32
|
2008-12-08 04:58:11 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#else
|
|
|
|
#include <Winsock2.h>
|
|
|
|
#endif
|
|
|
|
|
2010-11-13 20:02:01 +00:00
|
|
|
#include "Common.h"
|
2008-12-08 04:58:11 +00:00
|
|
|
#include "wiiuse_internal.h"
|
2010-07-23 15:03:49 +00:00
|
|
|
|
2010-06-10 14:39:08 +00:00
|
|
|
static int g_banner = 1;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @breif Returns the version of the library.
|
|
|
|
*/
|
|
|
|
const char* wiiuse_version() {
|
|
|
|
return WIIUSE_VERSION;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Clean up wiimote_t array created by wiiuse_init()
|
|
|
|
*/
|
|
|
|
void wiiuse_cleanup(struct wiimote_t** wm, int wiimotes) {
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
if (!wm)
|
|
|
|
return;
|
|
|
|
|
2010-11-13 19:15:43 +00:00
|
|
|
NOTICE_LOG(WIIMOTE, "wiiuse clean up...");
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
for (; i < wiimotes; ++i) {
|
|
|
|
wiiuse_disconnect(wm[i]);
|
|
|
|
free(wm[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
free(wm);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize an array of wiimote structures.
|
|
|
|
*
|
|
|
|
* @param wiimotes Number of wiimote_t structures to create.
|
|
|
|
*
|
|
|
|
* @return An array of initialized wiimote_t structures.
|
|
|
|
*
|
|
|
|
* @see wiiuse_connect()
|
|
|
|
*
|
|
|
|
* The array returned by this function can be passed to various
|
|
|
|
* functions, including wiiuse_connect().
|
|
|
|
*/
|
|
|
|
struct wiimote_t** wiiuse_init(int wiimotes) {
|
|
|
|
int i = 0;
|
|
|
|
struct wiimote_t** wm = NULL;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Please do not remove this banner.
|
|
|
|
* GPL asks that you please leave output credits intact.
|
|
|
|
* Thank you.
|
|
|
|
*
|
|
|
|
* This banner is only displayed once so that if you need
|
|
|
|
* to call this function again it won't be intrusive.
|
|
|
|
*/
|
|
|
|
if (!g_banner) {
|
|
|
|
printf( "wiiuse v" WIIUSE_VERSION " loaded.\n"
|
|
|
|
" By: Michael Laforest <thepara[at]gmail{dot}com>\n"
|
|
|
|
" http://wiiuse.net http://wiiuse.sf.net\n");
|
|
|
|
g_banner = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!wiimotes)
|
|
|
|
return NULL;
|
|
|
|
|
2009-04-30 17:28:43 +00:00
|
|
|
wm = (struct wiimote_t **)malloc(sizeof(struct wiimote_t*) * wiimotes);
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
for (i = 0; i < wiimotes; ++i) {
|
2009-04-30 17:28:43 +00:00
|
|
|
wm[i] = (struct wiimote_t *)malloc(sizeof(struct wiimote_t));
|
2008-12-08 04:58:11 +00:00
|
|
|
memset(wm[i], 0, sizeof(struct wiimote_t));
|
|
|
|
|
|
|
|
wm[i]->unid = i+1;
|
|
|
|
|
2010-10-13 09:57:13 +00:00
|
|
|
#if defined __linux__ && HAVE_BLUEZ
|
2010-11-13 22:07:27 +00:00
|
|
|
wm[i]->bdaddr = (bdaddr_t){{0, 0, 0, 0, 0, 0}};
|
2008-12-08 04:58:11 +00:00
|
|
|
wm[i]->out_sock = -1;
|
|
|
|
wm[i]->in_sock = -1;
|
2010-06-09 19:36:08 +00:00
|
|
|
#elif defined(_WIN32)
|
2008-12-08 04:58:11 +00:00
|
|
|
wm[i]->dev_handle = 0;
|
|
|
|
wm[i]->stack = WIIUSE_STACK_UNKNOWN;
|
|
|
|
#endif
|
|
|
|
|
External/wiiuse clean up, part 2.
- More removal of unnecessary code
- Windows: Modification of Wiiuse_Find under windows,
instead of always deleting and recreating the whole wiimote_t struct, we do maintain the old one,
adding/removing new wiimotes to/from it
- some wiimote bugfixes, see below for details
Windows related stuff:
Fixed most of the disconnection issues (single and mulitple real wiimotes, both wiimote plugins) (I haven't had a disconnect msg in hours anymore(ms stack)).
Rumble bug should be fixed now(both plugins,pls verify).
Fixed some pair up issues( sometimes you had to press the pair up button up to 3 times, till it paired up your wiimote).
More dongles might be now supported via ms stack, pls try and report back!
Fixed a problem where multiple wiimotes would swap slots on pair-up/addition of a real wiimote (2-4 real wiimotes) (both plugins, but not integrated into new plugin).
Improved ingame auto-pairup for real wiimotes(thx to the new wiiuse_find routine).
Fixed a bug on setting wiimote timeouts, which means changing the timeout was just a dummy earlier.
Most of the stuff concerns stuff in the old wiimote plugin, dont worry, in the end it's important for both plugins. It will get ported to the new plugin sooner or later.:')
Some minor stuff.
This might break osx/linux build and maybe the new plugin realwiimote-wise only. Thx to glennrics to pointing me to some breakings on linux, I didn't fix them all.
PS I hope i haven't forgotten anything, enjoy.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5940 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-22 04:31:36 +00:00
|
|
|
wm[i]->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
2008-12-08 04:58:11 +00:00
|
|
|
wm[i]->state = WIIMOTE_INIT_STATES;
|
|
|
|
wm[i]->flags = WIIUSE_INIT_FLAGS;
|
|
|
|
wm[i]->event = WIIUSE_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return wm;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The wiimote disconnected.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
*/
|
|
|
|
void wiiuse_disconnected(struct wiimote_t* wm) {
|
|
|
|
if (!wm) return;
|
|
|
|
|
2010-11-13 19:15:43 +00:00
|
|
|
NOTICE_LOG(WIIMOTE, "Wiimote disconnected [id %i].", wm->unid);
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
/* disable the connected flag */
|
|
|
|
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
|
|
|
|
|
|
|
/* reset a bunch of stuff */
|
|
|
|
wm->leds = 0;
|
|
|
|
wm->state = WIIMOTE_INIT_STATES;
|
|
|
|
memset(wm->event_buf, 0, sizeof(wm->event_buf));
|
|
|
|
|
2010-10-13 09:57:13 +00:00
|
|
|
#if defined __linux__ && HAVE_BLUEZ
|
2010-04-10 14:39:54 +00:00
|
|
|
wm->out_sock = -1;
|
|
|
|
wm->in_sock = -1;
|
2010-06-09 19:36:08 +00:00
|
|
|
#elif defined(_WIN32)
|
2010-04-10 14:39:54 +00:00
|
|
|
CloseHandle(wm->dev_handle);
|
|
|
|
wm->dev_handle = 0;
|
|
|
|
#endif
|
|
|
|
|
2008-12-08 04:58:11 +00:00
|
|
|
wm->event = WIIUSE_DISCONNECT;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enable or disable the rumble.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
* @param status 1 to enable, 0 to disable.
|
|
|
|
*/
|
|
|
|
void wiiuse_rumble(struct wiimote_t* wm, int status) {
|
|
|
|
byte buf;
|
|
|
|
|
|
|
|
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* make sure to keep the current lit leds */
|
|
|
|
buf = wm->leds;
|
|
|
|
|
|
|
|
if (status) {
|
2010-11-13 19:15:43 +00:00
|
|
|
DEBUG_LOG(WIIMOTE, "Starting rumble...");
|
2008-12-08 04:58:11 +00:00
|
|
|
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_RUMBLE);
|
|
|
|
buf |= 0x01;
|
|
|
|
} else {
|
2010-11-13 19:15:43 +00:00
|
|
|
DEBUG_LOG(WIIMOTE, "Stopping rumble...");
|
2008-12-08 04:58:11 +00:00
|
|
|
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_RUMBLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* preserve IR state */
|
|
|
|
if (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_IR))
|
|
|
|
buf |= 0x04;
|
|
|
|
|
|
|
|
wiiuse_send(wm, WM_CMD_RUMBLE, &buf, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the enabled LEDs.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
* @param leds What LEDs to enable.
|
|
|
|
*
|
|
|
|
* \a leds is a bitwise or of WIIMOTE_LED_1, WIIMOTE_LED_2, WIIMOTE_LED_3, or WIIMOTE_LED_4.
|
|
|
|
*/
|
|
|
|
void wiiuse_set_leds(struct wiimote_t* wm, int leds) {
|
|
|
|
byte buf;
|
|
|
|
|
|
|
|
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* remove the lower 4 bits because they control rumble */
|
|
|
|
wm->leds = (leds & 0xF0);
|
2010-07-02 15:48:42 +00:00
|
|
|
buf = wm->leds;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
/* make sure if the rumble is on that we keep it on */
|
|
|
|
if (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_RUMBLE))
|
2010-07-02 15:48:42 +00:00
|
|
|
buf |= 0x01;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
wiiuse_send(wm, WM_CMD_LED, &buf, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the report type based on the current wiimote state.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
*
|
|
|
|
* @return The report type sent.
|
|
|
|
*
|
|
|
|
* The wiimote reports formatted packets depending on the
|
|
|
|
* report type that was last requested. This function will
|
|
|
|
* update the type of report that should be sent based on
|
|
|
|
* the current state of the device.
|
|
|
|
*/
|
|
|
|
int wiiuse_set_report_type(struct wiimote_t* wm) {
|
|
|
|
byte buf[2];
|
2010-06-09 19:36:08 +00:00
|
|
|
int motion, expansion, ir;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
buf[0] = (WIIMOTE_IS_FLAG_SET(wm, WIIUSE_CONTINUOUS) ? 0x04 : 0x00); /* set to 0x04 for continuous reporting */
|
|
|
|
|
|
|
|
/* if rumble is enabled, make sure we keep it */
|
|
|
|
if (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_RUMBLE))
|
|
|
|
buf[0] |= 0x01;
|
|
|
|
|
|
|
|
motion = WIIMOTE_IS_SET(wm, WIIMOTE_STATE_ACC);
|
2010-06-09 19:36:08 +00:00
|
|
|
expansion = WIIMOTE_IS_SET(wm, WIIMOTE_STATE_EXP);
|
2008-12-08 04:58:11 +00:00
|
|
|
ir = WIIMOTE_IS_SET(wm, WIIMOTE_STATE_IR);
|
|
|
|
|
External/wiiuse clean up, part 2.
- More removal of unnecessary code
- Windows: Modification of Wiiuse_Find under windows,
instead of always deleting and recreating the whole wiimote_t struct, we do maintain the old one,
adding/removing new wiimotes to/from it
- some wiimote bugfixes, see below for details
Windows related stuff:
Fixed most of the disconnection issues (single and mulitple real wiimotes, both wiimote plugins) (I haven't had a disconnect msg in hours anymore(ms stack)).
Rumble bug should be fixed now(both plugins,pls verify).
Fixed some pair up issues( sometimes you had to press the pair up button up to 3 times, till it paired up your wiimote).
More dongles might be now supported via ms stack, pls try and report back!
Fixed a problem where multiple wiimotes would swap slots on pair-up/addition of a real wiimote (2-4 real wiimotes) (both plugins, but not integrated into new plugin).
Improved ingame auto-pairup for real wiimotes(thx to the new wiiuse_find routine).
Fixed a bug on setting wiimote timeouts, which means changing the timeout was just a dummy earlier.
Most of the stuff concerns stuff in the old wiimote plugin, dont worry, in the end it's important for both plugins. It will get ported to the new plugin sooner or later.:')
Some minor stuff.
This might break osx/linux build and maybe the new plugin realwiimote-wise only. Thx to glennrics to pointing me to some breakings on linux, I didn't fix them all.
PS I hope i haven't forgotten anything, enjoy.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5940 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-22 04:31:36 +00:00
|
|
|
buf[1] = 0x30;
|
|
|
|
|
2008-12-08 04:58:11 +00:00
|
|
|
|
2010-11-13 19:15:43 +00:00
|
|
|
DEBUG_LOG(WIIMOTE, "Setting report type: 0x%x", buf[1]);
|
2008-12-08 04:58:11 +00:00
|
|
|
|
2010-06-09 19:36:08 +00:00
|
|
|
expansion = wiiuse_send(wm, WM_CMD_REPORT_TYPE, buf, 2);
|
|
|
|
if (expansion <= 0)
|
|
|
|
return expansion;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
return buf[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Write data to the wiimote.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
* @param addr The address to write to.
|
|
|
|
* @param data The data to be written to the memory location.
|
|
|
|
* @param len The length of the block to be written.
|
|
|
|
*/
|
|
|
|
int wiiuse_write_data(struct wiimote_t* wm, unsigned int addr, byte* data, byte len) {
|
|
|
|
byte buf[21] = {0}; /* the payload is always 23 */
|
|
|
|
|
|
|
|
if (!wm || !WIIMOTE_IS_CONNECTED(wm))
|
|
|
|
return 0;
|
|
|
|
if (!data || !len)
|
|
|
|
return 0;
|
|
|
|
|
2010-11-13 19:15:43 +00:00
|
|
|
DEBUG_LOG(WIIMOTE, "Writing %i bytes to memory location 0x%x...", len, addr);
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
#ifdef WITH_WIIUSE_DEBUG
|
|
|
|
{
|
|
|
|
int i = 0;
|
|
|
|
printf("Write data is: ");
|
|
|
|
for (; i < len; ++i)
|
|
|
|
printf("%x ", data[i]);
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* the offset is in big endian */
|
2010-12-05 16:18:09 +00:00
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
*(int*)(buf) = addr;
|
|
|
|
#else
|
|
|
|
*(int*)(buf) = Common::swap32(addr);
|
|
|
|
#endif
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
/* length */
|
|
|
|
*(byte*)(buf + 4) = len;
|
|
|
|
|
|
|
|
/* data */
|
|
|
|
memcpy(buf + 5, data, len);
|
|
|
|
|
|
|
|
wiiuse_send(wm, WM_CMD_WRITE_DATA, buf, 21);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Send a packet to the wiimote.
|
|
|
|
*
|
|
|
|
* @param wm Pointer to a wiimote_t structure.
|
|
|
|
* @param report_type The report type to send (WIIMOTE_CMD_LED, WIIMOTE_CMD_RUMBLE, etc). Found in wiiuse.h
|
|
|
|
* @param msg The payload.
|
|
|
|
* @param len Length of the payload in bytes.
|
|
|
|
*
|
|
|
|
* This function should replace any write()s directly to the wiimote device.
|
|
|
|
*/
|
|
|
|
int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|
|
|
byte buf[32]; /* no payload is better than this */
|
|
|
|
int rumble = 0;
|
|
|
|
|
2009-11-19 22:47:57 +00:00
|
|
|
buf[0] = WM_SET_REPORT | WM_BT_OUTPUT;
|
|
|
|
buf[1] = report_type;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
switch (report_type) {
|
|
|
|
case WM_CMD_LED:
|
|
|
|
case WM_CMD_RUMBLE:
|
|
|
|
case WM_CMD_CTRL_STATUS:
|
|
|
|
{
|
|
|
|
/* Rumble flag for: 0x11, 0x13, 0x14, 0x15, 0x19 or 0x1a */
|
|
|
|
if (WIIMOTE_IS_SET(wm, WIIMOTE_STATE_RUMBLE))
|
|
|
|
rumble = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-11-19 22:47:57 +00:00
|
|
|
memcpy(buf+2, msg, len);
|
|
|
|
if (rumble)
|
|
|
|
buf[2] |= 0x01;
|
2008-12-08 04:58:11 +00:00
|
|
|
|
|
|
|
#ifdef WITH_WIIUSE_DEBUG
|
|
|
|
{
|
|
|
|
int x = 2;
|
|
|
|
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
2010-08-18 00:22:08 +00:00
|
|
|
#ifndef _WIN32
|
2008-12-08 04:58:11 +00:00
|
|
|
for (; x < len+2; ++x)
|
|
|
|
#else
|
|
|
|
for (; x < len+1; ++x)
|
|
|
|
#endif
|
|
|
|
printf("%.2x ", buf[x]);
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-11-19 22:47:57 +00:00
|
|
|
return wiiuse_io_write(wm, buf, len+2);
|
2008-12-08 04:58:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the normal and expansion handshake timeouts.
|
|
|
|
*
|
|
|
|
* @param wm Array of wiimote_t structures.
|
|
|
|
* @param wiimotes Number of objects in the wm array.
|
|
|
|
* @param normal_timeout The timeout in milliseconds for a normal read.
|
|
|
|
* @param exp_timeout The timeout in millisecondsd to wait for an expansion handshake.
|
|
|
|
*/
|
External/wiiuse clean up, part 2.
- More removal of unnecessary code
- Windows: Modification of Wiiuse_Find under windows,
instead of always deleting and recreating the whole wiimote_t struct, we do maintain the old one,
adding/removing new wiimotes to/from it
- some wiimote bugfixes, see below for details
Windows related stuff:
Fixed most of the disconnection issues (single and mulitple real wiimotes, both wiimote plugins) (I haven't had a disconnect msg in hours anymore(ms stack)).
Rumble bug should be fixed now(both plugins,pls verify).
Fixed some pair up issues( sometimes you had to press the pair up button up to 3 times, till it paired up your wiimote).
More dongles might be now supported via ms stack, pls try and report back!
Fixed a problem where multiple wiimotes would swap slots on pair-up/addition of a real wiimote (2-4 real wiimotes) (both plugins, but not integrated into new plugin).
Improved ingame auto-pairup for real wiimotes(thx to the new wiiuse_find routine).
Fixed a bug on setting wiimote timeouts, which means changing the timeout was just a dummy earlier.
Most of the stuff concerns stuff in the old wiimote plugin, dont worry, in the end it's important for both plugins. It will get ported to the new plugin sooner or later.:')
Some minor stuff.
This might break osx/linux build and maybe the new plugin realwiimote-wise only. Thx to glennrics to pointing me to some breakings on linux, I didn't fix them all.
PS I hope i haven't forgotten anything, enjoy.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5940 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-22 04:31:36 +00:00
|
|
|
void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, byte timeout) {
|
2008-12-08 04:58:11 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
if (!wm) return;
|
|
|
|
|
|
|
|
for (i = 0; i < wiimotes; ++i) {
|
External/wiiuse clean up, part 2.
- More removal of unnecessary code
- Windows: Modification of Wiiuse_Find under windows,
instead of always deleting and recreating the whole wiimote_t struct, we do maintain the old one,
adding/removing new wiimotes to/from it
- some wiimote bugfixes, see below for details
Windows related stuff:
Fixed most of the disconnection issues (single and mulitple real wiimotes, both wiimote plugins) (I haven't had a disconnect msg in hours anymore(ms stack)).
Rumble bug should be fixed now(both plugins,pls verify).
Fixed some pair up issues( sometimes you had to press the pair up button up to 3 times, till it paired up your wiimote).
More dongles might be now supported via ms stack, pls try and report back!
Fixed a problem where multiple wiimotes would swap slots on pair-up/addition of a real wiimote (2-4 real wiimotes) (both plugins, but not integrated into new plugin).
Improved ingame auto-pairup for real wiimotes(thx to the new wiiuse_find routine).
Fixed a bug on setting wiimote timeouts, which means changing the timeout was just a dummy earlier.
Most of the stuff concerns stuff in the old wiimote plugin, dont worry, in the end it's important for both plugins. It will get ported to the new plugin sooner or later.:')
Some minor stuff.
This might break osx/linux build and maybe the new plugin realwiimote-wise only. Thx to glennrics to pointing me to some breakings on linux, I didn't fix them all.
PS I hope i haven't forgotten anything, enjoy.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5940 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-07-22 04:31:36 +00:00
|
|
|
wm[i]->timeout = timeout;
|
2008-12-08 04:58:11 +00:00
|
|
|
}
|
|
|
|
}
|