diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index c6c08922e5..48b436b035 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -92,6 +92,11 @@ void SConfig::SaveSettings() ini.Set("GameList", "ListJap", m_ListJap); ini.Set("GameList", "ListPal", m_ListPal); ini.Set("GameList", "ListUsa", m_ListUsa); + ini.Set("GameList", "ListFrance", m_ListFrance); + ini.Set("GameList", "ListItaly", m_ListItaly); + ini.Set("GameList", "ListKorea", m_ListKorea); + ini.Set("GameList", "ListTaiwan", m_ListTaiwan); + ini.Set("GameList", "ListUnknown", m_ListUnknown); // Core ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2); @@ -202,6 +207,12 @@ void SConfig::LoadSettings() ini.Get("GameList", "ListPal", &m_ListPal, true); ini.Get("GameList", "ListUsa", &m_ListUsa, true); + ini.Get("GameList", "ListFrance", &m_ListFrance, true); + ini.Get("GameList", "ListItaly", &m_ListItaly, true); + ini.Get("GameList", "ListKorea", &m_ListKorea, true); + ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true); + ini.Get("GameList", "ListUnknown", &m_ListUnknown, true); + // Core ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, true); ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true); diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h index efa097b2f5..78d0e797ff 100644 --- a/Source/Core/Core/Src/ConfigManager.h +++ b/Source/Core/Core/Src/ConfigManager.h @@ -73,6 +73,7 @@ struct SConfig bool m_InterfaceStatusbar; bool m_InterfaceLogWindow; bool m_InterfaceConsole; + bool m_ListDrives; bool m_ListWad; bool m_ListWii; @@ -80,6 +81,11 @@ struct SConfig bool m_ListPal; bool m_ListUsa; bool m_ListJap; + bool m_ListFrance; + bool m_ListItaly; + bool m_ListKorea; + bool m_ListTaiwan; + bool m_ListUnknown; SysConf* m_SYSCONF; diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp index 104249cbeb..54c681c43a 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp @@ -31,16 +31,20 @@ CBannerLoaderGC::CBannerLoaderGC(DiscIO::IFileSystem& _rFileSystem) { // load the opening.bnr size_t FileSize = (size_t) _rFileSystem.GetFileSize("opening.bnr"); - - if (FileSize > 0) + if (FileSize == sizeof(DVDBanner) || FileSize == sizeof(DVDBanner2)) { m_pBannerFile = new u8[FileSize]; if (m_pBannerFile) { _rFileSystem.ReadFile("opening.bnr", m_pBannerFile, FileSize); - m_IsValid = true; + m_BNRType = getBannerType(); + if (m_BNRType == BANNER_UNKNOWN) + PanicAlert("Invalid opening.bnr found in gcm:\n%s\n You may need to redump this game.", + _rFileSystem.GetVolume()->GetName().c_str()); + else m_IsValid = true; } } + else WARN_LOG(DISCIO, "Invalid opening.bnr size: %0x", FileSize); } @@ -54,15 +58,13 @@ CBannerLoaderGC::~CBannerLoaderGC() } -bool -CBannerLoaderGC::IsValid() +bool CBannerLoaderGC::IsValid() { return m_IsValid; } -bool -CBannerLoaderGC::GetBanner(u32* _pBannerImage) +bool CBannerLoaderGC::GetBanner(u32* _pBannerImage) { if (!IsValid()) { @@ -76,8 +78,7 @@ CBannerLoaderGC::GetBanner(u32* _pBannerImage) } -bool -CBannerLoaderGC::GetName(std::string _rName[]) +bool CBannerLoaderGC::GetName(std::string _rName[]) { bool returnCode = false; @@ -87,7 +88,7 @@ CBannerLoaderGC::GetName(std::string _rName[]) } // find Banner type - switch (getBannerType()) + switch (m_BNRType) { case CBannerLoaderGC::BANNER_BNR1: { @@ -139,8 +140,7 @@ CBannerLoaderGC::GetName(std::string _rName[]) } -bool -CBannerLoaderGC::GetCompany(std::string& _rCompany) +bool CBannerLoaderGC::GetCompany(std::string& _rCompany) { _rCompany = "N/A"; @@ -157,8 +157,7 @@ CBannerLoaderGC::GetCompany(std::string& _rCompany) } -bool -CBannerLoaderGC::GetDescription(std::string* _rDescription) +bool CBannerLoaderGC::GetDescription(std::string* _rDescription) { bool returnCode = false; @@ -168,7 +167,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription) } // find Banner type - switch (getBannerType()) + switch (m_BNRType) { case CBannerLoaderGC::BANNER_BNR1: { @@ -202,8 +201,7 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription) } -void -CBannerLoaderGC::decode5A3image(u32* dst, u16* src, int width, int height) +void CBannerLoaderGC::decode5A3image(u32* dst, u16* src, int width, int height) { for (int y = 0; y < height; y += 4) { diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.h b/Source/Core/DiscIO/Src/BannerLoaderGC.h index bc9c1249f1..0527c721c1 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.h +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.h @@ -80,6 +80,7 @@ class CBannerLoaderGC u8* m_pBannerFile; bool m_IsValid; + BANNER_TYPE m_BNRType; void decode5A3image(u32* dst, u16* src, int width, int height); BANNER_TYPE getBannerType(); diff --git a/Source/Core/DiscIO/Src/FileMonitor.cpp b/Source/Core/DiscIO/Src/FileMonitor.cpp index 5bf60e53cf..0a68d71ffc 100644 --- a/Source/Core/DiscIO/Src/FileMonitor.cpp +++ b/Source/Core/DiscIO/Src/FileMonitor.cpp @@ -83,6 +83,7 @@ void ReadGC(std::string FileName) if (!DiscIO::IsVolumeWiiDisc(OpenISO) && !DiscIO::IsVolumeWadFile(OpenISO)) { pFileSystem = DiscIO::CreateFileSystem(OpenISO); + if(!pFileSystem) return; pFileSystem->GetFileList(GCFiles); } FileAccess = true; diff --git a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp index 0a8314c959..12b5cfc21d 100644 --- a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp +++ b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp @@ -83,6 +83,8 @@ u64 CFileSystemGCWii::ReadFile(const char* _rFullPath, u8* _pBuffer, size_t _Max if (pFileInfo->m_FileSize > _MaxBufferSize) return 0; + DEBUG_LOG(DISCIO, "Filename: %s. Offset: %0x. Size: %0x",_rFullPath, pFileInfo->m_Offset, pFileInfo->m_FileSize); + m_rVolume->Read(pFileInfo->m_Offset, pFileInfo->m_FileSize, _pBuffer); return pFileInfo->m_FileSize; } diff --git a/Source/Core/DiscIO/Src/VolumeCreator.cpp b/Source/Core/DiscIO/Src/VolumeCreator.cpp index 7d877d0c13..60a277356a 100644 --- a/Source/Core/DiscIO/Src/VolumeCreator.cpp +++ b/Source/Core/DiscIO/Src/VolumeCreator.cpp @@ -28,6 +28,7 @@ #include "VolumeWad.h" #include "Hash.h" +#include "StringUtil.h" namespace DiscIO { @@ -103,6 +104,11 @@ IVolume* CreateVolumeFromFilename(const std::string& _rFilename, u32 _PartitionG case DISC_TYPE_UNK: default: + std::string Filename, ext; + SplitPath(_rFilename, NULL, &Filename, &ext); + Filename += ext; + NOTICE_LOG(DISCIO, "%s does not have the Magic word for a gcm, wiidisc or wad file\n" + "Set Log Verbosity to Warning and attempt to load the game again to view the values", Filename.c_str()); delete pReader; return NULL; } @@ -220,6 +226,7 @@ EDiscType GetDiscType(IBlobReader& _rReader) else return(DISC_TYPE_WII_CONTAINER); } + WARN_LOG(DISCIO, "Wiidisc magicword not found.\n Offset: 0x18 value: %04x", MagicWord); } // check for WAD @@ -229,6 +236,7 @@ EDiscType GetDiscType(IBlobReader& _rReader) // 0x206962 for boot2 wads if (MagicWord == 0x00204973 || MagicWord == 0x00206962) return(DISC_TYPE_WAD); + WARN_LOG(DISCIO, "Wad magicword not found.\n Offset: 0x02 value: %04x", MagicWord); } // check for GC @@ -237,6 +245,7 @@ EDiscType GetDiscType(IBlobReader& _rReader) if (MagicWord == 0xC2339F3D) return(DISC_TYPE_GC); + WARN_LOG(DISCIO, "GCM magicword not found.\n Offset: 0x1C value: %04x", MagicWord); } return DISC_TYPE_UNK; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 37b75ac0ae..18bcfe5386 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -252,13 +252,6 @@ EVT_MENU(IDM_TOGGLE_STATUSBAR, CFrame::OnToggleStatusbar) EVT_MENU(IDM_LOGWINDOW, CFrame::OnToggleLogWindow) EVT_MENU(IDM_CONSOLEWINDOW, CFrame::OnToggleConsole) -EVT_MENU(IDM_LISTDRIVES, CFrame::GameListChanged) -EVT_MENU(IDM_LISTWII, CFrame::GameListChanged) -EVT_MENU(IDM_LISTGC, CFrame::GameListChanged) -EVT_MENU(IDM_LISTWAD, CFrame::GameListChanged) -EVT_MENU(IDM_LISTJAP, CFrame::GameListChanged) -EVT_MENU(IDM_LISTPAL, CFrame::GameListChanged) -EVT_MENU(IDM_LISTUSA, CFrame::GameListChanged) EVT_MENU(IDM_PURGECACHE, CFrame::GameListChanged) EVT_MENU(IDM_LOADLASTSTATE, CFrame::OnLoadLastState) @@ -272,6 +265,7 @@ EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT8, CFrame::OnSaveState) EVT_MENU_RANGE(IDM_FRAMESKIP0, IDM_FRAMESKIP9, CFrame::OnFrameSkip) EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive) EVT_MENU_RANGE(IDM_CONNECT_WIIMOTE1, IDM_CONNECT_WIIMOTE4, CFrame::OnConnectWiimote) +EVT_MENU_RANGE(IDM_LISTWAD, IDM_LISTDRIVES, CFrame::GameListChanged) // Other EVT_ACTIVATE(CFrame::OnActive) @@ -659,11 +653,19 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) SConfig::GetInstance().m_ListWad) && (SConfig::GetInstance().m_ListJap && SConfig::GetInstance().m_ListUsa && - SConfig::GetInstance().m_ListPal))) + SConfig::GetInstance().m_ListPal && + SConfig::GetInstance().m_ListFrance && + SConfig::GetInstance().m_ListItaly && + SConfig::GetInstance().m_ListKorea && + SConfig::GetInstance().m_ListTaiwan && + SConfig::GetInstance().m_ListUnknown))) { - SConfig::GetInstance().m_ListGC = SConfig::GetInstance().m_ListWii = - SConfig::GetInstance().m_ListWad = SConfig::GetInstance().m_ListJap = - SConfig::GetInstance().m_ListUsa = SConfig::GetInstance().m_ListPal = true; + SConfig::GetInstance().m_ListGC = SConfig::GetInstance().m_ListWii = + SConfig::GetInstance().m_ListWad = SConfig::GetInstance().m_ListJap = + SConfig::GetInstance().m_ListUsa = SConfig::GetInstance().m_ListPal = + SConfig::GetInstance().m_ListFrance = SConfig::GetInstance().m_ListItaly = + SConfig::GetInstance().m_ListKorea = SConfig::GetInstance().m_ListTaiwan = + SConfig::GetInstance().m_ListUnknown= true; GetMenuBar()->FindItem(IDM_LISTGC)->Check(true); GetMenuBar()->FindItem(IDM_LISTWII)->Check(true); @@ -671,6 +673,11 @@ void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) GetMenuBar()->FindItem(IDM_LISTJAP)->Check(true); GetMenuBar()->FindItem(IDM_LISTUSA)->Check(true); GetMenuBar()->FindItem(IDM_LISTPAL)->Check(true); + GetMenuBar()->FindItem(IDM_LISTFRANCE)->Check(true); + GetMenuBar()->FindItem(IDM_LISTITALY)->Check(true); + GetMenuBar()->FindItem(IDM_LISTKOREA)->Check(true); + GetMenuBar()->FindItem(IDM_LISTTAIWAN)->Check(true); + GetMenuBar()->FindItem(IDM_LIST_UNK)->Check(true); m_GameListCtrl->Update(); } diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 8b8df0e72f..f2f332e174 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -243,10 +243,19 @@ void CFrame::CreateMenu() regionMenu->Check(IDM_LISTPAL, SConfig::GetInstance().m_ListPal); regionMenu->AppendCheckItem(IDM_LISTUSA, _T("Show USA")); regionMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa); - + regionMenu->AppendSeparator(); + regionMenu->AppendCheckItem(IDM_LISTFRANCE, _T("Show France")); + regionMenu->Check(IDM_LISTFRANCE, SConfig::GetInstance().m_ListFrance); + regionMenu->AppendCheckItem(IDM_LISTITALY, _T("Show Italy")); + regionMenu->Check(IDM_LISTITALY, SConfig::GetInstance().m_ListItaly); + regionMenu->AppendCheckItem(IDM_LISTKOREA, _T("Show Korea")); + regionMenu->Check(IDM_LISTKOREA, SConfig::GetInstance().m_ListKorea); + regionMenu->AppendCheckItem(IDM_LISTTAIWAN, _T("Show Taiwan")); + regionMenu->Check(IDM_LISTTAIWAN, SConfig::GetInstance().m_ListTaiwan); + regionMenu->AppendCheckItem(IDM_LIST_UNK, _T("Show unknown")); + regionMenu->Check(IDM_LIST_UNK, SConfig::GetInstance().m_ListUnknown); viewMenu->AppendCheckItem(IDM_LISTDRIVES, _T("Show Drives")); viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives); - viewMenu->AppendSeparator(); viewMenu->Append(IDM_PURGECACHE, _T("Purge Cache")); m_MenuBar->Append(viewMenu, _T("&View")); @@ -1066,6 +1075,21 @@ void CFrame::GameListChanged(wxCommandEvent& event) case IDM_LISTUSA: SConfig::GetInstance().m_ListUsa = event.IsChecked(); break; + case IDM_LISTFRANCE: + SConfig::GetInstance().m_ListFrance = event.IsChecked(); + break; + case IDM_LISTITALY: + SConfig::GetInstance().m_ListItaly = event.IsChecked(); + break; + case IDM_LISTKOREA: + SConfig::GetInstance().m_ListKorea = event.IsChecked(); + break; + case IDM_LISTTAIWAN: + SConfig::GetInstance().m_ListTaiwan = event.IsChecked(); + break; + case IDM_LIST_UNK: + SConfig::GetInstance().m_ListUnknown = event.IsChecked(); + break; case IDM_LISTDRIVES: SConfig::GetInstance().m_ListDrives = event.IsChecked(); break; diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 8f107b25aa..95322c6b2a 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -106,6 +106,11 @@ enum IDM_LISTJAP, IDM_LISTPAL, IDM_LISTUSA, + IDM_LISTFRANCE, + IDM_LISTITALY, + IDM_LISTKOREA, + IDM_LISTTAIWAN, + IDM_LIST_UNK, IDM_LISTDRIVES, IDM_PURGECACHE, diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index 86331c7a14..6535c37688 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -98,7 +98,8 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW { GCFiles.clear(); pFileSystem = DiscIO::CreateFileSystem(OpenISO); - pFileSystem->GetFileList(GCFiles); + if (pFileSystem) + pFileSystem->GetFileList(GCFiles); } } @@ -193,7 +194,8 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW // TODO : Should we add a way to browse the wad file ? if (!DiscIO::IsVolumeWadFile(OpenISO)) { - CreateDirectoryTree(RootId, GCFiles, 1, GCFiles.at(0)->m_FileSize); + if (!GCFiles.empty()) + CreateDirectoryTree(RootId, GCFiles, 1, GCFiles.at(0)->m_FileSize); } } m_Treectrl->Expand(RootId); @@ -212,7 +214,8 @@ CISOProperties::~CISOProperties() } else if (!IsVolumeWadFile(OpenISO)) - delete pFileSystem; + if(pFileSystem) + delete pFileSystem; delete OpenISO; } @@ -672,9 +675,9 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde // Extraction for (u32 i = index[0]; i < index[1]; i++) { - dialog.SetTitle(wxString::Format(_T("%s : %d%%"), (const char *)dialogTitle.mb_str(), + dialog.SetTitle(wxString::Format(_T("%s : %d%%"), dialogTitle.c_str(), (u32)(((float)(i - index[0]) / (float)(index[1] - index[0])) * 100))); - if (!dialog.Update(i, wxString::Format(_T("Extracting %s"), fst[i]->m_FullPath))) + if (!dialog.Update(i, wxString::Format(_T("Extracting %s"), wxString(fst[i]->m_FullPath, *wxConvCurrent).c_str()))) break; if (fst[i]->IsDirectory()) diff --git a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp index 819b1261e1..f54a1c6a8e 100644 --- a/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp +++ b/Source/Core/DolphinWX/Src/MemoryCards/WiiSaveCrypted.cpp @@ -114,7 +114,7 @@ void CWiiSaveCrypted::Extract() sprintf(dir, FULL_WII_USER_DIR "title/%08x/%08x/data/", (u32)(_saveGameTitle>>32), (u32)_saveGameTitle); - if (!PanicYesNo("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", dir)) + if (!AskYesNo("Warning! it is advised to backup all files in the folder:\n%s\nDo you wish to continue?", dir)) return; INFO_LOG(CONSOLE, "%s", dir); @@ -141,7 +141,7 @@ void CWiiSaveCrypted::Extract() File::Copy(path, tmpPath); // - if (!File::Exists(path) || PanicYesNo("%s already exists, overwrite?", path)) + if (!File::Exists(path) || AskYesNo("%s already exists, overwrite?", path)) { INFO_LOG(CONSOLE, "creating file %s", path); outFileP = fopen(path, "wb"); @@ -199,7 +199,7 @@ void CWiiSaveCrypted::Extract() sprintf(tmpPath, "%s.bak", path); File::Copy(path, tmpPath); // - if (!File::Exists(path) || PanicYesNo("%s already exists, overwrite?", path)) + if (!File::Exists(path) || AskYesNo("%s already exists, overwrite?", path)) { INFO_LOG(CONSOLE, "creating file %s", path);