mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Overhaul of OS X real Wiimote support.
Fixes a number of problems, including unreliable connection setup, frequent disconnections, busy-waiting and shutdown deadlocks. Motion Plus and nunchuk hot swapping now work and Wiiuse does a small amount of queueing to prevent occasional dropped packets. The OS X bluetooth stack has no internal input buffering and while a worker thread can easily keep up with data coming from the Wiimote, the rest of Dolphin can easily get behind if it is blocked by disk I/O or similar. Mostly the Wiimote protocol recovers from dropped packets, but sometimes the Wiimote would get out of sync and send a disconnect. I wonder if the other platforms might benefit from a bit of queueing at this layer as well. Still doesn't support multiple devices, as I kept changing my mind about how best to do it. I only have one Wiimote anyway.. One improvement to the Wiimote plugin that would be really nice would be for the scan for new devices to operate continuously or periodically like on a real Wii rather than just for 5 seconds at startup.. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5640 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
6
Externals/WiiUseSrc/Src/nunchuk.c
vendored
6
Externals/WiiUseSrc/Src/nunchuk.c
vendored
@ -109,7 +109,7 @@ int nunchuk_handshake(struct wiimote_t* wm, struct nunchuk_t* nc, byte* data, un
|
||||
nc->accel_threshold = wm->accel_threshold;
|
||||
|
||||
/* handshake done */
|
||||
wm->exp.type = EXP_NUNCHUK;
|
||||
wm->expansion.type = EXP_NUNCHUK;
|
||||
|
||||
/* if min and max are reported as 0, initialize them to usable values based on center, and fine tune in nunchuck_event() */
|
||||
if (nc->js.center.x) {
|
||||
@ -212,7 +212,7 @@ static void nunchuk_pressed_buttons(struct nunchuk_t* nc, byte now) {
|
||||
void wiiuse_set_nunchuk_orient_threshold(struct wiimote_t* wm, float threshold) {
|
||||
if (!wm) return;
|
||||
|
||||
wm->exp.nunchuk.orient_threshold = threshold;
|
||||
wm->expansion.nunchuk.orient_threshold = threshold;
|
||||
}
|
||||
|
||||
|
||||
@ -227,5 +227,5 @@ void wiiuse_set_nunchuk_orient_threshold(struct wiimote_t* wm, float threshold)
|
||||
void wiiuse_set_nunchuk_accel_threshold(struct wiimote_t* wm, int threshold) {
|
||||
if (!wm) return;
|
||||
|
||||
wm->exp.nunchuk.accel_threshold = threshold;
|
||||
wm->expansion.nunchuk.accel_threshold = threshold;
|
||||
}
|
||||
|
Reference in New Issue
Block a user