From efe71e686b8b89e87e2c10237e4d33bc4bfdf54f Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Thu, 17 Sep 2015 10:58:38 +0200 Subject: [PATCH] DiscIO: implement CISOBlob::GetDataSize() This is a best-effort approach, since the CISO format does not save the original file size. --- Source/Core/DiscIO/CISOBlob.cpp | 2 +- Source/Core/DiscIO/CISOBlob.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/CISOBlob.cpp b/Source/Core/DiscIO/CISOBlob.cpp index fa9b30e2f5..f9947d0e6c 100644 --- a/Source/Core/DiscIO/CISOBlob.cpp +++ b/Source/Core/DiscIO/CISOBlob.cpp @@ -44,7 +44,7 @@ CISOFileReader* CISOFileReader::Create(const std::string& filename) u64 CISOFileReader::GetDataSize() const { - return GetRawSize(); + return CISO_MAP_SIZE * m_block_size; } u64 CISOFileReader::GetRawSize() const diff --git a/Source/Core/DiscIO/CISOBlob.h b/Source/Core/DiscIO/CISOBlob.h index a1b5ae5cb7..dd0095f5a4 100644 --- a/Source/Core/DiscIO/CISOBlob.h +++ b/Source/Core/DiscIO/CISOBlob.h @@ -37,7 +37,11 @@ public: static CISOFileReader* Create(const std::string& filename); BlobType GetBlobType() const override { return BlobType::CISO; } + + // The CISO format does not save the original file size. + // This function returns an upper bound. u64 GetDataSize() const override; + u64 GetRawSize() const override; bool Read(u64 offset, u64 nbytes, u8* out_ptr) override;