Skip to content

Commit

Permalink
Merge pull request #531 from AKuHAK/UL.fix
Browse files Browse the repository at this point in the history
Revert size calculation for USBExtreme (can take more then 5 minutes)
  • Loading branch information
rickgaiser authored Sep 3, 2021
2 parents 0265d2a + ae93970 commit 0555e9e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/supportbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,18 @@ int sbReadList(base_game_info_t **list, const char *prefix, int *fsize, int *gam
g->sizeMB = 0;
name_checksum = USBA_crc32(g->name);

// TODO: size calculation is very slow
// implmented some caching, or do not touch at all

// calculate total size for individual game
for (part = 0; part < g->parts && ulfd >= 0; part++) {
snprintf(path, sizeof(path), "%sul.%08X.%s.%02x", prefix, name_checksum, g->startup, part);
ulfd = openFile(path, O_RDONLY);
if (ulfd >= 0) {
g->sizeMB += (getFileSize(ulfd) >> 20);
close(ulfd);
}
}
// for (part = 0; part < g->parts && ulfd >= 0; part++) {
// snprintf(path, sizeof(path), "%sul.%08X.%s.%02x", prefix, name_checksum, g->startup, part);
// ulfd = openFile(path, O_RDONLY);
// if (ulfd >= 0) {
// g->sizeMB += (getFileSize(ulfd) >> 20);
// close(ulfd);
// }
// }
}
}
}
Expand Down

0 comments on commit 0555e9e

Please sign in to comment.