diff --git a/Source/MusicMod.sln b/Source/MusicMod.sln index 5db2e937be..7de1c440d6 100644 --- a/Source/MusicMod.sln +++ b/Source/MusicMod.sln @@ -56,7 +56,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DolphinWX", "Core\DolphinWX\DolphinWX.vcproj", "{A72606EF-C5C1-4954-90AD-F0F93A8D97D9}" ProjectSection(ProjectDependencies) = postProject {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} - {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} = {CFDCEE0E-FA45-4F72-9FCC-0B88F5A75160} {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0} {8D612734-FAA5-4B8A-804F-4DEA2367D495} = {8D612734-FAA5-4B8A-804F-4DEA2367D495} {71B16F46-0B00-4EDA-B253-D6D9D03A215C} = {71B16F46-0B00-4EDA-B253-D6D9D03A215C} diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp index a33d64fbc9..7b03c21383 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuSubroutines.cpp @@ -531,7 +531,7 @@ void WmWriteData(u16 _channelID, wm_write_data* wd) } // =================================================== -/* Here we produce a status report to send to the Wii. We currently ignore the status +/* Here we produce a 0x20 status report to send to the Wii. We currently ignore the status request rs and all its eventual instructions it may include (for example turn off rumble or something else) and just send the status report. */ // ---------------- diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp index f06916a2e2..6d2057b645 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/Config.cpp @@ -96,6 +96,9 @@ void DEBUG_QUIT() // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ void Config::Save(int Slot) { + // If there are no good pads don't save + if (NumGoodPads == 0) return; + // Load ini file IniFile file; file.Load("nJoy.ini"); @@ -180,6 +183,9 @@ void Config::Save(int Slot) // ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ void Config::Load(bool ChangePad, bool ChangeSaveByID) { + // If there are no good pads don't load + if (NumGoodPads == 0) return; + // Load file IniFile file; file.Load("nJoy.ini"); diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index 09ad173e4f..b1a2d48e53 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -372,17 +372,22 @@ void ConfigBox::SetButtonTextAll(int id, char text[128]) { for (int i = 0; i < 4; i++) { - if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[notebookpage].ID].Name) - SetButtonText(id, text, i); + // Safety check to avoid crash + if(joyinfo.size() > PadMapping[i].ID) + if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[notebookpage].ID].Name) + SetButtonText(id, text, i); }; } void ConfigBox::SaveButtonMappingAll(int Slot) { for (int i = 0; i < 4; i++) - if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name) - SaveButtonMapping(i, false, Slot); - + { + // This can occur when no gamepad is detected + if(joyinfo.size() > PadMapping[i].ID) + if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name) + SaveButtonMapping(i, false, Slot); + } } void ConfigBox::UpdateGUIAll(int Slot) @@ -394,8 +399,12 @@ void ConfigBox::UpdateGUIAll(int Slot) else { for (int i = 0; i < 4; i++) - if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name) - UpdateGUI(i); + { + // Safety check to avoid crash + if(joyinfo.size() > PadMapping[i].ID) + if (joyinfo[PadMapping[i].ID].Name == joyinfo[PadMapping[Slot].ID].Name) + UpdateGUI(i); + } } } @@ -455,6 +464,13 @@ void ConfigBox::ChangeSettings( wxCommandEvent& event ) // Called from: CreateGUIControls(), ChangeControllertype() void ConfigBox::UpdateGUI(int _notebookpage) { + // If there are no good pads disable the entire notebook + if (NumGoodPads == 0) + { + m_Notebook->Enable(false); + return; + } + // Update the GUI from PadMapping[] UpdateGUIKeys(_notebookpage); @@ -596,7 +612,7 @@ void ConfigBox::CreateGUIControls() } else { - arrayStringFor_Joyname.Add(wxString::FromAscii("No Joystick detected!")); + arrayStringFor_Joyname.Add(wxString::FromAscii("")); } // -------------------------------------------------------------------- diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index 138af96124..4a8c4fc279 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -336,7 +336,7 @@ int Search_Devices() // Warn the user if no gamepads are detected if (NumGoodPads == 0 && emulator_running) { - PanicAlert("No Joystick detected"); + PanicAlert("nJoy: No Gamepad Detected"); return joyinfo.size(); }