Merge pull request #2015 from Stevoisiak/WAD-Version-Check

VolumeWad: Return version number for WADs
This commit is contained in:
Pierre Bourdon
2015-02-13 22:09:30 +01:00
4 changed files with 14 additions and 2 deletions

View File

@ -103,6 +103,17 @@ bool CVolumeWAD::GetTitleID(u8* _pBuffer) const
return true;
}
int CVolumeWAD::GetRevision() const
{
u32 TmdOffset = ALIGN_40(m_hdr_size) + ALIGN_40(m_cert_size) + ALIGN_40(m_tick_size);
u16 revision;
if (!m_pReader->Read(TmdOffset + 0x1dc, 2, (u8*)&revision))
return 0;
return Common::swap16(revision);
}
bool CVolumeWAD::IsWadFile() const
{
return true;

View File

@ -36,6 +36,7 @@ public:
ECountry GetCountry() const override;
u64 GetSize() const override;
u64 GetRawSize() const override;
int GetRevision() const override;
private:
std::unique_ptr<IBlobReader> m_pReader;