From fe53461611d86384478064be6b4297a7c7e437e1 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 4 Feb 2016 18:31:36 -0600 Subject: [Android] Implement support for real Wiimotes with the DolphinBar This is the only way to get Wiimotes working under Android now. This, just like the Wii U Gamecube Controller Adapter, completely goes around Android's limitations and talks with the device directly through USBManager. Couple notes. Continuous scanning must be enabled otherwise the Wiimotes won't be seen. The UI doesn't expose support for this yet. One must change the Wiimote source and continuous scanning settings manually. Testing up to two wiimotes in Taiko No Tatsujin, no reason to believe all four won't work. --- Source/Android/jni/MainAndroid.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index ffa0eca40a..7d2849c96e 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -27,6 +27,7 @@ #include "Core/Host.h" #include "Core/State.h" #include "Core/HW/Wiimote.h" +#include "Core/HW/WiimoteReal/WiimoteReal.h" #include "Core/PowerPC/JitInterface.h" #include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/Profiler.h" @@ -632,6 +633,10 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestr Renderer::s_ChangedSurface.Wait(); } } +JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv *env, jobject obj) +{ + WiimoteReal::Refresh(); +} JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv *env, jobject obj) { @@ -646,6 +651,8 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Run(JNIEnv * UICommon::SetUserDirectory(g_set_userpath); UICommon::Init(); + WiimoteReal::InitAdapterClass(); + // No use running the loop when booting fails if ( BootManager::BootCore( g_filename.c_str() ) ) { -- cgit v1.2.3