Skip to content
Permalink
Browse files
Revert size calculation for USBExtreme (can take more then 5 minutes)
  • Loading branch information
AKuHAK committed Sep 3, 2021
1 parent 0265d2a commit ae939709933da75d5354be3eb8297ceddb681d34
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/supportbase.c
@@ -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);
// }
// }
}
}
}

0 comments on commit ae93970

Please sign in to comment.