| 311 | } |
| 312 | |
| 313 | unsigned long long FatSystem::clusterAddress(unsigned int cluster, bool isRoot) |
| 314 | { |
| 315 | if (type == FAT32 || !isRoot) { |
| 316 | cluster -= 2; |
| 317 | } |
| 318 | |
| 319 | unsigned long long addr = (dataStart + bytesPerSector*sectorsPerCluster*cluster); |
| 320 | |
| 321 | if (type == FAT16 && !isRoot) { |
| 322 | addr += rootEntries * FAT_ENTRY_SIZE; |
| 323 | } |
| 324 | |
| 325 | return addr; |
| 326 | } |
| 327 | |
| 328 | vector<FatEntry> FatSystem::getEntries(unsigned int cluster, int *clusters, bool *hasFree) |
| 329 | { |