• Welcome to SCdev.org. Please log in.

Welcome to the new SCdev forums!

How-To: Manage DS cart gamesaves with SavSender

Started by dantheman, April 29, 2007, 08:26:46 PM

Previous topic - Next topic

dantheman

Up until the time of writing, REINMOON (link down) and EEPINATOR have been the most widely used tools used to backup savegames from original DS cartridges.  However, REINMOON requires a supported slot-2 device, and while EEPINATOR could theoretically be used on a slot-1 device through cart-swapping, this fails on most slot-1 devices.  For example, the R4 and M3 Simply do not reinitalize the FAT filesystem until the DS is power cycled, which means that the save file cannot be written to the filesystem, while the DS-Xtreme simply reboots the entire DS upon reinsertion.

However, this is now changing due to a new program that transfers the save file wirelessly to your computer.  This program is called SavSender.  Using SavSender, one can backup and restore saves to and from original DS cartridges via Wifi.

EDIT:  SavSender appears to only work with games that use save files 256 KB in size or less.  For instance, using SavSender with the DS Pokemon games is not recommended.  A newer program called Rudolph's NDS Backup Tool is available that can manage save files using either a slot-2 device, a slot-1 device via wifi (very similar to SavSender but using an FTP server), or a slot-2 EZ-Flash 3in1 expansion pack.  See the GBATemp download center for these downloads.

The method proposed in this guide, which uses NetCat, is confirmed to work on Windows Vista.

What You Need
1.  A homebrew device capable of DLDI (read-only is fine)
2.  The actual SavSender program itself.  Download the DS binary from http://frodo.dyn.gno.org/~brettk/savsender EDIT: homepage is down, so get v1.1b from the attachment at the end of this post (login required)
3.  Netcat - Netcat is a "Swiss Army Knife" utility for reading and writing data across a network.  Originating on the UNIX operating system, it has been ported to Windows.  Download it from http://www.vulnwatch.org/netcat/ and copy or move the nc.exe program to your working folder.  EDIT:  link is down, so get it from the attachment at the end of this post (login required)
4.  knowledge of the command-line and how to navigate through directories using the "cd" command.
5.  A DS game cartridge
6.  Your DS must already work with other wireless homebrew apps.
--See this GBAdev thread and this DS-X wiki article if you need help with this step

Beginning Steps
1.  Ensure that file extensions are visible by default.  In Windows Explorer, go to Tools - Folder Options - "View" tab - uncheck "hide extensions for known filetyes"
2.  Patch savsender.nds with the correct DLDI patch for your device and place it on your media card
3.  On the root of your media card, create a "DATA" folder if not already present.  In this folder, create a "SETTINGS" folder. 
4.  In this "SETTINGS" folder, create a new text document called "savsender.conf" and open it with Notepad.
5.  press Start - Run - type "CMD" and hit Enter - type "IPCONFIG /all" and ht Enter
6.  In the savsender.conf file, enter the IP address that ipconfig tells you, press Enter, and type the port number you wish to use.  A sample config file may look like this:
Quote192.168.1.123
5000
7.  Open your router's settings page and find the section for Port Forwarding.  Create a new setting that forwards all traffic on the designated port (in my example, 5000) to your computer's IP address (in my example, 192.168.1.123)
8.  Open a command prompt and navigate to the location where nc.exe is.  If you don't know how to do this, do the following:
--8.1.  Put nc.exe on your desktop
--8.2.  press Start - Run - type "cmd" and hit Enter
--8.3.  type "cd desktop" and hit Enter
9.  Follow the steps below based on whether you wish to dump or restore the save game.

Option A:  Dumping Saves
1.  In the command prompt you just opened, type the following command:
nc.exe -l -p 1234 > savefile.sav
(that's a lowercase L in "-l", not a number 1) where 1234 is the port number you specified in savsender.conf (in my example, 5000) and "savefile.sav" is the name of the file you wish to save as.  If your firewall asks you to allow traffic by the program, accept it.  Leave this window running even though it looks like it's doing nothing.
2.  Put your microSD card in your slot-1 device and boot it up. 
3.  It will tell you to press A to dump the save file, so swap to the official DS cartridge and then press A.
4.  It will automatically detect the save file and send it over Wifi to your computer.  Once it says "Done!" you may turn off your DS. 
5.  Go to the command prompt window that has netcat running and press CTRL+C to kill it if necessary before typing "exit" and hitting Enter.

Option B:  Restoring Saves
1.  In the command prompt you just opened, type the following command:
nc.exe -l -p 1234 < savefile.sav
(that's a lowercase L in "-l", not a number 1) where 1234 is the port number you specified in savsender.conf (in my example, 5000) and "savefile.sav" is the name of the save file you wish to restore to your DS cartridge.  If your firewall asks you to allow traffic by the program, accept it.  Leave this window running even though it looks like it's doing nothing.
---note that this looks nearly identical to the command for dumping saves, the only difference being that the > sign is flipped to a < sign
2.  Put your microSD card in your slot-1 device and boot it up. 
3.  It will tell you to press B to restore the save file to the DS cart, so swap to the official DS cartridge and then press B.
4.  It should connect to your computer and download the "savefile.sav" file, inserting it into the DS game cart.  Once it says "Done!" you may turn off your DS. 
5.  Go to the command prompt window that has netcat running and press CTRL+C to kill it if necessary before typing "exit" and hitting Enter.

Important note regarding restoration:  In version 1.0, an older, less reliable method of detecting and dumping the EEPROM was used, and as such it may have produced overdumps, files larger than they need to be.  Attempting to restore these overdumps with version 1.1 will give corruption, but by cropping the save file to the size it should be, you can restore it correctly.  The use of a hex editor for this is recommended.

Screenshots
Screenshot #1 -  Dumping Mario Kart DS save file to computer using release 1.0


Screenshot #2 - restoring Brain Boost Beta Wave save file to official cartridge using release 1.1

bitblt

Thanks for the heads up. I'm definitely going to keep my eye on this project.

DeVS

Nice, this looks very interesting, thanks for the heads up. I remember doing some .bat to auto-back up my Supercard Lite when I inserted the usb card reader, but this will be much nicer for my M3 Simply!
Laugh Hard, It's A Long Ways To The Bank

dantheman

Erm, the title is a bit misleading.  This isn't for backing up the .sav files that are on your slot-1 device.  This is for backing up gamesaves from an original cartridge using a slot-1 device, a feat that was impossible to do until now.

I'll edit the title to reflect that.  Sorry about the misunderstanding.

DeVS

Laugh Hard, It's A Long Ways To The Bank

754boy

Man, I've been trying to get my MKDS save off the kart for a while now. About to give this method a try.


Edit: HA, worked like a charm!!! Thanks for the tutorial man  8)  8)

noname101

To get the save file to work on the M3 Simply or the R4 do the below:

What you need:
dd for windows (Linux should already have it, the same with osx users.)

dd if=/dev/zero bs=1k count=512 > "xxxx.sav"
dd if="xxx.sav" of="xxx2.sav" conv=notrunc


For those using linux and gnome, I have made a nautilus script. Which you can download from here.

Just save the file with a .sh extension, instead of .txt. Then put it in /home/user/.gnome2/nautilus-scripts/

Change o=”/home/user/ds converted saves” to the correct path. Thats where the converted file will be, it will have the same file name, as the input file, so make sure its in a different folder.

You might need the change the permissions too, either by right clicking on the file and making it executable or using a terminal type the following command:
chmod 755 ~/.gnome2/nautilus-scripts/convert-save.sh

To use the script right click on the file and choose scripts, then convert-save.sh.

Mailyfesux


dantheman

If you have a slot-2 product that boots in GBA mode you can, using Chishm's CartSave program.  http://chishm.drunkencoders.com/SendSave/index.html#cart_save

It theoretically runs on the Supercard too, but since the Supercard tends to reboot the DS upon reinsertion, it's very difficult to get it to work correctly.

Dudu.exe


Mailyfesux

Quote from: "dantheman"If you have a slot-2 product that boots in GBA mode you can, using Chishm's CartSave program.  http://chishm.drunkencoders.com/SendSave/index.html#cart_save

It theoretically runs on the Supercard too, but since the Supercard tends to reboot the DS upon reinsertion, it's very difficult to get it to work correctly.

so you are saying that its impossible as of now? I have an r4 and a scl

dantheman

Not impossible, just really difficult.  If you push the right side of the SC in first and go really slowly, you may be able to prevent the reboot.  I tried it a couple of times and the program did work for me, but it wasn't worth the hassle.  For backing up GBA saves I'm just gonna stick to my Flash2Advance USB cable

dantheman

Update:  SavSender has been updated to allow you to insert your save files into official cartridges.  Once I figure out how to do it (having issues with netcat right now) I'll edit the post with an updated guide.  Until then, you can grab the new version 1.1 from http://frodo.dyn.gno.org/~brettk/savsender

EDIT:  I figured it out.  Guide has been updated.

Redostrike

Nice program, i was asking myself if there is a way (like this one) to save your GBA saves like this (real GBA save right of a card)

dantheman

Read my previous posts in this topic.  The only option for managing GBA saves without a linker cable is Cart_Save, but it doesn't work too well on the Supercard.  Theoretically if someone ports cart_save to the DS, it would be possible to use a slot-1 device to manage GBA saves, but no one has done this so far.