We all agree it needs some sort of overhaul. We need to unify everything in something more simple and coherent. Here's how it started:
- It started with mmc.s/fat.c base for things like Uzeamp. Though I always found it annoying it only supported reading and no supports for fragmentation.
- I added some primitive streaming code for Uzeamp
- I later added FatFS for those needing full a full FAT API and petitFatFs for a lightweight version. Though both uses there own mmc low level lib.
Some ideas and comments:
- Have only one low level lib (the mmc thing) at the kernel level. Adjust fatfs to use it or use theirs.
- Use fatfs for all FAT functions to locate files, search directories, write files, etc
- Develop new Uzebox APIs for streaming and other SD stuff that would uses fatfs structures. The idea is to not reinvent the wheel for the FAT stuff and have optimized functions at the same time for streaming.
- Should we consider SDHC at this point?
- Those new APIs will probably not support fragmentation for speed reasons. We should have a function that checks the files for fragmentation and warn the user. Eh, that or defragment the file when the game starts!