summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLPFaint99 <lpfaint99@gmail.com>2014-07-08 22:48:02 -0700
committerLPFaint99 <lpfaint99@gmail.com>2014-07-16 21:41:09 -0700
commit19c94de6e00cf600294ead8edcc1aae541d1042e (patch)
tree3e93dd7900901bac940573cbc48285e54af34e54
parent29873a7c55aef0fe9c461df459671ba43c9f7c17 (diff)
Gcifolder use correct region for fifologs and homebrew
-rw-r--r--Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp
index dd0b2a3e5b..b2542c9ca8 100644
--- a/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp
+++ b/Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp
@@ -132,6 +132,36 @@ void CEXIMemoryCard::setupGciFolder(u16 sizeMb)
case DiscIO::IVolume::COUNTRY_USA:
strDirectoryName += USA_DIR DIR_SEP;
break;
+ case DiscIO::IVolume::COUNTRY_UNKNOWN:
+ {
+ // The current game's region is not passed down to the EXI device level.
+ // Usually, we can retrieve the region from Core::g_CoreStartupParameter.m_strUniqueId.
+ // The Wii System Menu requires a lookup based on the version number.
+ // This is not possible in some cases ( e.g. FIFO logs, homebrew elf/dol files).
+ // Instead, we then lookup the region from the memory card name
+ // Earlier in the boot process the region is added to the memory card name (This is done by the function checkMemcardPath)
+ // For now take advantage of this.
+ // Future options:
+ // Set memory card directory path in the checkMemcardPath function.
+ // or Add region to Core::g_CoreStartupParameter.
+ // or Pass region down to the EXI device creation.
+
+ std::string memcardFilename = (card_index == 0) ? SConfig::GetInstance().m_strMemoryCardA : SConfig::GetInstance().m_strMemoryCardB;
+ std::string region = memcardFilename.substr(memcardFilename.size() - 7, 3);
+ if (region == JAP_DIR)
+ {
+ CountryCode = DiscIO::IVolume::COUNTRY_JAPAN;
+ ascii = false;
+ strDirectoryName += JAP_DIR DIR_SEP;
+ break;
+ }
+ else if (region == USA_DIR)
+ {
+ CountryCode = DiscIO::IVolume::COUNTRY_USA;
+ strDirectoryName += USA_DIR DIR_SEP;
+ break;
+ }
+ }
default:
CountryCode = DiscIO::IVolume::COUNTRY_EUROPE;
strDirectoryName += EUR_DIR DIR_SEP;