This repository was archived by the owner on Jun 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
FAT fragmentation is not handled at all #1
Copy link
Copy link
Open
Labels
Description
When the file system on SD gets fragmented (by adding and removing small files) alt64 will be unable to read some files correctly, especially when loading ROMs. See:
Lines 1315 to 1322 in 3ba0910
| if(mb<=32){ | |
| resp = diskRead(begin_sector, (void *)0xb0000000, file_sectors); //2048 cluster 1Mb | |
| } | |
| else{ | |
| resp = diskRead(begin_sector, (void *)0xb0000000, lower_half); | |
| sleep(10); | |
| resp = diskRead(begin_sector+lower_half, (void *)0xb2000000, file_sectors-lower_half); | |
| } |
The issue is that the code assumes there is no fragmentation, so it just does a pure DMA from SD, starting with the first sector in the FAT.
A fragmented ROM will be read incorrectly, and usually will not boot. (Or it may boot and crash later, or have other strange errors.)
Reactions are currently unavailable