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:
parent
f05dec5702
commit
6fa25709d1
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue