Skip to content

Commit

Permalink
Merge pull request #531 from LPFaint99/memcard
Browse files Browse the repository at this point in the history
GCI Folder: correctly identify region of sysmenu
  • Loading branch information
lioncash committed Jun 25, 2014
2 parents 832d0bb + c65a6f5 commit eb3de73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/Core/Common/NandPaths.h
Expand Up @@ -11,6 +11,7 @@
#include "Common/CommonTypes.h"

#define TITLEID_SYSMENU 0x0000000100000002ull
const static std::string TITLEID_SYSMENU_STRING = "0000000100000002";

namespace Common
{
Expand Down
13 changes: 12 additions & 1 deletion Source/Core/Core/HW/EXI_DeviceMemoryCard.cpp
Expand Up @@ -4,6 +4,7 @@

#include "Common/Common.h"
#include "Common/FileUtil.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
Expand All @@ -17,6 +18,7 @@
#include "Core/HW/GCMemcardRaw.h"
#include "Core/HW/Memmap.h"
#include "Core/HW/Sram.h"
#include "DiscIO/NANDContentLoader.h"

#define MC_STATUS_BUSY 0x80
#define MC_STATUS_UNLOCKED 0x40
Expand Down Expand Up @@ -100,8 +102,17 @@ void CEXIMemoryCard::setupGciFolder(u16 sizeMb)

DiscIO::IVolume::ECountry CountryCode = DiscIO::IVolume::COUNTRY_UNKNOWN;
auto strUniqueID = Core::g_CoreStartupParameter.m_strUniqueID;

u32 CurrentGameId = 0;
if (strUniqueID.length() >= 4)
if (strUniqueID == TITLEID_SYSMENU_STRING)
{
const DiscIO::INANDContentLoader & SysMenu_Loader = DiscIO::CNANDContentManager::Access().GetNANDLoader(TITLEID_SYSMENU, true);
if (SysMenu_Loader.IsValid())
{
CountryCode = DiscIO::CountrySwitch(SysMenu_Loader.GetCountryChar());
}
}
else if (strUniqueID.length() >= 4)
{
CountryCode = DiscIO::CountrySwitch(strUniqueID.at(3));
memcpy((u8 *)&CurrentGameId, strUniqueID.c_str(), 4);
Expand Down

0 comments on commit eb3de73

Please sign in to comment.