フォントとcertがNandに既に存在し、かつROMのデータとベリファイで一致した場合、書き込みをスキップするように変更。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2578 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
kamikawa 2008-10-03 00:24:54 +00:00
parent b581151c91
commit f6f5ab0437

View File

@ -70,6 +70,32 @@ BOOL kamiCopyFile(char* srcPath, char* dstPath)
// ROMファイルクローズ
FS_CloseFile(&file);
// ターゲットファイルオープン
FS_InitFile(&file);
if (FS_OpenFile(&file, dstPath))
{
void* pVerifyBuf;
// NANDファイルリード
pVerifyBuf = OS_Alloc( alloc_size );
SDK_NULL_ASSERT(pVerifyBuf);
DC_InvalidateRange(pVerifyBuf, alloc_size);
read_is_ok = FS_ReadFile( &file, pVerifyBuf, (s32)file_size );
if (read_is_ok)
{
DC_FlushRange(pTempBuf, alloc_size);
DC_FlushRange(pVerifyBuf, alloc_size);
if (!MI_CpuComp8(pTempBuf, pVerifyBuf, file_size))
{
FS_CloseFile(&file);
OS_Free(pTempBuf);
return TRUE;
}
}
FS_CloseFile(&file);
OS_Free(pTempBuf);
}
// 一旦対象データを削除する
(void)FS_DeleteFile(dstPath);