I am having a hard time coming up with an algorithm that calculates the checksum of an snes rom.
Can somebody tell me if my assumptions here are correct?
For simplicity sake, I will pretend that a rom is only 16-32 bytes long.
For 16 bytes, it would seem that the checksum is straightforward.
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
0100 + 0302 + 0504 + 0706 + 0908 + 0b0a + 0d0c + 0f0e = 4038
For 18 bytes, it would be a bit more complicated.
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 - This becomes
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 10 11 10 11 10 11 10 11 10 11 10 11 10 11
0100 + 0302 + 0504 + 0706 + 0908 + 0B0A + 0D0C + 0F0E + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 = C8B8
Can somebody tell me if my assumptions here are correct?
For simplicity sake, I will pretend that a rom is only 16-32 bytes long.
For 16 bytes, it would seem that the checksum is straightforward.
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
0100 + 0302 + 0504 + 0706 + 0908 + 0b0a + 0d0c + 0f0e = 4038
For 18 bytes, it would be a bit more complicated.
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 - This becomes
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 10 11 10 11 10 11 10 11 10 11 10 11 10 11
0100 + 0302 + 0504 + 0706 + 0908 + 0B0A + 0D0C + 0F0E + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 + 1110 = C8B8
Statistics: Posted by uglyoldbob — Mon Jan 22, 2024 5:21 pm — Replies 8 — Views 442