Fixed installing games to FAT partitions.

This commit is contained in:
e.bovendeur 2010-01-04 14:11:02 +00:00
parent 26a5d9c9de
commit ffb017b6bc
4 changed files with 29 additions and 7 deletions

View File

@ -2,8 +2,8 @@
<app version="1"> <app version="1">
<name> USB Loader GX</name> <name> USB Loader GX</name>
<coder>USB Loader GX Team</coder> <coder>USB Loader GX Team</coder>
<version>1.0 r882</version> <version>1.0 r883</version>
<release_date>201001031700</release_date> <release_date>201001041352</release_date>
<short_description>Loads games from USB-devices</short_description> <short_description>Loads games from USB-devices</short_description>
<long_description>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. <long_description>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. The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller.

View File

@ -621,9 +621,7 @@ s32 WBFS_ReIDGame(u8 *discid, const void *newID)
f32 WBFS_EstimeGameSize(void) { f32 WBFS_EstimeGameSize(void) {
if (wbfs_part_fs) { if (wbfs_part_fs) {
u64 comp; return WBFS_FAT_EstimateGameSize();
WBFS_FAT_DVD_Size(&comp, NULL);
return comp;
} }
partition_selector_t part_sel; partition_selector_t part_sel;

View File

@ -648,3 +648,26 @@ s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID)
return ret; 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);
}

View File

@ -14,5 +14,6 @@ s32 WBFS_FAT_DVD_Size(u64 *comp_size, u64 *real_size);
int WBFS_FAT_find_fname(u8 *id, char *fname, int len); int WBFS_FAT_find_fname(u8 *id, char *fname, int len);
s32 WBFS_FAT_RenameGame(u8 *discid, const void *newname); s32 WBFS_FAT_RenameGame(u8 *discid, const void *newname);
s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID); s32 WBFS_FAT_ReIDGame(u8 *discid, const void *newID);
s32 WBFS_FAT_EstimateGameSize(void);
#endif #endif