Categories

Troubleshooting: Saving files to the Retrode does not work

Problem

Even though the Retrode appears to the operating system as a vast storage device, its file system is mostly fake due to severe memory limitations. Most sectors are read-only, except for the ones that contain the config file and the savegame(s). Unfortunately, in some constellations this may cause trouble when these files are written to, causing the data to not actually being stored in the config memory or on-cart SRAM.

For you, the user, the problem might manifest itself as follows. Assume you have loaded the retrode.cfg file, modified it, and want to save it back. Then, one of the following could happen:

  1. You get an error that the disk is full.
  2. The application pretends that it has successfully saved the file, but after a reset of the Retrode, the data is back to original.

The most likely cause for either is when, instead of overwriting the existing data, a new file is made, and then the old directory entry redirected to the new data. The way I understand it, this is in the hands of the application. So speaking in C, fopen(filename,”w”) (create empty file for writing) would be more likely to cause this kind of trouble than fopen(filename,”r+”) (open existing file for (reading and) writing) . Programmers usually consider the first variation to be safer since the original data is not destroyed, and the file can be reverted should an error occur halfway through the saving. Here, however, it’s counterproductive. The Retrode simply doesn’t know where to look for the modified data, and to my knowledge there is no simple and elegant way to find out (mind you, the data is written first, then associated with the file system entry). If you think you can come up with one, please tell me.

Workaround

Other than changing the code of  your favourite emulator / text editor, there is no “clean” solution to this problem. Here’s a workaround that you can use if you have trouble copying the config file or savegames to your Retrode. Thanks to [bryan_c] for investigating and for the write-up.

In case someone searches the forum for a solution to this problem… I have problems editing the config file in-place, but have had luck with the following procedure:

  • Save the modified config file somewhere other than the Retrode (eg. on a hard disk)
  • Use dd to write the modified file over the original

For instance,

dd if=/path/to/modified/RETRODE.CFG of=/media/RETRODE/RETRODE.CFG

This is on Linux; there are ports of dd to Windows, but I can’t confirm whether they work with the Retrode.

Edit: found another way that seems to consistently work. Use cat. For instance,

cat /path/to/modified/RETRODE.CFG > /media/RETRODE/RETRODE.CFG

This works with writing SRAM files too.

Google tells me that the Windows equivalent of cat is type, so at a command prompt or run dialog you could try something like

type c:\path\to\modified\RETRODE.CFG > x:\RETRODE.CFG

substituting x for the retrode drive letter, of course.