From 192081d2f1a9c7e139828847f8c882499197b870 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 16 May 2023 18:58:07 +0200 Subject: [PATCH] DiscIO: Improve comments in WIARVZFileReader::Convert Just some clarifications and typo fixes. --- Source/Core/DiscIO/WIABlob.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Core/DiscIO/WIABlob.cpp b/Source/Core/DiscIO/WIABlob.cpp index b80753120b..65c6aaa484 100644 --- a/Source/Core/DiscIO/WIABlob.cpp +++ b/Source/Core/DiscIO/WIABlob.cpp @@ -1771,16 +1771,17 @@ WIARVZFileReader::Convert(BlobReader* infile, const VolumeDisc* infile_volu // An estimate for how much space will be taken up by headers. // We will reserve this much space at the beginning of the file, and if the headers don't - // fit on that space, we will need to write them at the end of the file instead. + // fit in that space, we will need to write them at the end of the file instead. const u64 headers_size_upper_bound = [&] { // 0x100 is added to account for compression overhead (in particular for Purge). u64 upper_bound = sizeof(WIAHeader1) + sizeof(WIAHeader2) + partition_entries_size + raw_data_entries_size + 0x100; - // RVZ's added data in GroupEntry usually compresses well, so we'll assume the compression ratio - // for RVZ GroupEntries is 9 / 16 or better. This constant is somehwat arbitrarily chosen, but - // no games were found that get a worse compression ratio than that. There are some games that - // get a worse ratio than 1 / 2, such as Metroid: Other M (PAL) with the default settings. + // Compared to WIA, RVZ adds an extra member to the GroupEntry struct. This added data usually + // compresses well, so we'll assume the compression ratio for RVZ GroupEntries is 9 / 16 or + // better. This constant is somehwat arbitrarily chosen, but no games were found that get a + // worse compression ratio than that. There are some games that get a worse ratio than 1 / 2, + // such as Metroid: Other M (PAL) with the default settings. if (RVZ && compression_type > WIARVZCompressionType::Purge) upper_bound += static_cast(group_entries_size) * 9 / 16; else @@ -1798,7 +1799,7 @@ WIARVZFileReader::Convert(BlobReader* infile, const VolumeDisc* infile_volu if (!infile->Read(0, header_2.disc_header.size(), header_2.disc_header.data())) return ConversionResultCode::ReadFailed; - // We intentially do not increment bytes_read here, since these bytes will be read again + // We intentionally do not increment bytes_read here, since these bytes will be read again std::map reusable_groups; std::mutex reusable_groups_mutex;