Add progress bar to CRC calculation

This commit is contained in:
Henrik Rydgård committed 2023-10-28 06:50:57 -05:00
1 parent 8e43a9a204
commit 93c0ef68b6
4 files changed
+35 -20

No files matched your search

-17
View File
@@ -65,23 +65,6 @@ BlockDevice *constructBlockDevice(FileLoader *fileLoader) {
return new FileBlockDevice(fileLoader);
}
u32 BlockDevice::CalculateCRC(volatile bool *cancel) {
u32 crc = crc32(0, Z_NULL, 0);
u8 block[2048];
for (u32 i = 0; i < GetNumBlocks(); ++i) {
if (cancel && *cancel)
return 0;
if (!ReadBlock(i, block, true)) {
ERROR_LOG(FILESYS, "Failed to read block for CRC");
return 0;
}
crc = crc32(crc, block, 2048);
}
return crc;
}
void BlockDevice::NotifyReadError() {
auto err = GetI18NCategory(I18NCat::ERRORS);
if (!reportedError_) {