Cool!
If it's useful at all, here is an example from Canyon Racer, there are other ways to do it though.
https://github.com/bbbbbr/canyon-racer/blob/main/src/cart_mbc5/cartsave.c
https://github.com/bbbbbr/canyon-racer/blob/main/src/stats.c
A usual practice is to have a signature byte pattern and/or a checksum of the data to verify it's integrity and that it's not random data.