- if current sector is not in cache the starting sector to read from disc needs to be recalculated to be a multiple of sectorsPerPage

This commit is contained in:
Michael Wiedenbauer 2009-06-08 21:00:42 +00:00
parent 245ac2fee5
commit 5324215493

View File

@ -139,6 +139,7 @@ static CACHE_ENTRY* _FAT_cache_getPage(CACHE *cache,sec_t sector)
cacheEntries[oldUsed].dirty = false;
}
sector = (sector/sectorsPerPage)*sectorsPerPage;
if(!_FAT_disc_readSectors(cache->disc,sector,sectorsPerPage,cacheEntries[oldUsed].cache)) return NULL;
cacheEntries[oldUsed].sector = sector;