fusee: fix sd card size detection for emummc

This commit is contained in:
Michael Scire authored and SciresM committed 2021-09-06 16:26:50 -07:00
1 parent 0ef9f7ccc8
commit 2247f97cdc
1 file changed
+3 -3
+3 -3
View File
@@ -44,7 +44,7 @@ namespace ams::nxboot {
u32 num_sectors;
R_TRY(GetSdCardMemoryCapacity(std::addressof(num_sectors)));
*out = num_sectors * sdmmc::SectorSize;
*out = static_cast<s64>(num_sectors) * static_cast<s64>(sdmmc::SectorSize);
return ResultSuccess();
}
@@ -439,8 +439,8 @@ namespace ams::nxboot {
continue;
}
const s64 offset = 0x200 * gpt->entries[i].starting_lba;
const u64 size = 0x200 * (gpt->entries[i].ending_lba + 1 - gpt->entries[i].starting_lba);
const s64 offset = INT64_C(0x200) * gpt->entries[i].starting_lba;
const u64 size = UINT64_C(0x200) * (gpt->entries[i].ending_lba + 1 - gpt->entries[i].starting_lba);
if (std::memcmp(gpt->entries[i].partition_name, SystemPartitionName, sizeof(SystemPartitionName)) == 0) {
g_system_storage = AllocateObject<SystemPartitionStorage>(offset, size);