Im working on a personal project for my colleagues and myself that allows us to trade pokemon between our emulators via my third party app.

The app works by uploading the save to my private server. From there my server handles the trades.

Right now the server can unscramble the GBA save blocks and unencrypt the pokemon data, but I can't figure out how the checksum for GBA saves work. I've done much research but cant seem to find how the checksum is equated.

The closest I've gotten is adding 0xF80 bytes of a block together, then modulus that with 0xFFFF. This generally gets me about 0x40-0x150 bytes off of the actual checksum.

Does anyone have any idea how the checksum equation works? Once I get this down my server will be able to exchange the pokemon and recalculate the checksums of my colleagues and my saves.

Thank you very much for any help!