summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DiscScrubber.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-12-01 03:18:24 -0500
committerLioncash <mathew1800@gmail.com>2014-12-01 03:18:24 -0500
commit6df67bf38f52151ee5efb64edb4bc60ecce601ef (patch)
treed1ca98e338aa1cb6cc69ff6d47054790108181de /Source/Core/DiscIO/DiscScrubber.cpp
parentf9ba7a0fb2d19d8a0dee6fe6098226745f746c77 (diff)
parent815b7bec967c773a3c8605dfe12a7cfefa844d31 (diff)
Merge pull request #1597 from unknownbrackets/gcz-tweaks
Tweaks to gcz compression / decompression
Diffstat (limited to 'Source/Core/DiscIO/DiscScrubber.cpp')
-rw-r--r--Source/Core/DiscIO/DiscScrubber.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/DiscScrubber.cpp b/Source/Core/DiscIO/DiscScrubber.cpp
index 8cdc314ea4..03a45616a4 100644
--- a/Source/Core/DiscIO/DiscScrubber.cpp
+++ b/Source/Core/DiscIO/DiscScrubber.cpp
@@ -124,24 +124,27 @@ bool SetupScrub(const std::string& filename, int block_size)
return success;
}
-void GetNextBlock(File::IOFile& in, u8* buffer)
+size_t GetNextBlock(File::IOFile& in, u8* buffer)
{
u64 CurrentOffset = m_BlockCount * m_BlockSize;
u64 i = CurrentOffset / CLUSTER_SIZE;
+ size_t ReadBytes = 0;
if (m_isScrubbing && m_FreeTable[i])
{
DEBUG_LOG(DISCIO, "Freeing 0x%016" PRIx64, CurrentOffset);
std::fill(buffer, buffer + m_BlockSize, 0xFF);
in.Seek(m_BlockSize, SEEK_CUR);
+ ReadBytes = m_BlockSize;
}
else
{
DEBUG_LOG(DISCIO, "Used 0x%016" PRIx64, CurrentOffset);
- in.ReadBytes(buffer, m_BlockSize);
+ in.ReadArray(buffer, m_BlockSize, &ReadBytes);
}
m_BlockCount++;
+ return ReadBytes;
}
void Cleanup()