updated GCMemcard to fix the header's checksum. sidenote: replace the first 0x13bytes of your raw memcard dumps with 0x0750B25EC2A150A9E2047343000000000B1B595C to use them in dolphin.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@908 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2008-10-18 05:19:44 +00:00
parent ad589b7b6b
commit cb14a17ff5
3 changed files with 39 additions and 27 deletions

View File

@ -591,6 +591,12 @@ bool GCMemcard::FixChecksums()
u16 csum1=0,csum2=0;
calc_checksumsBE((u16*)&hdr,0xFE,&csum1,&csum2);
hdr.CheckSum1[0]=u8(csum1>>8);
hdr.CheckSum1[1]=u8(csum1);
hdr.CheckSum2[0]=u8(csum2>>8);
hdr.CheckSum2[1]=u8(csum2);
calc_checksumsBE((u16*)&dir,0xFFE,&csum1,&csum2);
dir.CheckSum1[0]=u8(csum1>>8);
dir.CheckSum1[1]=u8(csum1);
@ -852,12 +858,14 @@ GCMemcard::GCMemcard(const char *filename)
// update checksums
csums = TestChecksums();
}
}
if(BE16(dir_backup.UpdateCounter) > BE16(dir.UpdateCounter)) //check if the backup is newer
{
dir = dir_backup;
bat = bat_backup; // needed?
// It seems that the backup having a larger counter doesn't necessarily mean
// the backup should be copied?
// }
//
// if(BE16(dir_backup.UpdateCounter) > BE16(dir.UpdateCounter)) //check if the backup is newer
// {
// dir = dir_backup;
// bat = bat_backup; // needed?
}
fseek(mcd,0xa000,SEEK_SET);