By entering this site you need to consent to the use of cookies and their functional use according to this privacy policy. Cookies help us to provide the functional services of the website. Kindly read the below message of use and consent to the use.
The following cookies are stored and shared when accessing this website:
- Internal cookies for the MediaWiki site. This is used for user authentication and article modifications.
- Third-party cookies from Google providing services for Google AdSense and Google Analytics
We will never use data collected outside of the above scope.
The checksum stored in the above data frame header is then calculated using this checksum seed.
The checksum stored in the above data frame header is then calculated using this checksum seed.
+
+
First, the calc_checksum is initialized to 0. Then calc_checksum is added with ''all'' words in the data frame loaded as big-endian, with the data-frame checksum cleared to zero here. If the frame_size isn't word-aligned, the remaining <4-bytes are loaded as big-endian for adding as well.
+
+
Then this is run:
+
//During init before the above adding, shift and count are initialized:
+
//shift = (((u8*)&checksum_seed)[2] & 0xf) + 0x4;
+
//count = (((u8*)&checksum_seed)[3] & 0x7) + 0x2;
+
for(pos=0; pos<count; pos++)checksum = (checksum<<shift | checksum>>shift) ^ checksum_seed;//The u32 checksum_seed is byte-swapped on 3DS for this.
+
+
Lastly the calculated checksum is written to output as big-endian(hence on 3DS it's byte-swapped before writing to output).