RCT FILE CHECKSUMS

Back to RCT home

RollerCoaster Tycoon track files and original RCT use a single checksum appended to the end of the RLE encoded data. The expansion pack Added Attractions/Corkscrew Follies utilizes and additional checksum which is applied to the data while it is not encoded. This page describes the two checksum calculations.

The following technique is used to calculate the checksum for the RLE encoded files:

1) initialize a 32 bit SUMMATION register to zero

2) read a byte

3) add that byte to the lower 8 bits of the SUMMATION register. Do NOT allow a cary into the remaining 24 bits.

TEMP = SUMMATION + DATABYTE
SUMMATION = (SUMMATION AND FFFFFF00) OR (TEMP AND 000000FF)

4) rotate the SUMMATION register to the left by three bits

5) if not end of file, loop back to step 2

6) after the file is completely read (do not read existing checksums) modify SUMMATION as follows:

RCT

AA/CF

LL

TD4 -108156 -108156 -120001
SV4 +108156 +110001 +120001
SC4 -108156 -110001 -120001

*A similar technique was reportedly used in TransportTycoon with the value 105116 for the save file, 201100 for TransportTycoon Deluxe save files and -201100 for TTD title.dat

7) put the 4 bytes of SUMMATION on the end of the file, least significant byte first.


The following technique is used to calculate the "second" checksum for the SV4 and SC4 files in the expansion pack. This checksum is placed in the last 4 bytes of the data area.

1) initialize a 32 bit SUMMATION register to 00000031

2) rotate the SUMMATION register to the left by thirteen bits

3) read a byte

4) add that byte to the lower 8 bits of the SUMMATION register. Do NOT allow a cary into the remaining 24 bits.

TEMP = SUMMATION + DATABYTE
SUMMATION = (SUMMATION AND FFFFFF00) OR (TEMP AND 000000FF)

5) if not end of file, loop back to step 2

7) put the 4 bytes of SUMMATION in the last four bytes of the data area.