summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DirectoryBlob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-08-22 11:22:33 +0200
committerJosJuice <josjuice@gmail.com>2026-08-22 11:52:22 +0200
commitf93a8a995b6e16625c60303ccabb0ea71e7dbeb2 (patch)
treec6303977d6dcd7538ac0eca1561cdb6b1b476b19 /Source/Core/DiscIO/DirectoryBlob.cpp
parent82f7ec53902d805a6f5091f913035f29499c873a (diff)
Common: Add DivideRoundingUp function
Many callers of AlignUp are dividing immediately after aligning. Let's add a helper function for this so callers don't have to specify the alignment size twice.
Diffstat (limited to 'Source/Core/DiscIO/DirectoryBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DirectoryBlob.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 47b9d73e41..c9355db113 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -792,7 +792,9 @@ void DirectoryBlobReader::SetPartitionHeader(DirectoryBlobPartition* partition,
}
constexpr u32 PARTITION_HEADER_SIZE = 0x1c;
- const u64 data_size = Common::AlignUp(partition->GetDataSize(), 0x7c00) / 0x7c00 * 0x8000;
+ const u64 data_size =
+ Common::DivideRoundingUp(partition->GetDataSize(), VolumeWii::BLOCK_DATA_SIZE) *
+ VolumeWii::BLOCK_TOTAL_SIZE;
std::vector<u8> partition_header(PARTITION_HEADER_SIZE);
Write32(static_cast<u32>(tmd_size), 0x0, &partition_header);
Write32(TMD_OFFSET >> 2, 0x4, &partition_header);