I disassembled the SMW save routine, the format is pretty simple. Basically what it does is:
1) Get the file index.
2) Index a table to get the SRAM address.
3) Copy the SRAM buffer to SRAM($1F49 which is actually a mirror of $7E:1EA2-$7E:1F2E).
4) While doing this it keeps a sum of the buffers contents, this is used to calculate the check sum complement.($8D contains the sum).
5) The check sum is subtracted from #$5A5A(the default checksum value) and written to SRAM as the last byte of the file.
6) Make a duplicate copy of the file, presumably this was to ensure data integrity. (Basically repeated from step 3, however 288 bytes are added to the SRAM index).
You can find a commented routine here.
Anyways, somebody should probably wiki this.
1) Get the file index.
2) Index a table to get the SRAM address.
3) Copy the SRAM buffer to SRAM($1F49 which is actually a mirror of $7E:1EA2-$7E:1F2E).
4) While doing this it keeps a sum of the buffers contents, this is used to calculate the check sum complement.($8D contains the sum).
5) The check sum is subtracted from #$5A5A(the default checksum value) and written to SRAM as the last byte of the file.
6) Make a duplicate copy of the file, presumably this was to ensure data integrity. (Basically repeated from step 3, however 288 bytes are added to the SRAM index).
You can find a commented routine here.
Anyways, somebody should probably wiki this.