*re-eveluate partition size after installing games and such (from r-win)

This commit is contained in:
giantpune 2010-02-01 11:22:48 +00:00
parent 1c6c607cf1
commit aeb7aff9ea
2 changed files with 27 additions and 41 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r901</version>
<release_date>201001312334</release_date>
<version>1.0 r902</version>
<release_date>201002011014</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

@ -34,11 +34,6 @@ char wbfs_fs_drive[16];
char wbfs_fat_dir[16] = "/wbfs";
char invalid_path[] = "/\\:|<>?*\"'";
int wbfs_fat_vfs_have = 0;
int wbfs_fat_vfs_lba = 0;
int wbfs_fat_vfs_dev = 0;
struct statvfs wbfs_fat_vfs;
split_info_t split;
static u32 fat_sector_size = 512;
@ -317,27 +312,18 @@ s32 WBFS_FAT_DiskSpace(f32 *used, f32 *free)
{
f32 size;
int ret;
struct statvfs wbfs_fat_vfs;
*used = 0;
*free = 0;
// statvfs is slow, so cache values
if (!wbfs_fat_vfs_have
|| wbfs_fat_vfs_lba != wbfs_part_lba
|| wbfs_fat_vfs_dev != wbfsDev )
{
ret = statvfs(wbfs_fs_drive, &wbfs_fat_vfs);
if (ret) return 0;
wbfs_fat_vfs_have = 1;
wbfs_fat_vfs_lba = wbfs_part_lba;
wbfs_fat_vfs_dev = wbfsDev;
}
if (ret) return -1;
/* FS size in GB */
size = (f32)wbfs_fat_vfs.f_frsize * (f32)wbfs_fat_vfs.f_blocks / GB_SIZE;
*free = (f32)wbfs_fat_vfs.f_frsize * (f32)wbfs_fat_vfs.f_bfree / GB_SIZE;
*used = size - *free;
return 0;
}