[Horus] Attempt to fix the problem with some files after a massstorage session
This commit is contained in:
@@ -71,6 +71,11 @@ void DiskCacheBlock::free(DWORD sector, UINT count)
|
||||
}
|
||||
}
|
||||
|
||||
void DiskCacheBlock::free()
|
||||
{
|
||||
endSector = 0;
|
||||
}
|
||||
|
||||
bool DiskCacheBlock::empty() const
|
||||
{
|
||||
return (endSector == 0);
|
||||
@@ -84,6 +89,16 @@ DiskCache::DiskCache():
|
||||
blocks = new DiskCacheBlock[DISK_CACHE_BLOCKS_NUM];
|
||||
}
|
||||
|
||||
void DiskCache::clear()
|
||||
{
|
||||
lastBlock = 0;
|
||||
stats.noHits = 0;
|
||||
stats.noMisses = 0;
|
||||
for (int n=0; n<DISK_CACHE_BLOCKS_NUM; ++n) {
|
||||
blocks[n].free();
|
||||
}
|
||||
}
|
||||
|
||||
DRESULT DiskCache::read(BYTE drv, BYTE * buff, DWORD sector, UINT count)
|
||||
{
|
||||
// TODO: check if not caching first sectors would improve anything
|
||||
|
||||
Reference in New Issue
Block a user