#97803 - josath - Fri Aug 11, 2006 5:29 pm
This is mainly for chishm, but perhaps someone else with experience knows some answers.
Hello, I've been doing some experimentation with FCSR, so I can create a FAT image builder (crossplatform), that way people can use the same code for both media-based carts, and flash carts.
When using the old gba_nds_fat (chishm's latest, with sata's drivers, plus wintermute's bugfixes), FCSR seems to work as expected.
When using libfat, it seems very buggy: (note, in order to test FCSR on my SC CF, I had to disable the other flashcard drivers. I did this by removing everything except &_io_fcsr from ioInterfaces[] in disc.c. Is this the right way to do it?)
1. fatInitDefault() works, returning 1
2. fopen() works on a file which exists in the FAT image, and fails on a file that doesn't exist (as expected)
3. fread() always reads only 0 bytes, when file opened successfully.
4. the 4th time I call fopen (of course I called fclose after the other ones), it locks up (doesn't return to my code)
I tried different sizes of fat images, fat 12 and fat 16, everything i could think of. it always failed.
Back to gba_nds_fat: It seems to work great, including the SRAM overlay. My only problem, is how do I know which sectors to set to the overlay? If I make a 64KB FAT image, then it's easy, I simply tell it to overlay the whole thing. Generally, what I want to do, is have a FAT image with 64KB of free space, and place the overlay there, and force all writes to go into that area only. If writes go into some other area which is not in the overlay, the writes work, and I can read it back again (I'm assuming due to cache), but it does not persist over powercycles.
*EDIT*: See my other post where I compiled dsdoom with a FAT image
Hello, I've been doing some experimentation with FCSR, so I can create a FAT image builder (crossplatform), that way people can use the same code for both media-based carts, and flash carts.
When using the old gba_nds_fat (chishm's latest, with sata's drivers, plus wintermute's bugfixes), FCSR seems to work as expected.
When using libfat, it seems very buggy: (note, in order to test FCSR on my SC CF, I had to disable the other flashcard drivers. I did this by removing everything except &_io_fcsr from ioInterfaces[] in disc.c. Is this the right way to do it?)
1. fatInitDefault() works, returning 1
2. fopen() works on a file which exists in the FAT image, and fails on a file that doesn't exist (as expected)
3. fread() always reads only 0 bytes, when file opened successfully.
4. the 4th time I call fopen (of course I called fclose after the other ones), it locks up (doesn't return to my code)
I tried different sizes of fat images, fat 12 and fat 16, everything i could think of. it always failed.
Back to gba_nds_fat: It seems to work great, including the SRAM overlay. My only problem, is how do I know which sectors to set to the overlay? If I make a 64KB FAT image, then it's easy, I simply tell it to overlay the whole thing. Generally, what I want to do, is have a FAT image with 64KB of free space, and place the overlay there, and force all writes to go into that area only. If writes go into some other area which is not in the overlay, the writes work, and I can read it back again (I'm assuming due to cache), but it does not persist over powercycles.
*EDIT*: See my other post where I compiled dsdoom with a FAT image