LINK: Don't init IPC unless asked to do so

git-svn-id: https://svn.code.sf.net/p/vbam/code/branches/bgk-link@1124 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
bgk 2012-09-09 06:47:15 +00:00
parent 4c0b34fcf4
commit 7e57b3b184
1 changed files with 35 additions and 22 deletions

View File

@ -956,22 +956,7 @@ u16 StartRFU(u16 value)
}
}
//////////////////////////////////////////////////////////////////////////
// Probably from here down needs to be replaced with SFML goodness :)
// tjm: what SFML goodness? SFML for network, yes, but not for IPC
bool InitLink(LinkMode mode)
{
// Do nothing if we are already connected
if (GetLinkMode() != LINK_DISCONNECTED) {
systemMessage(0, N_("Error, link already connected"));
return false;
}
if (mode == LINK_GAMECUBE_DOLPHIN) {
JoyBusConnect();
}
static bool InitIPC() {
linkid = 0;
#if (defined __WIN32__ || defined _WIN32)
@ -1082,15 +1067,43 @@ bool InitLink(LinkMode mode)
}
#endif
}
for(i=0;i<4;i++)
linkdata[i] = 0xffff;
// No errors, save the link mode
gba_link_mode = mode;
return true;
}
//////////////////////////////////////////////////////////////////////////
// Probably from here down needs to be replaced with SFML goodness :)
// tjm: what SFML goodness? SFML for network, yes, but not for IPC
bool InitLink(LinkMode mode)
{
// Do nothing if we are already connected
if (GetLinkMode() != LINK_DISCONNECTED) {
systemMessage(0, N_("Error, link already connected"));
return false;
}
bool initOk = true;
if (mode == LINK_GAMECUBE_DOLPHIN) {
JoyBusConnect();
} else if (mode == LINK_CABLE_IPC || mode == LINK_RFU_IPC) {
initOk = InitIPC();
} else if (mode == LINK_CABLE_SOCKET) {
for(i=0;i<4;i++)
linkdata[i] = 0xffff;
}
// No errors, save the link mode
if (initOk) {
gba_link_mode = mode;
} else {
gba_link_mode = LINK_DISCONNECTED;
}
return initOk;
}
static void ReInitLink()
{
int f = linkmem->linkflags;