mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix for read from raw drive on some machines,
must have been a fluke that it worked for me and a few others thanks to shuffle2 and daxtsu for testing patch some linux compile fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2360 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -36,7 +36,7 @@ namespace DiscIO
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSectorSize(2048);
|
||||
SectorReader::SetSectorSize(2048);
|
||||
#ifdef _LOCKDRIVE
|
||||
// Lock the compact disc in the CD-ROM drive to prevent accidental
|
||||
// removal while reading from it.
|
||||
@ -127,27 +127,17 @@ namespace DiscIO
|
||||
delete lpSector;
|
||||
}
|
||||
|
||||
void DriveReader::SetSectorSize(int blocksize)
|
||||
{
|
||||
for (int i = 0; i < CACHE_SIZE; i++)
|
||||
{
|
||||
cache[i] = new u8[blocksize];
|
||||
cache_tags[i] = (u64)(s64) - 1;
|
||||
}
|
||||
m_blocksize = blocksize;
|
||||
}
|
||||
|
||||
const u8 *DriveReader::GetBlockData(u64 block_num)
|
||||
{
|
||||
if (cache_tags[0] == block_num)
|
||||
if (SectorReader::cache_tags[0] == block_num)
|
||||
{
|
||||
return cache[0];
|
||||
return SectorReader::cache[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
GetBlock(block_num, cache[0]);
|
||||
cache_tags[0] = block_num;
|
||||
return cache[0];
|
||||
SectorReader::cache_tags[0] = block_num;
|
||||
return SectorReader::cache[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user