cdvdgigaherz: Add cache entry check function

Useful when you don't actually want the cached data.
This commit is contained in:
Jonathan Li 2016-11-16 20:50:36 +00:00 committed by Gregory Hainaut
parent 23f48e07ed
commit bb25ce1c6a
1 changed files with 8 additions and 0 deletions

View File

@ -77,6 +77,14 @@ void cdvdCacheUpdate(u32 lsn, s32 mode, u8 *data)
Cache[entry].mode = mode;
}
bool cdvdCacheCheck(u32 lsn, s32 mode)
{
std::lock_guard<std::mutex> guard(s_cache_lock);
u32 entry = cdvdSectorHash(lsn, mode);
return Cache[entry].lsn == lsn && Cache[entry].mode == mode;
}
bool cdvdCacheFetch(u32 lsn, s32 mode, u8 *data)
{
std::lock_guard<std::mutex> guard(s_cache_lock);