1Retro1Retro / blog

· Hans

How 1Retro Finds Your Saves

How 1Retro decides what is a save and which game it belongs to. Plus a checklist for a save you can't find. Part 1 of 4.

  • guides
  • devlog

The question I get the most is some version of “how does sync work?” Other versions are “why doesn’t 1retro find my save?” or “why do I have saves with no game?” I will answer all of these in four posts, one a week. Each post follows a save one step further:

  1. Find your saves and the games they belong to (this post)
  2. Convert a save into a .1saves
  3. Upload it, and read what’s in it
  4. Download it onto your other devices

The first step that 1Retro performs is to look for all saves on your device. And the source that you use is the most important part of this process.

Where 1Retro looks

We call every device or emulator you add a source. In some cases, the source comes with the device and you can’t change it, for example on the MiSTerFPGA or on a handheld.

Each source knows where its saves and games are:

  • MiSTer: saves in saves/<core>/, games in games/<core>/, on the SD card and USB drives.
  • OnionOS: saves in Saves/CurrentProfile/saves/<core>/, games in Roms/<system>/.
  • RetroArch: saves in the folder that retroarch.cfg names (saves/ by default), games from your playlists.

For an emulator 1Retro doesn’t know, add a custom source and pick its folders yourself.

Once 1Retro identifies a save file, it uses the file name to find the game it belongs to.

What counts as a save

1Retro currently uses file extensions to detect saves. .srm and .sav. Those are battery saves, the ones the game writes itself.

It also look for .mcr extension (Memory Cards) but currently only for Neo Geo. We will add support for more MCR systems very soon. PS1 memory cards already sync when your emulator saves them as .srm (RetroArch) or .sav (MiSTer).

What doesn’t sync:

  • Save states (.state, .state1, .state.auto, etc.).
  • Other formats like N64’s .eep, .fla and .mpk, .dsv and .brm, and emulators with their own formats, like DraStic or PPSSPP. 1Retro will support these in time, but not yet.
  • Empty files. Some emulators create a 0-byte save when a game starts. 1Retro never uploads one. If the cloud has a save for that game, 1Retro replaces the empty file with it.

Two saves for one game

If a source has two saves for the same game (e.g. a .sav and a .srm), only the newest one syncs. Otherwise, each one overwrites the other in the cloud, again and again.

How 1Retro identifies a game

A save file doesn’t know what game it’s for. It is, for most cores, the bytes of the cartridge’s save memory (as a raw file). So the 1Retro agent needs to identify which games belong to the save.

It uses file names and systems to do this, so let’s explore it.

Save fileIs there a ROM withthe same name?yesnoROM in the1Retro catalogue?yesnoExact releaseNew game withyour file's nameFilename matches atitle in the catalogue?yesnoName matchNo game found(no sync)
How 1Retro files a save under a game.

A save and its ROM

The first step is to find the game ROM (or disc) from the save filename. We look for a ROM with the same name (and guessed system if we know) inside your ROM collection.

If there is one, we identify it on the catalogue (see below). If the catalogue doesn’t know it, we still sync the file, but with minimal information (no identification).

Emulators name a save after its ROM: Zelda.sfc gets Zelda.srm. 1Retro goes the other way. It pairs a save with the ROM of the same name, and ignores case and extension. NextUI’s Zelda.sfc.sav works too.

The match is exact though. Zelda (USA).srm won’t pair with Zelda.sfc. If you rename a ROM, rename its save.

A .zip with one game inside counts as that game, and 1Retro looks inside it. 1Retro ignores zips with several games (MAME sets, or a .gb and a .gbc together) and .7z files.

On MiSTer, OnionOS, NextUI, muOS, RetroBat, Batocera and the Pocket, the folder tells 1Retro the system. So the ROM has to be in the right system folder, with the right extension. RetroArch, OpenEmu and custom folders don’t say, so a save can pair with a same-named ROM from any system.

1Retro hashes cartridges

1Retro hashes the whole ROM (SHA-1 and MD5) and looks it up in our catalogue, which comes from No-Intro, Redump and OpenVGDB. The hash tells it the exact dump, so the exact release, with its region. 1Retro keeps the result until the file changes.

Change one byte and the hash changes, so 1Retro doesn’t recognize these:

  • ROM hacks and fan translations
  • homebrew, and prototypes no database lists
  • trimmed, overdumped or modified files
  • dumps with an extra header the catalogue’s copy doesn’t have (often old .smc files)

Discs use their serial

The same disc hashes differently as .cue/.bin, .chd, .iso or zipped. So 1Retro reads the serial in the disc’s header instead (e.g. SLUS-00067). That covers PlayStation, PS2, Saturn, Dreamcast, Sega CD, GameCube and Wii. Unfortunately, PC Engine CD and Neo Geo CD discs have no serial on them, and 1Retro will fingerprint the start of the disc’s data, which is the same in any container (and will match .chd and .iso the same).

Every 1Retro app does this: desktop, Android, MiSTer and the handhelds. So a .chd on your MiSTer and a .cue/.bin on your PC are the same game, with one save history.

Every region is its own game

Final Fantasy VII USA and Final Fantasy VII Japan have separate save histories. A revision (Rev 1 and so on) can be a separate game too. On a disc, a revision is the same game. On a cartridge, it is often a game of its own.

So a save from your USA ROM won’t show up on a device with the European one, or sometimes with another revision. To put it there, open the save on the web and use Copy this save to another game.

Unrecognized ROMs

A save whose ROM isn’t in the catalogue still syncs. 1Retro creates a game with the save file’s name, and ties it to that ROM’s hash. So later uploads from the same file land in the same place. If your library has games with the names of your files, that’s where they came from.

It can’t link two different files though. Version 1.1 of a hack on your PC and 1.2 on your handheld are two different games.

A device caches an unrecognized ROM for up to a week. If you set up a second device before the first one uploaded that save, it can take that long to show up.

Saves with no ROM

No ROM with the same name? Then 1Retro looks up the save’s filename as a title, against catalogue names and the official No-Intro and Redump file names. It ignores case and accents, and a region in the name like (USA) picks the release.

No-Intro style names (Legend of Zelda, The - A Link to the Past (USA).srm) and exact titles work. Short names like zelda3.srm don’t. If nothing matches, the save doesn’t sync, and the app shows No game found.

A name is less precise than a hash:

  • No region in the name means a default release, which isn’t always yours.
  • On RetroArch, OpenEmu and custom folders the lookup searches every system, so a title that exists on several consoles can match the wrong one.

Most of the time the real problem is a source that can’t see your games. RetroArch finds games mostly through your playlists, so if you never ran Scan Directory, add your ROM folders in the source’s settings.

Move a save to the right game

On the web, every save has Move this save to a different game. It moves the save and its history.

That only fixes the cloud. A device can still identify that ROM or filename as the old game, and put a copy back on its next sync. So fix it on the device too: rename the save to match its ROM, add the ROM folder, or add a region to the filename. A move that also updates your devices is on my list.

Troubleshooting

The save isn’t in my library

  • It’s not a .srm or .sav. Save states don’t sync.
  • It’s outside the source’s folders (e.g. RetroArch writes saves next to games).
  • The save file is empty.
  • No sync ran: Auto-sync is off, the source is off, or you didn’t plug in the drive.
  • Another save for the same game was newer.
  • No game found: no ROM next to it and no title match. Add your ROM folders or rename the save to match the ROM.

The save is under a game with my file’s name

  • The ROM isn’t in the catalogue (hack, translation, homebrew, modified dump). It still syncs between devices that have the same ROM file.

The save is under the wrong game or region

  • 1Retro matched it by name, with no region in it or against another system. Move it on the web, and fix the name on the device.

Logs

The desktop app’s Activity page lists each save that a sync skipped, or that failed, and why. For more detail, the log is in:

  • macOS: ~/Library/Application Support/com.1retro.agent/logs/
  • Windows: %LOCALAPPDATA%\1retro\agent\data\logs\
  • Linux: ~/.local/share/agent/logs/

On MiSTer, the logs are in /media/fat/1retro/. The background watcher writes daemon.log, and the menu writes menu.log. Each file starts over when the watcher or the menu starts again, so copy them before you reboot.

On OnionOS, a sync that skipped anything ends with “Sync Incomplete” and the number of saves it couldn’t match.

Still stuck? Tell me on Discord or the forums. Send the save’s filename, the ROM’s filename, the device, and the log, and I’ll take a look.

Next week: what 1Retro does to a save before it uploads it, and why your MiSTer and your PC don’t write the same file for the same game.

← Back to all posts