diff --git a/HBC/META.XML b/HBC/META.XML index 3ace37e0..df6f7cab 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r882 - 201001031700 + 1.0 r883 + 201001041352 Loads games from USB-devices USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller. diff --git a/source/usbloader/wbfs.c b/source/usbloader/wbfs.c index ab196ee2..415c5242 100644 --- a/source/usbloader/wbfs.c +++ b/source/usbloader/wbfs.c @@ -621,9 +621,7 @@ s32 WBFS_ReIDGame(u8 *discid, const void *newID) f32 WBFS_EstimeGameSize(void) { if (wbfs_part_fs) { - u64 comp; - WBFS_FAT_DVD_Size(&comp, NULL); - return comp; + return WBFS_FAT_EstimateGameSize(); } partition_selector_t part_sel; diff --git a/source/usbloader/wbfs_fat.c b/source/usbloader/wbfs_fat.c index 4006d22d..1868ef54 100644 --- a/source/usbloader/wbfs_fat.c +++ b/source/usbloader/wbfs_fat.c @@ -648,3 +648,26 @@ s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID) return ret; } + +s32 WBFS_FAT_EstimateGameSize(void) { + wbfs_t *part = NULL; + u64 size = (u64)143432*2*0x8000ULL; + u32 n_sector = size / fat_sector_size; + u32 wii_sec_sz; + + // init a temporary dummy part + // as a placeholder for wbfs_size_disc + part = wbfs_open_partition( + nop_read_sector, nop_write_sector, + NULL, fat_sector_size, n_sector, 0, 1); + if (!part) return -1; + wii_sec_sz = part->wii_sec_sz; + + partition_selector_t part_sel; + if (Settings.fullcopy) { + part_sel = ALL_PARTITIONS; + } else { + part_sel = Settings.partitions_to_install == install_game_only ? ONLY_GAME_PARTITION : ALL_PARTITIONS; + } + return wbfs_estimate_disc(part, __WBFS_ReadDVD, NULL, part_sel); +} diff --git a/source/usbloader/wbfs_fat.h b/source/usbloader/wbfs_fat.h index e8b65da7..703afd42 100644 --- a/source/usbloader/wbfs_fat.h +++ b/source/usbloader/wbfs_fat.h @@ -12,7 +12,8 @@ s32 WBFS_FAT_RemoveGame(u8 *discid); s32 WBFS_FAT_AddGame(void); s32 WBFS_FAT_DVD_Size(u64 *comp_size, u64 *real_size); int WBFS_FAT_find_fname(u8 *id, char *fname, int len); -s32 WBFS_FAT_RenameGame(u8 *discid, const void *newname); -s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID); +s32 WBFS_FAT_RenameGame(u8 *discid, const void *newname); +s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID); +s32 WBFS_FAT_EstimateGameSize(void); #endif