Today I disassembled MoonShell2.10 to compare FAT_LinkFreeCluster()
and_FAT_fat_linkFreeCluster().
Both "modified gba_nds_fat" and libfat had:
---
if ((curLink >= CLUSTER_FIRST) && (curLink <= fatLastCluster))
{
return curLink; // Return the current link - don't allocate a new one
}
---
But "Update the linked from FAT entry" part was different. libfat uses:
---
if ((cluster >= CLUSTER_FIRST) && (cluster < fatLastCluster))
{
// Update the linked from FAT entry
FAT_WriteFatEntry (cluster, firstFree);
}
---
But "modified gba_nds_fat" uses:
---
if ((cluster >= CLUSTER_FIRST) && (cluster <= fatLastCluster)) //////
{
// Update the linked from FAT entry
FAT_WriteFatEntry (cluster, firstFree);
}
---
So if you check the correctness of cluster param, as fatLastCluster is
a valid cluster, also libfat should use the latter check; I think
libfat has a bug.
So could you check the part?
I hope I'll hear from you soon.
Sincerely, Xenon
Issue of libfat?
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Issue of libfat?
Would have helped a bit if you'd quoted the actual code from libfat rather than the old gba_nds_fat code. Took me a while to find the code you referred to. A fairly minor issue really, it would only have prevented the last cluster of the card being allocated but it's fixed in svn now.
Who is online
Users browsing this forum: No registered users and 1 guest