I use the Checksum functions a lot, and to be honest the docs are somewhat lacking. I have never got chaining of Checksums to work for example, but here is a different issue. I am using the iNES plugin from the template library, the first function does not work, yet the array method does. Anyone any ideas? The Rom size is correct.
local uint rom_size;
rom_size=header.prgSize * 16 * 1024+header.chrSize * 8 * 1024;
Printf(“Total SIze of Program and Character ROM is %X”,rom_size);
full_crc=Checksum(CHECKSUM_CRC32,prg[0],((header.prgSize * 16 * 1024)+(header.chrSize * 8 * 1024)));
// Calculate using Array
local ubyte full_crc_array [header.prgSize * 16 * 1024+header.chrSize * 8 * 1024];
local uchar full_array_result[4];
for (i=0;i<(header.prgSize * 16 * 1024);i++)
{
full_crc_array[i]=prg[i];
}
for (i=0;i<(header.chrSize * 8 * 1024); i++)
{
full_crc_array[i+(header.prgSize * 16 * 1024)]=chr[i];
}
ChecksumAlgArrayBytes(CHECKSUM_CRC32,full_array_result,full_crc_array,(header.prgSize * 16 * 1024)+(header.chrSize * 8 * 1024));
Printf("\nFull CRC32 using array method");
for (i=0;i<4;i++)
{
Printf("%X",full_array_result[i]);
}