summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2008-11-28 21:08:18 +0000
committerJohn Peterson <jpeterson57@gmail.com>2008-11-28 21:08:18 +0000
commit6a74afd02db877232e8f0e8d7c2623ac492a7d0a (patch)
tree5cd56ceca9eb2f2f1f66ccb2064efbfb687914e7 /Source
parent4ff865198d354f9484b47beba564a061af038808 (diff)
Don't allow two extensions at the same time
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1323 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
-rw-r--r--Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.cpp
index 6e6ad19e17..a169b0896c 100644
--- a/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.cpp
+++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigDlg.cpp
@@ -121,15 +121,24 @@ void ConfigDialog::AboutClick(wxCommandEvent& WXUNUSED (event))
}
+
+// ===================================================
+/* Generate connect/disconnect status event */
+// ----------------
void ConfigDialog::DoExtensionConnectedDisconnected()
{
- // generate connect/disconnect status event
u8 DataFrame[8]; // make a blank report for it
wm_request_status *rs = (wm_request_status*)DataFrame;
+
+ // Check if a game is running, in that case change the status
if(WiiMoteEmu::g_ReportingChannel > 0)
WiiMoteEmu::WmRequestStatus(WiiMoteEmu::g_ReportingChannel, rs);
}
+
+// ===================================================
+/* Change general Emulated Wii Remote settings */
+// ----------------
void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
{
switch (event.GetId())
@@ -143,8 +152,18 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
break;
case ID_NUNCHUCKCONNECTED:
+ // Don't allow two extensions at the same time
+ if(m_ClassicControllerConnected->IsChecked())
+ {
+ m_ClassicControllerConnected->SetValue(false);
+ g_Config.bClassicControllerConnected = false;
+ // Disconnect the extension so that the game recognize the change
+ DoExtensionConnectedDisconnected();
+ }
+
g_Config.bNunchuckConnected = m_NunchuckConnected->IsChecked();
- // generate connect/disconnect status event
+
+ // Generate connect/disconnect status event
memcpy(WiiMoteEmu::g_RegExt + 0x20, WiiMoteEmu::nunchuck_calibration,
sizeof(WiiMoteEmu::nunchuck_calibration));
memcpy(WiiMoteEmu::g_RegExt + 0xfa, WiiMoteEmu::nunchuck_id, sizeof(WiiMoteEmu::nunchuck_id));
@@ -152,8 +171,18 @@ void ConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
break;
case ID_CLASSICCONTROLLERCONNECTED:
+ // Don't allow two extensions at the same time
+ if(m_NunchuckConnected->IsChecked())
+ {
+ m_NunchuckConnected->SetValue(false);
+ g_Config.bNunchuckConnected = false;
+ // Disconnect the extension so that the game recognize the change
+ DoExtensionConnectedDisconnected();
+ }
+
g_Config.bClassicControllerConnected = m_ClassicControllerConnected->IsChecked();
- // generate connect/disconnect status event
+
+ // Generate connect/disconnect status event
memcpy(WiiMoteEmu::g_RegExt + 0x20, WiiMoteEmu::classic_calibration,
sizeof(WiiMoteEmu::classic_calibration));
memcpy(WiiMoteEmu::g_RegExt + 0xfa, WiiMoteEmu::classic_id, sizeof(WiiMoteEmu::classic_id));