mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
win32: Some more work on real wiimote automatic ingame pairup (automatic paired up wiimotes get connected now ingame as well, but it's not completely working yet, we're almost there tho:P) and changed the automatic unpair real wiimotes routine, so it won't get loaded via dll_detach anymore.
minor code changes and adding comments. And issue fix 2792 with credits to Karloathian for finding and fixing it. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5750 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -32,6 +32,8 @@ PluginWiimote::PluginWiimote(const char *_Filename)
|
||||
(LoadSymbol("Wiimote_Update"));
|
||||
Wiimote_GetAttachedControllers = reinterpret_cast<TWiimote_GetAttachedControllers>
|
||||
(LoadSymbol("Wiimote_GetAttachedControllers"));
|
||||
Wiimote_UnPairWiimotes = reinterpret_cast<TWiimote_UnPairWiimotes>
|
||||
(LoadSymbol("Wiimote_UnPairWiimotes"));
|
||||
|
||||
if ((Wiimote_ControlChannel != 0) &&
|
||||
(Wiimote_Input != 0) &&
|
||||
|
@ -28,6 +28,7 @@ typedef void (__cdecl* TWiimote_Update)(int _number);
|
||||
typedef void (__cdecl* TWiimote_Input)(u16 _Key, u8 _UpDown);
|
||||
typedef void (__cdecl* TWiimote_ControlChannel)(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
typedef void (__cdecl* TWiimote_InterruptChannel)(int _number, u16 _channelID, const void* _pData, u32 _Size);
|
||||
typedef unsigned int (__cdecl* TWiimote_UnPairWiimotes)();
|
||||
typedef unsigned int (__cdecl* TWiimote_GetAttachedControllers)();
|
||||
|
||||
class PluginWiimote : public CPlugin {
|
||||
@ -40,6 +41,7 @@ public:
|
||||
TWiimote_Input Wiimote_Input;
|
||||
TWiimote_InterruptChannel Wiimote_InterruptChannel;
|
||||
TWiimote_Update Wiimote_Update;
|
||||
TWiimote_UnPairWiimotes Wiimote_UnPairWiimotes;
|
||||
TWiimote_GetAttachedControllers Wiimote_GetAttachedControllers;
|
||||
|
||||
private:
|
||||
|
@ -310,4 +310,7 @@ void SConfig::LoadSettingsWii()
|
||||
sprintf(SectionName, "Wiimote%i", i + 1);
|
||||
ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
|
||||
}
|
||||
ini.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "wiimote.ini").c_str());
|
||||
ini.Get("Real", "Unpair", &m_WiiAutoUnpair, false);
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ struct SConfig
|
||||
bool m_WiiSDCard;
|
||||
bool m_WiiKeyboard;
|
||||
bool m_WiiAutoReconnect[4];
|
||||
bool m_WiiAutoUnpair;
|
||||
|
||||
// hard coded default plugins ...
|
||||
std::string m_DefaultGFXPlugin;
|
||||
|
@ -280,8 +280,17 @@ void CWII_IPC_HLE_WiiMote::ExecuteL2capCmd(u8* _pData, u32 _Size)
|
||||
break;
|
||||
|
||||
case HID_INTERRUPT_CHANNEL:
|
||||
if (number < 4)
|
||||
mote->Wiimote_InterruptChannel(number, pHeader->CID, pData, DataSize);
|
||||
{
|
||||
if (number < 4)
|
||||
{
|
||||
DEBUG_LOG(WIIMOTE, "Wiimote_InterruptChannel");
|
||||
DEBUG_LOG(WIIMOTE, " Channel ID: %04x", pHeader->CID);
|
||||
std::string Temp = ArrayToString((const u8*)pData, DataSize);
|
||||
DEBUG_LOG(WIIMOTE, " Data: %s", Temp.c_str());
|
||||
|
||||
mote->Wiimote_InterruptChannel(number, pHeader->CID, pData, DataSize);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -444,6 +444,13 @@ void DolphinApp::OnEndSession()
|
||||
|
||||
int DolphinApp::OnExit()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (SConfig::GetInstance().m_WiiAutoUnpair)
|
||||
{
|
||||
if (CPluginManager::GetInstance().GetWiimote())
|
||||
CPluginManager::GetInstance().GetWiimote()->Wiimote_UnPairWiimotes();
|
||||
}
|
||||
#endif
|
||||
CPluginManager::Shutdown();
|
||||
SConfig::Shutdown();
|
||||
LogManager::Shutdown();
|
||||
|
Reference in New Issue
Block a user