• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Calculate checksum

jota_rdk

Spanish hacker [Javi4315]
  • 98
    Posts
    14
    Years
    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
     
    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

    No problem. If you tell me your ROM's code, I can tell you the address of a function you can call that sorts all of this out for you. It's the function that the engine uses to edit Pokemon data. To avoid wasted space it's recommended that you use it.
     
    Back
    Top