Made wiimotes automatically connect on start based on their selected "Input Source" in the wiimote configuration.(fixes issue 2261) Made wiimotes 2-4 input source default to "None".

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6679 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak 2010-12-28 22:14:15 +00:00
parent 6cc1468292
commit 0059b0f44f
3 changed files with 12 additions and 3 deletions

View File

@ -53,6 +53,8 @@
#include "HW/VideoInterface.h"
#include "HW/SystemTimers.h"
#include "IPC_HLE/WII_IPC_HLE_Device_usb.h"
#include "PowerPC/PowerPC.h"
#include "PowerPC/JitCommon/JitBase.h"
@ -390,8 +392,15 @@ THREAD_RETURN EmuThread(void *pArg)
// Load and Init Wiimotes - only if we are booting in wii mode
if (_CoreParameter.bWii)
{
Wiimote::Initialize(g_pWindowHandle);
// activate wiimotes which don't have source set to "None"
for (unsigned int i = 0; i != MAX_WIIMOTES; ++i)
if (g_wiimote_sources[i])
GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(true);
}
// The hardware is initialized.
g_bHwInit = true;

View File

@ -266,7 +266,7 @@ void LoadSettings()
secname += (char)('1' + i);
IniFile::Section& sec = *inifile.GetOrCreateSection(secname.c_str());
sec.Get("Source", &g_wiimote_sources[i], WIIMOTE_SRC_EMU);
sec.Get("Source", &g_wiimote_sources[i], i ? WIIMOTE_SRC_NONE : WIIMOTE_SRC_EMU);
}
}

View File

@ -57,7 +57,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
tmpBD.b[0] = BT_DINF[6 + (i * WIIMOTESIZE)];
INFO_LOG(WII_IPC_WIIMOTE, "Wiimote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], tmpBD.b[2], tmpBD.b[3], tmpBD.b[4], tmpBD.b[5]);
m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, !i));
m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, false));
i++;
}
while (i < 4)
@ -73,7 +73,7 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De
memcpy((BT_DINF+7 + (i * WIIMOTESIZE)), wmName, 20);
INFO_LOG(WII_IPC_WIIMOTE, "Adding to SYSConf Wiimote %d BT ID %x,%x,%x,%x,%x,%x", i, tmpBD.b[0], tmpBD.b[1], tmpBD.b[2], tmpBD.b[3], tmpBD.b[4], tmpBD.b[5]);
m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, !i));
m_WiiMotes.push_back(CWII_IPC_HLE_WiiMote(this, i, tmpBD, false));
i++;
}
if (BT_DINF[0] != maxWM)