RVZ: Support chunk sizes between 32 KiB and 2 MiB

WIA doesn't support smaller than 2 MiB.
This commit is contained in:
JosJuice
2020-05-05 00:43:32 +02:00
parent 0d433baeb5
commit b06c50ed2e
3 changed files with 67 additions and 24 deletions

View File

@ -381,8 +381,8 @@ private:
bool Read(u64 offset, u64 size, u8* out_ptr);
// This can only be called once at least one byte of data has been read
bool ApplyHashExceptions(VolumeWii::HashBlock hash_blocks[VolumeWii::BLOCKS_PER_GROUP],
u64 exception_list_index) const;
void GetHashExceptions(std::vector<HashExceptionEntry>* exception_list,
u64 exception_list_index, u16 additional_offset) const;
template <typename T>
bool ReadAll(std::vector<T>* vector)
@ -419,6 +419,9 @@ private:
Chunk& ReadCompressedData(u64 offset_in_file, u64 compressed_size, u64 decompressed_size,
u32 exception_lists);
static bool ApplyHashExceptions(const std::vector<HashExceptionEntry>& exception_list,
VolumeWii::HashBlock hash_blocks[VolumeWii::BLOCKS_PER_GROUP]);
static std::string VersionToString(u32 version);
static u32 LZMA2DictionarySize(u8 p);
@ -536,6 +539,10 @@ private:
u64 m_cached_chunk_offset = std::numeric_limits<u64>::max();
WiiEncryptionCache m_encryption_cache;
std::vector<HashExceptionEntry> m_exception_list;
bool m_write_to_exception_list = false;
u64 m_exception_list_last_group_index;
WIAHeader1 m_header_1;
WIAHeader2 m_header_2;
std::vector<PartitionEntry> m_partition_entries;