From b578abfbaa8a170396da3c834060e1def570c368 Mon Sep 17 00:00:00 2001 From: Stevoisiak Date: Fri, 30 Jan 2015 20:43:48 -0500 Subject: [PATCH] VolumeWad: Return version number for WADs --- Source/Core/DiscIO/VolumeWad.cpp | 11 +++++++++++ Source/Core/DiscIO/VolumeWad.h | 1 + Source/Core/DolphinQt/GameList/GameFile.cpp | 2 +- Source/Core/DolphinWX/ISOFile.cpp | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index 13fecce313..0e1f0c79b3 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -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; diff --git a/Source/Core/DiscIO/VolumeWad.h b/Source/Core/DiscIO/VolumeWad.h index 58dc662d73..0a0f456071 100644 --- a/Source/Core/DiscIO/VolumeWad.h +++ b/Source/Core/DiscIO/VolumeWad.h @@ -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 m_pReader; diff --git a/Source/Core/DolphinQt/GameList/GameFile.cpp b/Source/Core/DolphinQt/GameList/GameFile.cpp index 628f00f06f..83c74b224a 100644 --- a/Source/Core/DolphinQt/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt/GameList/GameFile.cpp @@ -26,7 +26,7 @@ #include "DolphinQt/Utils/Resources.h" #include "DolphinQt/Utils/Utils.h" -static const u32 CACHE_REVISION = 0x003; +static const u32 CACHE_REVISION = 0x004; static const u32 DATASTREAM_REVISION = 15; // Introduced in Qt 5.2 static QStringList VectorToStringList(std::vector vec, bool trim = false) diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 58eecce21c..dd46734cd4 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -37,7 +37,7 @@ #include "DolphinWX/ISOFile.h" #include "DolphinWX/WxUtils.h" -static const u32 CACHE_REVISION = 0x119; +static const u32 CACHE_REVISION = 0x120; #define DVD_BANNER_WIDTH 96 #define DVD_BANNER_HEIGHT 32