Save game SV5 checksum calculation
Posted: 27 Nov 2016 03:38
Hi all,
I'm working on a save game editor for fun but I've run across an issue with calculating the checksum of the save game.
I've read that loco uses (more or less) the same save file encoding as RCT2's SV6 files and the RCT Tech Info Depot states that "The last four bytes of the file is a simple checksum - formed by starting with zero and adding each byte of the file to a 32 bit variable."
I'm able to successfully decode and re-encode the save data, however the checksum doesn't actually seem to be the sum of all bytes in the file. I know this because I have a normal save file that has a checksum of 8381400b (2206285835 in decimal) but when I calculate the sum of all the bytes from either the decoded or encoded file, I only end up with 188777170 and 157339111 in decimal -- more than 11 times less than what I expected.
Does anyone have any insight into how the save file checksum is generated? Am I missing something?
Thanks
I'm working on a save game editor for fun but I've run across an issue with calculating the checksum of the save game.
I've read that loco uses (more or less) the same save file encoding as RCT2's SV6 files and the RCT Tech Info Depot states that "The last four bytes of the file is a simple checksum - formed by starting with zero and adding each byte of the file to a 32 bit variable."
I'm able to successfully decode and re-encode the save data, however the checksum doesn't actually seem to be the sum of all bytes in the file. I know this because I have a normal save file that has a checksum of 8381400b (2206285835 in decimal) but when I calculate the sum of all the bytes from either the decoded or encoded file, I only end up with 188777170 and 157339111 in decimal -- more than 11 times less than what I expected.
Does anyone have any insight into how the save file checksum is generated? Am I missing something?
Thanks