Dolphin, the GameCube and Wii emulator - Forums

Full Version: [FIX] Pair-up button fixed@win32 + bugfixing WIIUSE/implemented unexpected_disconnect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The old and rusty wiiuse plugin is leaking CreateFile() handles on wiiuse_Find() and on wiiuse_unexpected_disconnects.

I fixed most of the leaking within wiiuse, allowing us to re-pair wiimotes now infinite times w/o the need to close dolphin each time. This should also fix some problems regarding unsuccessfull pairups.
However, its not perfect yet, but the biggest handle leaks are closed.

You'll just need to replace your old wiiuse.dll/plugin_wiimote.dll with those new ones.

[WIIUSE]
wiiuse.dll x64 : http://archiv.to/GET/FILE4BBE9B36A1832
wiiuse.dll x32 : http://archiv.to/GET/FILE4BBE9B55A981C

wiiuse fix/patch diff file:
http://pastie.org/pastes/910846/download?key=xwrbhvmf4nlhk6y6yzga

[PLUGIN_WIIMOTE]
Plugin_Wiimote.dll x64 http://archiv.to/GET/FILE4BBEA6311CD22

wiimote_real.cpp fix, diff file:
http://pastie.org/pastes/910882/download?key=zq8h81sa7oyqr2gleipig

Notes on pairing up wiimotes in dolphin[ms bt stack]:
Best way to pair up your wiimote is, first start up dolphin, go into the wiimote plugin, turn on your bluetooth radio, press 1+2 on your wiimote(s), press the pair up button, wait till its ungrayed again, and press the Refresh Realwiimotes button.
you can also pair up multiple wiimotes in one go, just press 1+2 on all wiimotes at around the same time, and when all are blinking press the pair up button.
Ah cool Schez, I'll commit it for you if anyone finds it helps out (Unless you have SVN access).
Just wondering if you would be able to provide me with a link to the stuff you need to compile Wiiuse, I can't seem to find how to.
Same with how to compile both 64 bit with Visual Studio Express because the stupid SDK's don't seem to work with it.
You'll need the windows driver kit
WDK: http://www.microsoft.com/whdc/devtools/wdk/wdkpkg.mspx
That should do the trick
PS: The WDK is also one of the reasons why wiiuse hasn't been merged into dolphin yet, you would need it to compile dolphin itself then.
PS2; yea go ahead, commit pls, i refused to have svn accessTongue btw its sanchez not schez.Wink
Sanchez I need the .lib file for 64 build since I still need to get the stupid 64bit compiler to install properly.
sanchez: your patches were some crazy format that tortoisesvn hated.
Here is a sane combined patch

I would have committed it when I did this, but just from looking at it, it looks like it would break non-win32 build of wiiuse...

also, why
Code:
return ((BOOLEAN) i);
?
On my system, BOOLEAN is defined as char. The function (wiiuse_io_write) returns int.
From the look of it, it shouldn't break the build of a non-win32 build Shuffle2.
sure it will. look closer Smile
Wait a minute I think i see....
CloseHandle(wm->dev_handle);
^^^^^^^^^^^^^^^^^^^^
That is it isn't it?

If so couldn't you just ifdef it like so

Code:
    #ifdef WIN32
    if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
        CloseHandle(wm->dev_handle);
    else
    #endif
    wm->event = WIIUSE_DISCONNECT;

or this (Untested)
Code:
    if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
    {
        #ifdef WIN32
        CloseHandle(wm->dev_handle);
        #else
        close(wm->out_sock);
        close(wm->in_sock);
        #endif
    }
Yes! Smile
I would suggest not committing it until someone has tested on linux/osx, though.
Ok. sure I'll wait Tongue
EDIT:
Shuffle2 should I add in the motion plus that's in the Libogc version of Wiiuse, plus one more thing should we be use the decrypted values like the libogc version rather then having to decrypt absolutely everything.
Pages: 1 2