diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index a322f24e8a..f833c6154d 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -885,6 +885,15 @@ const char* SConfig::GetDirectoryForRegion(DiscIO::Region region) } } +std::string SConfig::GetBootROMPath(const std::string& region_directory) const +{ + const std::string path = + File::GetUserPath(D_GCUSER_IDX) + DIR_SEP + region_directory + DIR_SEP GC_IPL; + if (!File::Exists(path)) + return File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + region_directory + DIR_SEP GC_IPL; + return path; +} + // Sets m_region to the region parameter, or to PAL if the region parameter // is invalid. Set directory_name to the value returned by GetDirectoryForRegion // for m_region. Returns false if the region parameter is invalid. @@ -1030,10 +1039,7 @@ bool SConfig::AutoSetup(EBootBS2 _BootBS2) { if (!bHLE_BS2) { - m_strBootROM = File::GetUserPath(D_GCUSER_IDX) + DIR_SEP + set_region_dir + DIR_SEP GC_IPL; - if (!File::Exists(m_strBootROM)) - m_strBootROM = - File::GetSysDirectory() + GC_SYS_DIR + DIR_SEP + set_region_dir + DIR_SEP GC_IPL; + m_strBootROM = GetBootROMPath(set_region_dir); if (!File::Exists(m_strBootROM)) { diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 8559361c80..612675a7f7 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -232,6 +232,7 @@ struct SConfig : NonCopyable void LoadDefaults(); static const char* GetDirectoryForRegion(DiscIO::Region region); + std::string GetBootROMPath(const std::string& region_directory) const; bool AutoSetup(EBootBS2 _BootBS2); void CheckMemcardPath(std::string& memcardPath, const std::string& gameRegion, bool isSlotA); DiscIO::Language GetCurrentLanguage(bool wii) const; diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 99fc9bc095..9d41d88fdd 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -23,6 +23,7 @@ #include #include "Common/CDUtils.h" +#include "Common/CommonPaths.h" #include "Common/CommonTypes.h" #include "Common/FileSearch.h" #include "Common/FileUtil.h" @@ -1501,6 +1502,15 @@ void CFrame::UpdateGUI() GetMenuBar()->FindItem(IDM_SAVE_STATE)->Enable(Initialized); // Misc GetMenuBar()->FindItem(IDM_CHANGE_DISC)->Enable(Initialized); + GetMenuBar() + ->FindItem(IDM_LOAD_GC_BIOS_JAP) + ->Enable(!Initialized && File::Exists(SConfig::GetInstance().GetBootROMPath(JAP_DIR))); + GetMenuBar() + ->FindItem(IDM_LOAD_GC_BIOS_USA) + ->Enable(!Initialized && File::Exists(SConfig::GetInstance().GetBootROMPath(USA_DIR))); + GetMenuBar() + ->FindItem(IDM_LOAD_GC_BIOS_EUR) + ->Enable(!Initialized && File::Exists(SConfig::GetInstance().GetBootROMPath(EUR_DIR))); if (DiscIO::CNANDContentManager::Access() .GetNANDLoader(TITLEID_SYSMENU, Common::FROM_CONFIGURED_ROOT) .IsValid())