diff --git a/Externals/Memcard Manager/src/MCMdebug.cpp b/Externals/Memcard Manager/src/MCMdebug.cpp index ef5f32b96b..7129dbc4c8 100644 --- a/Externals/Memcard Manager/src/MCMdebug.cpp +++ b/Externals/Memcard Manager/src/MCMdebug.cpp @@ -171,7 +171,7 @@ void CMemcardManagerDebug::updateHDRtab(int card) memoryCard[card]->hdr.serial[10],memoryCard[card]->hdr.serial[11]); wx_fmtTime.Printf(wxT("%08X, %08X"), - memoryCard[card]->hdr.fmtTime.high,memoryCard[card]->hdr.fmtTime.low); + Common::swap32(memoryCard[card]->hdr.fmtTime.high),Common::swap32(memoryCard[card]->hdr.fmtTime.low)); wx_SRAMBIAS.Printf(wxT("%02X, %02X, %02X, %02X"), memoryCard[card]->hdr.SramBias[0],memoryCard[card]->hdr.SramBias[1], diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index 8929ca2f29..07650541e1 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -83,6 +83,14 @@ void SConfig::SaveSettings() ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow); ini.Set("Interface", "ShowConsole", m_InterfaceConsole); + // Game List Control + ini.Set("GameList", "ListDrives", m_ListDrives); + ini.Set("GameList", "ListWii", m_ListWii); + ini.Set("GameList", "ListGC", m_ListGC); + ini.Set("GameList", "ListJap", m_ListJap); + ini.Set("GameList", "ListPal", m_ListPal); + ini.Set("GameList", "ListUsa", m_ListUsa); + // Core ini.Set("Core", "HLEBios", m_LocalCoreStartupParameter.bHLEBios); ini.Set("Core", "UseDynarec", m_LocalCoreStartupParameter.bUseJIT); @@ -188,6 +196,14 @@ void SConfig::LoadSettings() ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false); ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false); + // Game List Control + ini.Get("GameList", "ListDrives", &m_ListDrives, false); + ini.Get("GameList", "ListWii", &m_ListWii, true); + ini.Get("GameList", "ListGC", &m_ListGC, true); + ini.Get("GameList", "ListJap", &m_ListJap, true); + ini.Get("GameList", "ListPal", &m_ListPal, true); + ini.Get("GameList", "ListUsa", &m_ListUsa, true); + // Core ini.Get("Core", "HLEBios", &m_LocalCoreStartupParameter.bHLEBios, true); ini.Get("Core", "UseDynarec", &m_LocalCoreStartupParameter.bUseJIT, true); @@ -231,3 +247,4 @@ void SConfig::LoadSettings() ini.Get("Core", "WiiMote1Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str()); } } + diff --git a/Source/Core/Core/Src/ConfigManager.h b/Source/Core/Core/Src/ConfigManager.h index fcf3ed0aca..9e6608a298 100644 --- a/Source/Core/Core/Src/ConfigManager.h +++ b/Source/Core/Core/Src/ConfigManager.h @@ -67,6 +67,12 @@ struct SConfig bool m_InterfaceStatusbar; bool m_InterfaceLogWindow; bool m_InterfaceConsole; + bool m_ListDrives; + bool m_ListWii; + bool m_ListGC; + bool m_ListPal; + bool m_ListUsa; + bool m_ListJap; // save settings void SaveSettings(); @@ -91,3 +97,4 @@ struct SConfig }; #endif // endif config manager + diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp index 8b2cab205e..99404c34e5 100644 --- a/Source/Core/Core/Src/HW/DVDInterface.cpp +++ b/Source/Core/Core/Src/HW/DVDInterface.cpp @@ -539,6 +539,9 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg) // REQUEST ERROR (Immediate) // Command/Subcommand/Padding <- E0000000 //========================================================================================================= + case 0xD9: + INFO_LOG(DVDINTERFACE, "DVD: command 0xD9, called by gcos multigame discs\n Report if you are running anything else"); + break; case 0xE0: ERROR_LOG(DVDINTERFACE, "Requesting error"); dvdMem.Immediate = g_ErrorCode; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index bec7b524a8..55a5cb0184 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -275,6 +275,13 @@ EVT_MENU(IDM_TOGGLE_STATUSBAR, CFrame::OnToggleStatusbar) EVT_MENU(IDM_TOGGLE_LOGWINDOW, CFrame::OnToggleLogWindow) EVT_MENU(IDM_TOGGLE_CONSOLE, CFrame::OnToggleConsole) +EVT_MENU(IDM_LISTDRIVES, CFrame::GameListChanged) +EVT_MENU(IDM_LISTWII, CFrame::GameListChanged) +EVT_MENU(IDM_LISTGC, CFrame::GameListChanged) +EVT_MENU(IDM_LISTJAP, CFrame::GameListChanged) +EVT_MENU(IDM_LISTPAL, CFrame::GameListChanged) +EVT_MENU(IDM_LISTUSA, CFrame::GameListChanged) + EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT10, CFrame::OnLoadState) EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT10, CFrame::OnSaveState) EVT_MENU_RANGE(IDM_DRIVE1, IDM_DRIVE24, CFrame::OnBootDrive) @@ -673,4 +680,4 @@ void CFrame::Update() } } #endif -////////////////////////////////////////// + diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index aa0a524b43..b5d1f9f912 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -218,7 +218,8 @@ class CFrame : public wxFrame void OnShow_CheatsWindow(wxCommandEvent& event); void OnShow_InfoWindow(wxCommandEvent& event); - void OnLoadWiiMenu(wxCommandEvent& event); + void OnLoadWiiMenu(wxCommandEvent& event); + void GameListChanged(wxCommandEvent& event); void OnGameListCtrl_ItemActivated(wxListEvent& event); @@ -248,3 +249,4 @@ class CFrame : public wxFrame //////////////////////////////// #endif // __FRAME_H_ + diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 632fee18bd..9d101deb1c 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -155,27 +155,45 @@ void CFrame::CreateMenu() // Tools menu wxMenu* toolsMenu = new wxMenu; - toolsMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("Show &Toolbar")); - toolsMenu->Check(IDM_TOGGLE_TOOLBAR, SConfig::GetInstance().m_InterfaceToolbar); - toolsMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _T("Show &Statusbar")); - toolsMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar); - toolsMenu->AppendCheckItem(IDM_TOGGLE_LOGWINDOW, _T("Show &Logwindow")); - toolsMenu->Check(IDM_TOGGLE_LOGWINDOW, m_bLogWindow); - toolsMenu->AppendCheckItem(IDM_TOGGLE_CONSOLE, _T("Show &Console")); - toolsMenu->Check(IDM_TOGGLE_CONSOLE, SConfig::GetInstance().m_InterfaceConsole); - toolsMenu->AppendSeparator(); toolsMenu->Append(IDM_MEMCARD, _T("&Memcard Manager")); toolsMenu->Append(IDM_CHEATS, _T("Action &Replay Manager")); toolsMenu->Append(IDM_INFO, _T("System Information")); // toolsMenu->Append(IDM_SDCARD, _T("Mount &SDCard")); // Disable for now - - if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid()) - { - toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu")); - } + + if (DiscIO::CNANDContentManager::Access().GetNANDLoader(FULL_WII_MENU_DIR).IsValid()) + { + toolsMenu->Append(IDM_LOAD_WII_MENU, _T("Load Wii Menu")); + } menuBar->Append(toolsMenu, _T("&Tools")); + wxMenu* viewMenu = new wxMenu; + viewMenu->AppendCheckItem(IDM_TOGGLE_TOOLBAR, _T("Show &Toolbar")); + viewMenu->Check(IDM_TOGGLE_TOOLBAR, SConfig::GetInstance().m_InterfaceToolbar); + viewMenu->AppendCheckItem(IDM_TOGGLE_STATUSBAR, _T("Show &Statusbar")); + viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar); + viewMenu->AppendCheckItem(IDM_TOGGLE_LOGWINDOW, _T("Show &Logwindow")); + viewMenu->Check(IDM_TOGGLE_LOGWINDOW, m_bLogWindow); + viewMenu->AppendCheckItem(IDM_TOGGLE_CONSOLE, _T("Show &Console")); + viewMenu->Check(IDM_TOGGLE_CONSOLE, SConfig::GetInstance().m_InterfaceConsole); + viewMenu->AppendSeparator(); + + viewMenu->AppendCheckItem(IDM_LISTWII, _T("Show Wii")); + viewMenu->Check(IDM_LISTWII, SConfig::GetInstance().m_ListWii); + viewMenu->AppendCheckItem(IDM_LISTGC, _T("Show GameCube")); + viewMenu->Check(IDM_LISTGC, SConfig::GetInstance().m_ListGC); + viewMenu->AppendCheckItem(IDM_LISTJAP, _T("Show JAP")); + viewMenu->Check(IDM_LISTJAP, SConfig::GetInstance().m_ListJap); + viewMenu->AppendCheckItem(IDM_LISTPAL, _T("Show PAL")); + viewMenu->Check(IDM_LISTPAL, SConfig::GetInstance().m_ListPal); + viewMenu->AppendCheckItem(IDM_LISTUSA, _T("Show USA")); + viewMenu->Check(IDM_LISTUSA, SConfig::GetInstance().m_ListUsa); +#ifdef _WIN32 //TODO test drive loading on linux, I cannot load from drive on my linux system Dolphin just crashes + viewMenu->AppendCheckItem(IDM_LISTDRIVES, _T("Show Drives")); + viewMenu->Check(IDM_LISTDRIVES, SConfig::GetInstance().m_ListDrives); +#endif + menuBar->Append(viewMenu, _T("&View")); + // Help menu wxMenu* helpMenu = new wxMenu; /*helpMenu->Append(wxID_HELP, _T("&Help")); @@ -881,4 +899,33 @@ void CFrame::UpdateGUI() FitInside(); } +void CFrame::GameListChanged(wxCommandEvent& event) +{ + switch (event.GetId()) + { + case IDM_LISTWII: + SConfig::GetInstance().m_ListWii = event.IsChecked(); + break; + case IDM_LISTGC: + SConfig::GetInstance().m_ListGC = event.IsChecked(); + break; + case IDM_LISTJAP: + SConfig::GetInstance().m_ListJap = event.IsChecked(); + break; + case IDM_LISTPAL: + SConfig::GetInstance().m_ListPal = event.IsChecked(); + break; + case IDM_LISTUSA: + SConfig::GetInstance().m_ListUsa = event.IsChecked(); + break; + case IDM_LISTDRIVES: + SConfig::GetInstance().m_ListDrives = event.IsChecked(); + break; + } + + if (m_GameListCtrl) + { + m_GameListCtrl->Update(); + } +} diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 93401cd486..9daa85280f 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -31,6 +31,7 @@ #include "ISOProperties.h" #include "IniFile.h" #include "FileUtil.h" +#include "CDUtils.h" #if USE_XPM_BITMAPS #include "../resources/Flag_Europe.xpm" @@ -293,7 +294,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index) SetItem(_Index, COLUMN_TITLE, wxString::From8BitData(rISOFile.GetName(0).c_str()), -1); SetItem(_Index, COLUMN_NOTES, wxString::From8BitData(rISOFile.GetDescription(0).c_str()), -1); break; - default: + default: m_gameList.append(std::string(wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()).mb_str()) + " (E)\n"); SetItem(_Index, COLUMN_TITLE, wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1); @@ -462,10 +463,45 @@ void CGameListCtrl::ScanForISOs() GameListItem ISOFile(rFilenames[i]); if (ISOFile.IsValid()) { - m_ISOFiles.push_back(ISOFile); + bool list = true; + + if (!SConfig::GetInstance().m_ListWii && ISOFile.IsWii()) + list = false; + if (!SConfig::GetInstance().m_ListGC && !ISOFile.IsWii()) + list = false; + + switch(ISOFile.GetCountry()) + { + case DiscIO::IVolume::COUNTRY_JAP: + if (!SConfig::GetInstance().m_ListJap) + list = false; + break; + case DiscIO::IVolume::COUNTRY_USA: + if (!SConfig::GetInstance().m_ListUsa) + list = false; + break; + default: + if (!SConfig::GetInstance().m_ListPal) + list = false; + break; + } + + if (list) m_ISOFiles.push_back(ISOFile); } } } + + if (SConfig::GetInstance().m_ListDrives) + { + char **drives = cdio_get_devices(); + GameListItem * Drive[24]; + for (int i = 0; drives[i] != NULL && i < 24; i++) + { + Drive[i] = new GameListItem(drives[i]); + if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]); + } + } + std::sort(m_ISOFiles.begin(), m_ISOFiles.end()); } diff --git a/Source/Core/DolphinWX/Src/Globals.h b/Source/Core/DolphinWX/Src/Globals.h index 8fd73e0c46..2e359524ac 100644 --- a/Source/Core/DolphinWX/Src/Globals.h +++ b/Source/Core/DolphinWX/Src/Globals.h @@ -63,7 +63,14 @@ enum IDM_INFO, IDM_CHANGEDISC, IDM_PROPERTIES, - IDM_LOAD_WII_MENU, + IDM_LOAD_WII_MENU, + + IDM_LISTWII, + IDM_LISTGC, + IDM_LISTJAP, + IDM_LISTPAL, + IDM_LISTUSA, + IDM_LISTDRIVES, IDM_HELPABOUT, // Help menu IDM_HELPWEBSITE, @@ -154,3 +161,4 @@ enum #endif // HAVE_WX #endif // _GLOBALS_H + diff --git a/Source/Core/DolphinWX/Src/ISOFile.cpp b/Source/Core/DolphinWX/Src/ISOFile.cpp index 9ae7dbdb3b..e928d46903 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.cpp +++ b/Source/Core/DolphinWX/Src/ISOFile.cpp @@ -32,7 +32,7 @@ #include "ChunkFile.h" #include "../resources/no_banner.cpp" -#define CACHE_REVISION 0x107 +#define CACHE_REVISION 0x108 #define DVD_BANNER_WIDTH 96 #define DVD_BANNER_HEIGHT 32 @@ -168,6 +168,7 @@ void GameListItem::DoState(PointerWrap &p) p.Do(m_Country); p.Do(m_BlobCompressed); p.DoBuffer(&m_pImage, m_ImageSize); + p.Do(m_IsWii); } std::string GameListItem::CreateCacheFilename() @@ -175,6 +176,7 @@ std::string GameListItem::CreateCacheFilename() std::string Filename; SplitPath(m_FileName, NULL, &Filename, NULL); + if (Filename.empty()) return Filename; // Disc Drive // We add gcz to the cache file if the file is compressed to avoid it reading // the uncompressed file's cache if it has the same name, but not the same ext. if (DiscIO::IsCompressedBlob(m_FileName.c_str())) @@ -203,3 +205,4 @@ const std::string& GameListItem::GetName(int index) const } return m_Name[0]; } + diff --git a/Source/Core/DolphinWX/Src/MemcardManager.cpp b/Source/Core/DolphinWX/Src/MemcardManager.cpp index 95c61f2da4..3c907d667c 100644 --- a/Source/Core/DolphinWX/Src/MemcardManager.cpp +++ b/Source/Core/DolphinWX/Src/MemcardManager.cpp @@ -245,7 +245,7 @@ void CMemcardManager::CreateGUIControls() sPages[slot]->Add(0, 0, 1, wxEXPAND|wxALL, 0); sPages[slot]->Add(m_NextPage[slot], 0, wxEXPAND|wxALL, 1); - m_MemcardPath[slot] = new wxFilePickerCtrl(this, ID_MEMCARDPATH_A + slot, wxEmptyString, wxT("Choose a memory card:"), + m_MemcardPath[slot] = new wxFilePickerCtrl(this, ID_MEMCARDPATH_A + slot, wxT(FULL_GC_USER_DIR), wxT("Choose a memory card:"), wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp"), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN); m_MemcardList[slot] = new CMemcardListCtrl(this, ID_MEMCARDLIST_A + slot, wxDefaultPosition, wxSize(350,400), @@ -919,3 +919,4 @@ void CMemcardManager::CMemcardListCtrl::OnRightClick(wxMouseEvent& event) } PopupMenu(&popupMenu); } +