Hey there, I had trouble with the Retrode and Linux, especially with how the sram is saved back on the cartridge. Snes9x seems pretty inconsistent, sometimes successfully saving on the Retrode, sometimes completely corrupting the sram. So in order to keep that from happening, I devised a script that would help me keeping my sram safe on both the Retrode and the hdd.
I'm using Ubuntu 11.04 and tested the saves with Chrono Trigger japanese version.
The emulator is snes9x-gtk 1.53 from
https://launchpad.net/~bearoso/+archive/ppa#!/bin/sh
set -v
# shows executed command
cp -r /media/RETRODE/ ~/retrode/media
# copies everything from the Retrode to the HDD.
# you need to have created ~/retrode/media/RETRODE first.
snes9x-gtk ~/retrode/media/RETRODE/*.sfc
# starts emulation of whatever is in the folder
wait
# waits until the emulator finishes
find /media/RETRODE/ -name '*.srm' -exec dd if=~/retrode{} of={} \;
# copies the save file .srm back to the Retrode
mv ~/retrode/media/RETRODE/*.srm ~/retrode/backup/
# moves the save file to a backup folder. overwrites the previous save.
rm -vf ~/retrode/media/RETRODE/*.*
# empties the retrode folder on your hdd to keep it clean.
Loads of thoughts:
I *think* I had some problem with the dd command: the first time I ran the script the sram was not saved (
dd was successful, but reloading the game shown an unchanged savegame) and I had to put a
umount /media/RETRODE at the end of the script. The problem is that you need to get up and hit reset on the Retrode before launching a game. But I tried the script again with the umount command and this time it worked well. I'm not sur if I hallucinated or if there's a delay with
dd or the OS before actually writing the data.
I tried the
cat command but couldn't make it work, I don't know why.
I had loads of trouble using
find -exec {} and couldn't just end up with the filename without the whole path, this is why the RETRODE mount path is replicated in the /retrode directory on the HDD. I'm guessing it has to do with
-print0 or
-printf "%f\n" pipe something, but I just couldn't figure it out. I'm a complete newb at that.
I'm quite unsure of the backup process though. With this script you keep a copy of the last sram in
/backup so if for some reason writing on the cartridge failed then you still have a safe copy of it. Hovewer, in order to acknowledge the success or failure of the sram writing you need to launch the game/script again, which overwrites the sram file on the HDD with the one that is on the cartridge (the old one if failed, if you follow me). The only way currently to be safe is if you notice when launching your game that the previous sram writing failed: don't close the emulator, go to the
/backup folder and save your .srm to a third location so it won't be overwritten.
I had no problem with Gens but I think I will make another similar script for softpatching: Gens wants the .ips patch to be in the same folder as the rom, which is not possible with the Retrode obviously.