checksum calculation was wrong (must be the sum of unscrambled), thanks Jens

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5462 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2004-11-24 00:11:18 +00:00
parent f05dec5702
commit 6fa25709d1

View file

@ -113,7 +113,12 @@ int main(int argc, char* argv[])
// generate checksum // generate checksum
for (i=0; i<uiSize; i++) for (i=0; i<uiSize; i++)
usChecksum += aImage[uiStart + i]; {
UINT8 byte;
byte = aImage[uiStart + i];
byte = ~((byte >> 1) | ((byte << 7) & 0x80)); /* poor man's ROR */
usChecksum += byte;
}
// make header // make header
Write32(aHeader + 2, usChecksum); // checksum in 5th and 6th byte Write32(aHeader + 2, usChecksum); // checksum in 5th and 6th byte