gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Corrupted flash cards

#155539 - ingramb - Wed Apr 30, 2008 7:55 pm

I'm getting reports that NeoDS has corrupted a few people's flash cards.

I have modified libfat slightly. Basically, I keep lookup table that maps file offsets to sectors. This allows faster seeking without having to walk along all the sectors in the file. All the changes should be in fatfile.c, and there aren't many.

Does anyone have any idea of what could be corrupting cards? Do my modifications sound (or look) dangerous? Maybe just a buggy dldi driver? What about if NeoDS crashes with an open file? Could that cause corruption?

Any help is appreciated.

#155541 - Dwedit - Wed Apr 30, 2008 8:43 pm

As long as this is for reads only, it should be okay. But once the lookup tables no longer match the FAT, you got problems.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#155544 - ingramb - Wed Apr 30, 2008 9:06 pm

Yah. Currently, I never open files for writing.

In theory, it should be simple to invalidate and recreate the table whenever a file is written to.

#155547 - Dwedit - Wed Apr 30, 2008 9:14 pm

Does libfat change file's "last accessed" times?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."