how to do checksum with formula for motronic 4.4 ?

Discuss anything TunerPro related.

Moderators: Mangus, robertisaar, dex

Post Reply
moon_walk
Posts: 17
Joined: Wed May 06, 2009 4:56 am
Location: Sweden
Contact:

how to do checksum with formula for motronic 4.4 ?

Post by moon_walk »

didn't quite get how to translate this formula into tunerpro ..



2. Fixing checksums

Your M4.4 file has two checksums (one for block 0 - file offset 0x0 - 0xFEFF, and another for block 1 - file offset 0x10000 - 0x1FEFF). After you made corrections in those regions (like lambda disabling) - checksums must be recalculated.
Checksum for block 0 is stored at file offset 0xFF00, and for block 1 at file offset 0x1FF00. Ok, checksum procedure is exactly the same for both blocks, its just incrementally adding bytes to 16-bit word. Trivial C code below does the trick just fine:

CODE
volvocrc1=0;for (i = 0x0; i < 0xFF00; i++ ) volvocrc1+=GetFileByteAtOffset(i);volvocrc2=0;for (i = 0x10000; i < 0x1FF00; i++ ) volvocrc2+=GetFileByteAtOffset(i);
Driving Volvo 960 2.8l Twinturbo
proud owner of ostrich 2 and tunerpro RT
Post Reply