• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 40 41 42 43 44 ... 117 Next »

An ignorable improvement for reading Wii ISO file
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
An ignorable improvement for reading Wii ISO file
10-21-2014, 04:17 PM
#1
SamSun
Unregistered
 
Tongue 
Hi,

I have found following code for reading Wii iso file may be optimized, although the improvement is ignorable under modern OS (ex: Windows)

When emulator read data from Wii iso file via VolumeWiiCrypted.cpp CVolumeWiiCrypted::Read (), it always reads 32Kbyte data, even only 1 byte is requested. This is strange.

// read current block
if (!m_pReader->Read(m_VolumeOffset + m_dataOffset + Block * 0x8000, 0x8000, m_pBuffer))
{
return(false);
}

if (m_LastDecryptedBlockOffset != Block)
{
memcpy(IV, m_pBuffer + 0x3d0, 16);
aes_crypt_cbc(m_AES_ctx.get(), AES_DECRYPT, 0x7C00, IV, m_pBuffer + 0x400, m_LastDecryptedBlock);

m_LastDecryptedBlockOffset = Block;
}


I think it can be optimized by following code:

if (m_LastDecryptedBlockOffset != Block)
{

if (!m_pReader->Read(m_VolumeOffset + dataOffset + Block * 0x8000, 0x8000, m_pBuffer))
return(false);

memcpy(IV, m_pBuffer + 0x3d0, 16);
aes_crypt_cbc(m_AES_ctx, AES_DECRYPT, 0x7C00, IV, m_pBuffer + 0x400, m_LastDecryptedBlock);


m_LastDecryptedBlockOffset = Block;
}
Reply
« Next Oldest | Next Newest »


Messages In This Thread
An ignorable improvement for reading Wii ISO file - SamSun - 10-21-2014, 04:17 PM
RE: An ignorable improvement for reading Wii ISO file - JMC47 - 10-22-2014, 06:23 AM
RE: An ignorable improvement for reading Wii ISO file - Buddybenj - 10-23-2014, 07:12 AM
RE: An ignorable improvement for reading Wii ISO file - Jack Frost - 10-24-2014, 02:25 AM
RE: An ignorable improvement for reading Wii ISO file - tueidj - 10-24-2014, 12:29 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 2 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode