• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 70 71 72 73 74 ... 117 Next »

Third Party Wiimotes
View New Posts | View Today's Posts

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Third Party Wiimotes
12-24-2010, 07:11 AM
#1
palsch
Unregistered
 
Hello all,

i have bought from eBay three third party wiimotes, but only one of them works with dolphin-emu. Sad

I can connect all three with bluesoleil!

I tried the the wiimotelib, and it does find only one wiimote, which also works on dolphin. So i looked to Device Manager, and compared the values of the Drivers from the working one, and the other, which doesn't work. And i found a small difference:
Code:
    Hardware ID: (VID = Nintendo, PID = Wiimote)
        Works=HID\VID_057e&PID_0306  
        DontWorks=HID\VID_0001&PID_0002

    Device instance path:
        Works=HID\VID_057E&PID_0306\2&203DFF11&0&0000
        DontWorks=HID\VID_0001&PID_0002\2&D85BBA1&0&0000
    
    Container-ID:
        Works={d130e845-f661-11df-a8af-080027003c93}
        DontWorks={f6f2f62b-0ce4-11e0-aca5-fb673bc83d04}
At first you can see here, that the Hardware ID is different between the two wiimotes. So i took the sourcecode of the wiimotelib, and found the row, where the variables with the hardware-ids are defined (File: Wiimote.cs) i changed them, and compiled the Wiimotelib. I run the WiimoteTest file, and see there, it found my other wiimote, which doesn't worked at first. So i tested this wiimote with the WiimoteTest-app, and it works perfect.

I thought, maybe could somebody do the same with Dolphin, so that it also works with the VID: 0001 and PID: 0002 ?
I could try to write the patch myself, but i couldn't find the variables, where the hardware-ids are defined.

PS: sorry for my bad english, i am from german! I hope you can understand the writing above.

mfg Paul

EDIT: I make a Patch for this here
Reply
12-24-2010, 10:19 AM
#2
skid Offline
skidau / skid_au
**********
Developers (Some Administrators and Super Moderators)
Posts: 2,006
Threads: 8
Joined: Aug 2009
The id's are defined in:

Code:
\Source\Core\wiiuse\Src\io_win.cpp
\Source\Core\wiiuse\Src\wiiuse_internal.h
Find
Reply
12-24-2010, 10:57 AM
#3
palsch
Unregistered
 
(12-24-2010, 10:19 AM)skid Wrote: The id's are defined in:

Code:
\Source\Core\wiiuse\Src\io_win.cpp
\Source\Core\wiiuse\Src\wiiuse_internal.h

Ok thanks, i just found out, that the PID/VID of my third wiimote will be wrong recognized by "setupapi.dll", it has the PID=0002 and VID=0001, but the setupapi.dll returns this: PID=00F7 and VID=0002, so i we have now three different PID/VID numbers:

Code:
Original Nintendo: VID=057E & PID=0306
Third Party 1: VID=0001 & PID=0002
Third Party 2: VID=0002 & PID=00F7
I have just done a patch in "io_win.cpp" which connects to all of this wiimotes!
I think, if there are more of such different ids, then it is bad idea to hardcode them, so maybe we should load them from a file?

I hope, this solution will find to svn...

Have fun, and bye.


Attached Files
.patch   wiiusePatch.patch (Size: 1.51 KB / Downloads: 199)
Reply
12-24-2010, 12:13 PM
#4
skid Offline
skidau / skid_au
**********
Developers (Some Administrators and Super Moderators)
Posts: 2,006
Threads: 8
Joined: Aug 2009
The code is a little bit of a hack job but good enough that it works. I'll commit it.
Find
Reply
12-24-2010, 07:44 PM
#5
palsch
Unregistered
 
(12-24-2010, 12:13 PM)skid Wrote: The code is a little bit of a hack job but good enough that it works. I'll commit it.

Thanks Smile

I think, this solution will also working in this problem: Problem whit new Wii control (Black)
Reply
12-25-2010, 03:34 AM
#6
Nosotros
Unregistered
 
(12-24-2010, 07:44 PM)palsch Wrote:
(12-24-2010, 12:13 PM)skid Wrote: The code is a little bit of a hack job but good enough that it works. I'll commit it.

Thanks Smile

I think, this solution will also working in this problem: Problem whit new Wii control (Black)

can someone tell me which third party wiimotes works? i can get Power A mini wiimotes, but i dont know if they will work
Reply
12-28-2010, 12:27 AM
#7
palsch
Unregistered
 
Quote:can someone tell me which third party wiimotes works? i can get Power A mini wiimotes, but i dont know if they will work

I have bought my wiimotes from here eBay.

I think they are from china, and they have no trademark. I bought from there 4 wiimotes, the first wiimote had the VID/PID as the original nintendo one. The other three have the different VID/PID (see above).

But all of them shows wrong battery state, almost full battery, but its not important for me.

Reply
12-28-2010, 06:34 AM
#8
siferion Offline
Junior Member
**
Posts: 20
Threads: 1
Joined: Nov 2010
You should submit this to the guys over at wiiuse. Their API is perhaps one the better ones I've used so far for the wiimote, I'm sure they'd be interested.

In io_win.c, the function wiiuse_find, there is a section that reads:
Code:
if ((attr.VendorID == WM_VENDOR_ID) && (attr.ProductID == WM_PRODUCT_ID))
{
    ... wiimote initialization code  ...
} else {
    /* not a wiimote */
    CloseHandle(dev);
}

Replace the declaration of WM_VENDOR_ID and WM_PRODUCT_ID with something like:
Code:
#define WM_KNOWN_ID_COUNT number of known ids goes here

#define WM_VENDOR_ID0 first known id
#define WM_PRODUCT_ID0 first known id

#define WM_VENDOR_ID1 second known id
#define WM_PRODUCT_ID1 second known id

// repeat above for each known VID and PID

#define WM_GET_VENDOR_ID(index) WM_VENDOR_ID##index
#define WM_GET_PRODUCT_ID(index) WM_PRODUCT_ID##index

And replace that first mentioned block in io_win.c with something like:
Code:
bool wiimoteFound = false;
for (int j = 0; j < WM_KNOWN_ID_COUNT; j++)
{
     if ((attr.VendorID == WM_GET_VENDOR_ID(j)) && (attr.ProductID == WM_GET_PRODUCT_ID(j)))
     {
          wiimoteFound = true;
          break;
     }
}

if (wiimoteFound)
{
     ... wiimote initialization code ...
}
else
{
    /* not a wiimote */
    CloseHandle(dev);
}

A better solution would involve some sort of config file the end user could modify to add new VID and PID, but the above would suffice for the time being and take relatively little work to implement.
Find
Reply
12-30-2010, 08:46 AM
#9
Nosotros
Unregistered
 
this is the wiimote i got: http://www.amazon.com/Pro-Pack-Mini-Wii-MiniChuk-Nintendo/dp/B003V4AK7U/ref=pd_sim_vg_2

does someones has that one working with dolphin already?
Reply
12-30-2010, 08:50 AM
#10
knglrk Offline
55% weeaboo
****
Posts: 502
Threads: 6
Joined: Aug 2010
it should work

while back the devs added a patch
that lets third party controllers
you will have to test it out.
[Image: shu.jpg]

[color=#32CD32]My Website[/color]
[color=#FF0000]Youtube Channel[/color]
Website Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode