#107148 - Dwedit - Fri Oct 27, 2006 5:33 am
This probably requires that the DS or GBA have some kind of operating system to handle task switching, but it looks like a huge possible speed improvement to the FAT library.
There are time where the FAT library spinlocks on when the disk is ready, and on when the data becomes available. Since afterwards, the transfer is quick, I think that the spinlock should be converted into timed polling, and while it's busy, yield the processor to another task.
This could allow an API including functions like fread_background, which would update a size counter indicating how much has been read, so a file could call this, test if enough has been transferred into a buffer, then work on what data is available. Data could be processed during the time formerly used for spinlock. I think it could speed up media-playback programs quite a bit.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
There are time where the FAT library spinlocks on when the disk is ready, and on when the data becomes available. Since afterwards, the transfer is quick, I think that the spinlock should be converted into timed polling, and while it's busy, yield the processor to another task.
This could allow an API including functions like fread_background, which would update a size counter indicating how much has been read, so a file could call this, test if enough has been transferred into a buffer, then work on what data is available. Data could be processed during the time formerly used for spinlock. I think it could speed up media-playback programs quite a bit.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."