summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWad.cpp
diff options
context:
space:
mode:
authorStevoisiak <Stevoisiak@gmail.com>2015-02-23 19:50:19 -0500
committerStevoisiak <Stevoisiak@gmail.com>2015-02-26 16:55:17 -0500
commitdf2f6d137e5e1b9e7ffe8a51f9952ab555a45898 (patch)
tree506f35ab6bd69d91fc1b592a38f428f0996fb10b /Source/Core/DiscIO/VolumeWad.cpp
parentd3190ec4f11bc2ceac7cf94648f1692fff9f71ed (diff)
VolumeWad: Move country identification to GetCountry()
Brings the code more in line with the rest of the game volume code
Diffstat (limited to 'Source/Core/DiscIO/VolumeWad.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWad.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp
index 0a74312d1a..2cbfbc92fd 100644
--- a/Source/Core/DiscIO/VolumeWad.cpp
+++ b/Source/Core/DiscIO/VolumeWad.cpp
@@ -31,15 +31,6 @@ CVolumeWAD::CVolumeWAD(IBlobReader* _pReader)
m_offset = ALIGN_40(m_hdr_size) + ALIGN_40(m_cert_size);
m_tmd_offset = ALIGN_40(m_hdr_size) + ALIGN_40(m_cert_size) + ALIGN_40(m_tick_size);
m_opening_bnr_offset = m_tmd_offset + ALIGN_40(m_tmd_size) + ALIGN_40(m_data_size);
-
- // read the last digit of the titleID in the ticket
- Read(m_tmd_offset + 0x0193, 1, &m_Country);
- if (m_Country == 2) // SYSMENU
- {
- u16 titlever = 0;
- Read(m_tmd_offset + 0x01dc, 2, (u8*)&titlever);
- m_Country = GetSysMenuRegion(Common::swap16(titlever));
- }
}
CVolumeWAD::~CVolumeWAD()
@@ -62,7 +53,18 @@ IVolume::ECountry CVolumeWAD::GetCountry() const
if (!m_pReader)
return COUNTRY_UNKNOWN;
- return CountrySwitch(m_Country);
+ // read the last digit of the titleID in the ticket
+ u8 CountryCode;
+ Read(m_tmd_offset + 0x0193, 1, &CountryCode);
+
+ if (CountryCode == 2) // SYSMENU
+ {
+ u16 titlever = 0;
+ Read(m_tmd_offset + 0x01dc, 2, (u8*)&titlever);
+ CountryCode = GetSysMenuRegion(Common::swap16(titlever));
+ }
+
+ return CountrySwitch(CountryCode);
}
std::string CVolumeWAD::GetUniqueID() const