diff options
| author | Pringo <Pringo@users.noreply.github.com> | 2014-11-24 21:54:15 -0800 |
|---|---|---|
| committer | Pringo <Pringo@users.noreply.github.com> | 2014-11-24 21:54:15 -0800 |
| commit | 670d94967a64b6a3e99127caf5511b07825f21cb (patch) | |
| tree | e83e2909a2db5dbe8387a40f3839d27abf588c0c /Source/Core/DiscIO/VolumeWiiCrypted.cpp | |
| parent | 5a89ba20d75b17b1aeec090544934b95bdb0ec74 (diff) | |
| parent | 245ff601b7033f4122b48d837171c21baa9ac306 (diff) | |
Merge pull request #1 from dolphin-emu/master
update
Diffstat (limited to 'Source/Core/DiscIO/VolumeWiiCrypted.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWiiCrypted.cpp | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/Source/Core/DiscIO/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/VolumeWiiCrypted.cpp index 32313dd4c2..f756f88450 100644 --- a/Source/Core/DiscIO/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/VolumeWiiCrypted.cpp @@ -46,18 +46,15 @@ bool CVolumeWiiCrypted::RAWRead( u64 _Offset, u64 _Length, u8* _pBuffer ) const // Medal Of Honor Heroes 2 read this DVD offset for PartitionsInfo // and, PartitionsInfo is not encrypted, let's read it directly. if (!m_pReader->Read(_Offset, _Length, _pBuffer)) - { return(false); - } - return true; + else + return true; } bool CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const { if (m_pReader == nullptr) - { return(false); - } while (_Length > 0) { @@ -118,16 +115,12 @@ void CVolumeWiiCrypted::GetTMD(u8* _pBuffer, u32 * _sz) const std::string CVolumeWiiCrypted::GetUniqueID() const { if (m_pReader == nullptr) - { return std::string(); - } char ID[7]; if (!Read(0, 6, (u8*)ID)) - { return std::string(); - } ID[6] = '\0'; @@ -149,22 +142,30 @@ IVolume::ECountry CVolumeWiiCrypted::GetCountry() const std::string CVolumeWiiCrypted::GetMakerID() const { if (m_pReader == nullptr) - { return std::string(); - } char makerID[3]; if (!Read(0x4, 0x2, (u8*)&makerID)) - { return std::string(); - } makerID[2] = '\0'; return makerID; } +int CVolumeWiiCrypted::GetRevision() const +{ + if (!m_pReader) + return 0; + + u8 revision; + if (!m_pReader->Read(7, 1, &revision)) + return 0; + + return revision; +} + std::vector<std::string> CVolumeWiiCrypted::GetNames() const { std::vector<std::string> names; @@ -181,16 +182,12 @@ std::vector<std::string> CVolumeWiiCrypted::GetNames() const u32 CVolumeWiiCrypted::GetFSTSize() const { if (m_pReader == nullptr) - { return 0; - } u32 size; if (!Read(0x428, 0x4, (u8*)&size)) - { return 0; - } return size; } @@ -198,16 +195,12 @@ u32 CVolumeWiiCrypted::GetFSTSize() const std::string CVolumeWiiCrypted::GetApploaderDate() const { if (m_pReader == nullptr) - { return std::string(); - } char date[16]; if (!Read(0x2440, 0x10, (u8*)&date)) - { return std::string(); - } date[10] = '\0'; @@ -217,25 +210,17 @@ std::string CVolumeWiiCrypted::GetApploaderDate() const u64 CVolumeWiiCrypted::GetSize() const { if (m_pReader) - { return m_pReader->GetDataSize(); - } else - { return 0; - } } u64 CVolumeWiiCrypted::GetRawSize() const { if (m_pReader) - { return m_pReader->GetRawSize(); - } else - { return 0; - } } bool CVolumeWiiCrypted::CheckIntegrity() const |
