From 284e3ec211536041cda4b754d594302f6fb9a161 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Wed, 24 Sep 2008 18:18:09 +0000 Subject: [PATCH] Enabled checksum saving. This should give a reasonably ambitious person a fair chance to upgrade his savegames to the new version. - Please remember to make backups before any attempts to try it. I tried it with SSBM PAL and Mario Sunshine NTSC so I'm confident that it works, just try again if it fails. Usage: Open your savefile, for example MemoryCardA.raw in a hex editor and update the gamecode and makercode according to yagcd 12.3.1 for the game you want to fix. And remember to update the tag on both locations, both Directory and Directory backup as explained in yagcd. Then open the file, still MemoryCardA.raw or whatever it's called in the Memcard manager (found under the Misc menu). That should correct the checksums. You don't need to do anything else after that, don't click Copy for example. Just close the Memcard manager and use the savefile in the latest revision. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@667 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/MemcardManager.cpp | 2 ++ .../Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Source/Core/DolphinWX/Src/MemcardManager.cpp b/Source/Core/DolphinWX/Src/MemcardManager.cpp index 74a699fac6..8cbc33dfe6 100644 --- a/Source/Core/DolphinWX/Src/MemcardManager.cpp +++ b/Source/Core/DolphinWX/Src/MemcardManager.cpp @@ -221,6 +221,8 @@ void CMemcardManager::ReloadMemcard(const char *fileName, int card) // TODO: add error checking and animate icons memoryCard[card] = new GCMemcard(fileName); + memoryCard[0]->Save(); // save the changes we made in TestChecksums + m_MemcardList[card]->Hide(); m_MemcardList[card]->ClearAll(); m_MemcardList[card]->InsertColumn(COLUMN_BANNER, _T("Banner")); diff --git a/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp b/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp index 9bad19fa50..7d6c8eaffd 100644 --- a/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp +++ b/Source/Core/DolphinWX/Src/MemoryCards/GCMemcard.cpp @@ -525,10 +525,26 @@ u32 GCMemcard::TestChecksums() if(BE16(dir.CheckSum1)!=csum1) results |= 2; if(BE16(dir.CheckSum2)!=csum2) results |= 2; + // ------------------------------------------------------------------------------------------ + // Save the checksums we just calculated + dir.CheckSum1[0]=u8(csum1>>8); + dir.CheckSum1[1]=u8(csum1); + dir.CheckSum2[0]=u8(csum2>>8); + dir.CheckSum2[1]=u8(csum2); + // ------------------------------------------------------------------------------------------ + calc_checksumsBE((u16*)&dir_backup,0xFFE,&csum1,&csum2); if(BE16(dir_backup.CheckSum1)!=csum1) results |= 4; if(BE16(dir_backup.CheckSum2)!=csum2) results |= 4; + // ------------------------------------------------------------------------------------------ + // Save the checksums we just calculated + dir_backup.CheckSum1[0]=u8(csum1>>8); + dir_backup.CheckSum1[1]=u8(csum1); + dir_backup.CheckSum2[0]=u8(csum2>>8); + dir_backup.CheckSum2[1]=u8(csum2); + // ------------------------------------------------------------------------------------------ + calc_checksumsBE((u16*)(((u8*)&bat)+4),0xFFE,&csum1,&csum2); if(BE16(bat.CheckSum1)!=csum1) results |= 8; if(BE16(bat.CheckSum2)!=csum2) results |= 8;