[core] fix large FAT32 formatting for > 1TB disks

* Closes #159
This commit is contained in:
Pete Batard 2013-09-22 03:28:56 +01:00
parent 55ef384277
commit 2945389edc
4 changed files with 23 additions and 24 deletions

View file

@ -213,11 +213,7 @@ static BOOL DefineClusterSizes(void)
// > 32GB FAT32 is not supported by MS and FormatEx but is achieved using fat32format
// See: http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm
// < 32 MB FAT32 is not allowed by FormatEx, so we don't bother
// We also found issues with > 1TB drives, so we use our own max threshold (can be disabled with Alt-S)
if ((size_check) && (1.0f*SelectedDrive.DiskSize >= 1.0f*MAX_FAT32_SIZE*TB))
uprintf("FAT32 support is disabled for this device, as it is larger than %.1f TB\n", 1.0f*MAX_FAT32_SIZE);
if ((SelectedDrive.DiskSize >= 32*MB) && ((!size_check) || (1.0f*SelectedDrive.DiskSize < 1.0f*MAX_FAT32_SIZE*TB))) {
if ((SelectedDrive.DiskSize >= 32*MB) && (1.0f*SelectedDrive.DiskSize < 1.0f*MAX_FAT32_SIZE*TB)) {
SelectedDrive.ClusterSize[FS_FAT32].Allowed = 0x000001F8;
for (i=32; i<=(32*1024); i<<=1) { // 32 MB -> 32 GB
if (SelectedDrive.DiskSize < i*MB) {