summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-09-17 10:58:38 +0200
committerTillmann Karras <tilkax@gmail.com>2015-10-12 02:33:38 +0200
commitefe71e686b8b89e87e2c10237e4d33bc4bfdf54f (patch)
tree3d0530888f701162ffcfbfc663192f1081811bec
parent1a8e2e16e36caa69a6d8fef5bda8924e2e758255 (diff)
DiscIO: implement CISOBlob::GetDataSize()
This is a best-effort approach, since the CISO format does not save the original file size.
-rw-r--r--Source/Core/DiscIO/CISOBlob.cpp2
-rw-r--r--Source/Core/DiscIO/CISOBlob.h4
2 files changed, 5 insertions, 1 deletions
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;