Attempt at making blockdump loading faster, may go either way.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/async-iso@5470 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2012-12-02 01:43:15 +00:00
parent b9f8be3323
commit 1871750733
1 changed files with 21 additions and 5 deletions

View File

@ -70,11 +70,27 @@ bool BlockdumpFileReader::Open(const wxString& fileName)
m_file->SeekI(BlockDumpHeaderSize);
for (int i=0; i < m_dtablesize; ++i)
{
m_file->Read(&(m_dtable[i]), sizeof(m_dtable[i]));
m_file->SeekI(m_blocksize, wxFromCurrent);
}
u32 bs = 1024*1024;
u8* buffer = new u8[bs];
u32 off = 0;
u32 has = 0;
int i = 0;
do {
m_file->Read(buffer, bs);
has = m_file->LastRead();
while (i < m_dtablesize && off < has)
{
m_dtable[i++] = *(u32*)(buffer + off);
off += 4;
off += m_blocksize;
}
off -= has;
} while(has == bs);
delete[] buffer;
return true;
}