mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
System Menu Region is now detected based on the Title Version in tmd
Title Version and region char of currently installed system menu are now listed in the menu as well Which means disc channel will only show pal discs if it is a pal nand dump; ntsc nand dump will show ntsc discs, ntsc-j nand dump will show ntsc-j discs git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6591 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -122,6 +122,7 @@ public:
|
||||
u16 GetTitleVersion() const {return m_TileVersion;}
|
||||
u16 GetNumEntries() const {return m_numEntries;}
|
||||
DiscIO::IVolume::ECountry GetCountry() const;
|
||||
u8 GetCountryChar() const {return m_Country; }
|
||||
|
||||
private:
|
||||
|
||||
@ -133,6 +134,7 @@ private:
|
||||
u16 m_TileVersion;
|
||||
u8 m_TicketView[TICKET_VIEW_SIZE];
|
||||
u8 m_TmdHeader[TMD_HEADER_SIZE];
|
||||
u8 m_Country;
|
||||
|
||||
std::vector<SNANDContent> m_Content;
|
||||
|
||||
@ -223,6 +225,9 @@ bool CNANDContentLoader::CreateFromDirectory(const std::string& _rPath)
|
||||
m_BootIndex = Common::swap16(pTMD + 0x01e0);
|
||||
m_TitleID = Common::swap64(pTMD + 0x018c);
|
||||
m_IosVersion = Common::swap16(pTMD + 0x018a);
|
||||
m_Country = *(u8*)&m_TitleID;
|
||||
if (m_Country == 2) // SYSMENU
|
||||
m_Country = DiscIO::GetSysMenuRegion(m_TileVersion);
|
||||
|
||||
m_Content.resize(m_numEntries);
|
||||
|
||||
@ -307,6 +312,9 @@ bool CNANDContentLoader::ParseTMD(u8* pDataApp, u32 pDataAppSize, u8* pTicket, u
|
||||
m_BootIndex = Common::swap16(pTMD + 0x01e0);
|
||||
m_TitleID = Common::swap64(pTMD + 0x018c);
|
||||
m_IosVersion = Common::swap16(pTMD + 0x018a);
|
||||
m_Country = *(u8*)&m_TitleID;
|
||||
if (m_Country == 2) // SYSMENU
|
||||
m_Country = DiscIO::GetSysMenuRegion(m_TileVersion);
|
||||
|
||||
u8* p = pDataApp;
|
||||
|
||||
@ -341,16 +349,10 @@ DiscIO::IVolume::ECountry CNANDContentLoader::GetCountry() const
|
||||
if (!IsValid())
|
||||
return DiscIO::IVolume::COUNTRY_UNKNOWN;
|
||||
|
||||
u64 TitleID = GetTitleID();
|
||||
char* pTitleID = (char*)&TitleID;
|
||||
|
||||
return CountrySwitch((u8)pTitleID[0]);
|
||||
|
||||
|
||||
return CountrySwitch(m_Country);
|
||||
}
|
||||
|
||||
|
||||
|
||||
CNANDContentManager CNANDContentManager::m_Instance;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user