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
yes i had to modify my patch created by tortoise manualy.. cuz i had sooo much stuff that had to be removed..
I was working on dozen of things. Just return int then, it shouldnt matter anyways, because it doesnt get checked only if positive but the return value itself.
the motion plus code is also not needed, same reason, cuz were passing code directly to the core via iowrite/ioread, however i added it up to my dll as well.

dont do it like this:
if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
{
#ifdef WIN32
CloseHandle(wm->dev_handle);
#else
close(wm->out_sock);
close(wm->in_sock);
#endif
}

Every OS handles all that stupid connection handler stuff different, i dont know if linux has problems with leaking handlers nor do i know if mac does, i suggest atm keeping it like this:
+ if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
+ CloseHandle(wm->dev_handle);
+ else
+ wm->event = WIIUSE_DISCONNECT;
+
+ #ifndef WIN32
+ wm->out_sock = -1;
+ wm->in_sock = -1;
+ #else
+ wm->dev_handle = 0;
+ #endif

that shouldnt break mac/linux


ps the dlls which i posted above where my dlls which also had various different other patches.. so its not just the plain patch above.. so better dont submit those dlls to svn. I ll do a clean compilation now.
However the re-pair part in dolphin/windows works, i tested it 100nds of times.
ps2: as a note, wiiuse_unexpected_disconnect was implemented in linux i think, so best atm dont change anything concerning the linux code, and well macosx i dont know havent checked there, but mainly cuz its not my area and most ppl wont care about osxTongue
my code shouldnt touch osx either.

ok done, recompiled, there they are.
http://uploaded.to/file/vu5jzu
It will break linux, the linux code doesn't even use wm->dev_handle at all, it doesn't even define it.
sorry you were absolutely right, i was still @io_"win".c sorry

#ifndef WIN32
wm->out_sock = -1;
wm->in_sock = -1;
wm->event = WIIUSE_DISCONNECT;
#else
if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
CloseHandle(wm->dev_handle);
else
wm->event = WIIUSE_DISCONNECT;
wm->dev_handle = 0;
#endif
Well I still want to see if any Linux users get any problems/benefits using this

Code:
if (wm->event == WIIUSE_UNEXPECTED_DISCONNECT)
    {
        #ifdef WIN32
        CloseHandle(wm->dev_handle);
        #else
        close(wm->out_sock);
        close(wm->in_sock);
        #endif
    }
Hi! This patch is in the SVN? If not, the dll of the first post has it?

I wan't to try if it solves this issue: http://forums.dolphin-emu.org/thread-9145.html

Regards!

LuisR14

yea it's in the svn Smile
Pages: 1 2