Ejemplo n.º 1
0
void cdvdCacheUpdate(int lsn, int mode, char* data)
{
	EnterCriticalSection( &CacheMutex );
	u32 entry = cdvdSectorHash(lsn,mode);

	memcpy(Cache[entry].data,data,2352*16);
	Cache[entry].lsn = lsn;
	Cache[entry].mode = mode;
	LeaveCriticalSection( &CacheMutex );
}
Ejemplo n.º 2
0
bool cdvdCacheFetch(int lsn, int mode, char *data)
{
    EnterCriticalSection(&CacheMutex);
    u32 entry = cdvdSectorHash(lsn, mode);

    if ((Cache[entry].lsn == lsn) &&
        (Cache[entry].mode == mode)) {
        memcpy(data, Cache[entry].data, 2352 * 16);
        LeaveCriticalSection(&CacheMutex);
        return true;
    }
    //printf("NOT IN CACHE\n");
    LeaveCriticalSection(&CacheMutex);
    return false;
}