Fix bug, reenable the drive optimization.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2370 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-02-22 16:59:22 +00:00
parent 925a66d498
commit 8224c3b449
1 changed files with 3 additions and 2 deletions

View File

@ -70,13 +70,14 @@ bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
while (remain > 0) while (remain > 0)
{ {
// Check if we are ready to do a large block read. > instead of >= so we don't bother if remain is only one block. // Check if we are ready to do a large block read. > instead of >= so we don't bother if remain is only one block.
if (positionInBlock == 0 && remain > m_blocksize && false) if (positionInBlock == 0 && remain > m_blocksize)
{ {
u64 num_blocks = remain / m_blocksize; u64 num_blocks = remain / m_blocksize;
ReadMultipleAlignedBlocks(block, num_blocks, out_ptr); ReadMultipleAlignedBlocks(block, num_blocks, out_ptr);
block += num_blocks; block += num_blocks;
out_ptr += num_blocks * m_blocksize; out_ptr += num_blocks * m_blocksize;
remain -= num_blocks * m_blocksize; remain -= num_blocks * m_blocksize;
continue;
} }
u32 toCopy = m_blocksize - positionInBlock; u32 toCopy = m_blocksize - positionInBlock;
@ -113,7 +114,7 @@ bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *
const u8 *data = GetBlockData(block_num + i); const u8 *data = GetBlockData(block_num + i);
if (!data) if (!data)
return false; return false;
memcpy(out_ptr, data, m_blocksize); memcpy(out_ptr + i * m_blocksize, data, m_blocksize);
} }
return true; return true;
} }