#80833 - Dwedit - Tue Apr 25, 2006 8:22 pm
What part of reading sectors takes the most time, is it waiting for the sector to become available, or the memory copy itself? If it's a polling loop wait, I think the wasted CPU time should be used to execute other code, then check back periodicly to see if the sector has become available.
If it would make a big difference, I think the FAT API could use "fread_background" or something like that. It would read the file in the background, maybe execute a callback when it's finished.
void fread_background(FILE, dest, int* bytesread, FP callback, void* callbackdata);
Of course this would require a lot, such as setting up timer interrupts and everything.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
If it would make a big difference, I think the FAT API could use "fread_background" or something like that. It would read the file in the background, maybe execute a callback when it's finished.
void fread_background(FILE, dest, int* bytesread, FP callback, void* callbackdata);
Of course this would require a lot, such as setting up timer interrupts and everything.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."