From 175162e66170c0b66e152ddae7f8738facbe2f16 Mon Sep 17 00:00:00 2001 From: fgfemperor Date: Sat, 9 Jan 2010 22:03:20 +0000 Subject: [PATCH] Fixed Issue 1979 - Crash when scanning WAD files with no title information... Removed the panic alert about HCI_CMD_INQUIRY because it doesn't crash Dolphin or anything like that... It's called from MiiChannel, when you try to upload your Miis to a WiiMote. And it works just fine! (except for the warning "Can't find Wiimote by bd: xx:xx:xx:xx:xx:xx", which is really odd)... git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4800 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 3 ++- Source/Core/DiscIO/Src/VolumeGC.cpp | 4 ++-- Source/Core/DiscIO/Src/VolumeWad.cpp | 4 ++-- Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp | 4 ++-- Source/Core/DolphinWX/Src/ISOFile.cpp | 7 ++++++- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index 7b3197ddc8..049fd23819 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -1342,7 +1342,8 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::ExecuteHCICommandMessage(const SHCICom void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input) { // Inquiry should not be called normally - PanicAlert("HCI_CMD_INQUIRY is called, please report!"); + // FGFEmperor: It's called from the MiiChannel, when you try to upload your Miis to the WiiMote... And nothing bad happens after that... + // PanicAlert("HCI_CMD_INQUIRY is called, please report!"); if (SendEventCommandStatus(HCI_CMD_INQUIRY)) return; diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 13c2ebbb07..d4bb82506f 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -91,11 +91,11 @@ std::string CVolumeGC::GetMakerID() const std::string CVolumeGC::GetName() const { if (m_pReader == NULL) - return false; + return ""; char name[128]; if (!Read(0x20, 0x60, (u8*)&name)) - return false; + return ""; return name; } diff --git a/Source/Core/DiscIO/Src/VolumeWad.cpp b/Source/Core/DiscIO/Src/VolumeWad.cpp index cae2fbfb6d..26e645693a 100644 --- a/Source/Core/DiscIO/Src/VolumeWad.cpp +++ b/Source/Core/DiscIO/Src/VolumeWad.cpp @@ -110,12 +110,12 @@ std::string CVolumeWAD::GetName() const u32 footer_size; if (!Read(0x1C, 4, (u8*)&footer_size)) - return false; + return ""; // Offset to the english title char temp[84]; if (!Read(0xF1 + OpeningBnrOffset, 84, (u8*)&temp) || Common::swap32(footer_size) < 0xF1) - return false; + return ""; // Remove the null bytes due to 16bit char length std::string out_temp; diff --git a/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp index 967ae26624..fc7d57e565 100644 --- a/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp @@ -152,14 +152,14 @@ std::string CVolumeWiiCrypted::GetName() const { if (m_pReader == NULL) { - return(false); + return(""); } char name[0xFF]; if (!Read(0x20, 0x60, (u8*)&name)) { - return(false); + return(""); } return(name); diff --git a/Source/Core/DolphinWX/Src/ISOFile.cpp b/Source/Core/DolphinWX/Src/ISOFile.cpp index 2e92ea40b3..a27142a4e6 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.cpp +++ b/Source/Core/DolphinWX/Src/ISOFile.cpp @@ -66,8 +66,13 @@ GameListItem::GameListItem(const std::string& _rFileName) m_Company = "N/A"; for (int i = 0; i < 6; i++) { - m_Name[i] = _rFileName; // Give an init value m_Name[i] = pVolume->GetName(); + if(m_Name[i] == "") // Couldn't find the name in the WAD... + { + std::string FileName; + SplitPath(_rFileName, NULL, &FileName, NULL); + m_Name[i] = FileName; // Then just display the filename... Better than something like "No Name" + } m_Description[i] = "No Description"; } m_Country = pVolume->GetCountry();