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">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r882</version>
<release_date>201001031700</release_date>
<version>1.0 r883</version>
<release_date>201001041352</release_date>
<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.
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) {
if (wbfs_part_fs) {
u64 comp;
WBFS_FAT_DVD_Size(&comp, NULL);
return comp;
return WBFS_FAT_EstimateGameSize();
}
partition_selector_t part_sel;

View File

@ -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);
}

View File

@ -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