• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

How to "convert" SC saves to R4/M3S on Linux/MAC

Started by SukkoPera, January 27, 2007, 11:15:58 AM

Previous topic - Next topic

SukkoPera

AFAIK, both SC and R4 save files are raw SRAM dumps. SC uses 256 KB files, while R4/M3S uses 512 KB files.

All the "official" converters do is pad SC save files to 512 KB, appending 0xFF bytes. This can easily be done using a couple of UNIX commands.

In the following:
- "0735 - Castlevania - Portrait of Ruin (U).nds.sav" is the SC savefile.
- "0735.sav" is the file we are creating for use with the R4/M3S.
- "0735 - Castlevania - Portrait of Ruin (U).sav" is the SC savefile converted by the official converter, just for comparison.

sukko@unholycathedral ~ $ dd if=/dev/zero bs=1k count=512 | tr "\000" "\377" > 0735.sav
512+0 records in
512+0 records out
524288 bytes (524 kB) copied, 0,015553 seconds, 33,7 MB/s

sukko@unholycathedral ~ $ dd if=0735\ -\ Castlevania\ -\ Portrait\ of\ Ruin\ \(U\).nds.sav of=0735.sav conv=notrunc
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 0,0782351 seconds, 3,4 MB/s

sukko@unholycathedral ~ $ md5sum 0735*
96c248da4a3f98c727aa179a6b40715a  0735 - Castlevania - Portrait of Ruin (U).nds.sav
0d5131064c04fef2a0eade7bf99ed59f  0735 - Castlevania - Portrait of Ruin (U).sav
0d5131064c04fef2a0eade7bf99ed59f  0735.sav


Probably the "tr" stuff isn't necessary even (the resulting savefile will be padded with zeroes, but should still work), but this way the converted savefiles are exactly the same as those made by the official converter, as the MD5s show. Anyway then it would be matter of a single command:

cat 0735\ -\ Castlevania\ -\ Portrait\ of\ Ruin\ \(U\).nds.sav /dev/zero | dd bs=1k count=512 > 0735.sav

Just reply if you need further info :). As MacOS X has an underlying UNIX system, these commands should work there, too, please report.
intendo DS Lite (White) + Supercard Lite + R4 + Sandisk 1 GB MicroSD
Sony PSP + Firmware 3.03 OE-A2