forked from Mirror/GodMode9
Fix EmuNAND size detection
The full size NAND.bin will now turn up in EmuNAND virtual files, too!
This commit is contained in:
parent
c07686da7a
commit
10b79cfadb
@ -684,5 +684,5 @@ uint64_t GetPartitionOffsetSector(const char* path)
|
||||
int pdrv = PathToNumFS(path);
|
||||
if (pdrv < 0) return -1;
|
||||
|
||||
return (uint64_t) fs[pdrv].fatbase;
|
||||
return (uint64_t) fs[pdrv].volbase;
|
||||
}
|
||||
|
@ -195,7 +195,8 @@ u64 GetNandSizeSectors(bool size_emunand)
|
||||
u32 emunand_max_sectors = GetPartitionOffsetSector("0:") - (emunand_base_sector + 1); // +1 for safety
|
||||
u32 emunand_min_sectors = (emunand_base_sector % 0x200000 == 0) ? getMMCDevice(0)->total_size :
|
||||
(GetUnitPlatform() == PLATFORM_N3DS) ? 0x26C000 : 0x1D7800;
|
||||
return (emunand_min_sectors > emunand_max_sectors) ? 0 : emunand_min_sectors;
|
||||
if (emunand_max_sectors >= getMMCDevice(0)->total_size) return getMMCDevice(0)->total_size;
|
||||
else return (emunand_min_sectors > emunand_max_sectors) ? 0 : emunand_min_sectors;
|
||||
} else return getMMCDevice(0)->total_size; // for SysNAND
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user