I am working I a ASM routine, but I can't understand how is the 16-bits checksum calculated.
I hope somebody can help me.
https://bulbapedia.bulbagarden.net/wiki/Pokémon_data_structure_in_Generation_III
This one? Just load halfwords (2 bytes) and add them together, then clear the upper 16 bits of the register. But if you're just doing something simple like reading or setting something in the Pokemon data you should really use the built-in functions.
I had read about this. I knew I had to add all data substructure values, but I knew the result would be greater than two bytes, so I had the doubt. But it is true, clearing the upper two bytes, both values match (my calculated value and the original value).
I am making a routine to edit the pokémon data. Really, I have already finished it, but I have always obtained a Bad Egg because I wasn't able to discover how checksum was made.
Thanks! ;D