diff --git a/Source/Core/DiscIO/Src/Volume.h b/Source/Core/DiscIO/Src/Volume.h index c90ee4a381..557c71c31f 100644 --- a/Source/Core/DiscIO/Src/Volume.h +++ b/Source/Core/DiscIO/Src/Volume.h @@ -43,6 +43,7 @@ public: virtual std::string GetApploaderDate() const = 0; virtual bool SupportsIntegrityCheck() const { return false; } virtual bool CheckIntegrity() const { return false; } + virtual bool IsDiscTwo() const { return false; } enum ECountry { diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 51fac285fc..09e2c5eaa9 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -137,4 +137,11 @@ u64 CVolumeGC::GetSize() const return 0; } +bool CVolumeGC::IsDiscTwo() const +{ + bool discTwo; + Read(6,1, (u8*) &discTwo); + return discTwo; +} + } // namespace diff --git a/Source/Core/DiscIO/Src/VolumeGC.h b/Source/Core/DiscIO/Src/VolumeGC.h index 5fd18ea96a..4221df9493 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.h +++ b/Source/Core/DiscIO/Src/VolumeGC.h @@ -39,6 +39,7 @@ public: std::string GetApploaderDate() const; ECountry GetCountry() const; u64 GetSize() const; + bool IsDiscTwo() const; private: IBlobReader* m_pReader; diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 3d6f82b4c5..51b5bb2554 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -96,14 +96,9 @@ static int CompareGameListItems(const GameListItem* iso1, const GameListItem* is case CGameListCtrl::COLUMN_TITLE: if (!strcasecmp(iso1->GetName(indexOne).c_str(),iso2->GetName(indexOther).c_str())) { - File::IOFile file(iso1->GetFileName(),"rb"); - u8 discNum; - file.Seek(6,0); - file.ReadBytes(&discNum, 1); - file.Close(); - if (discNum == 1) + if (iso1->IsDiscTwo()) return 1 * t; - else + else if (iso2->IsDiscTwo()) return -1 * t; } return strcasecmp(iso1->GetName(indexOne).c_str(), diff --git a/Source/Core/DolphinWX/Src/ISOFile.cpp b/Source/Core/DolphinWX/Src/ISOFile.cpp index 2d4b202272..1e4164b7aa 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.cpp +++ b/Source/Core/DolphinWX/Src/ISOFile.cpp @@ -36,7 +36,7 @@ #include "ChunkFile.h" #include "../resources/no_banner.cpp" -#define CACHE_REVISION 0x10E +#define CACHE_REVISION 0x10F #define DVD_BANNER_WIDTH 96 #define DVD_BANNER_HEIGHT 32 @@ -91,6 +91,7 @@ GameListItem::GameListItem(const std::string& _rFileName) m_UniqueID = pVolume->GetUniqueID(); m_BlobCompressed = DiscIO::IsCompressedBlob(_rFileName.c_str()); + m_IsDiscTwo = pVolume->IsDiscTwo(); // check if we can get some infos from the banner file too DiscIO::IFileSystem* pFileSystem = DiscIO::CreateFileSystem(pVolume); @@ -235,6 +236,7 @@ void GameListItem::DoState(PointerWrap &p) p.Do(m_BlobCompressed); p.Do(m_pImage); p.Do(m_Platform); + p.Do(m_IsDiscTwo); } std::string GameListItem::CreateCacheFilename() diff --git a/Source/Core/DolphinWX/Src/ISOFile.h b/Source/Core/DolphinWX/Src/ISOFile.h index fe7d3d6c6c..e58dcf7713 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.h +++ b/Source/Core/DolphinWX/Src/ISOFile.h @@ -48,6 +48,7 @@ public: bool IsCompressed() const {return m_BlobCompressed;} u64 GetFileSize() const {return m_FileSize;} u64 GetVolumeSize() const {return m_VolumeSize;} + bool IsDiscTwo() const {return m_IsDiscTwo;} #if defined(HAVE_WX) && HAVE_WX const wxImage& GetImage() const {return m_Image;} #endif @@ -87,6 +88,7 @@ private: bool m_BlobCompressed; std::vector m_pImage; u32 m_ImageSize; + bool m_IsDiscTwo; bool LoadFromCache(); void SaveToCache();