Thysbelon / gbaconv-web

The Libretro VBA save to standard sav converter gbaconv compiled to WebAssembly.
https://thysbelon.github.io/gbaconv-web/
9 stars 1 forks source link

Retroarch MGBA Core not working converting srm to sav #14

Closed Cooldude300 closed 1 month ago

Cooldude300 commented 1 month ago

First off: Debug output:

home/web_user/savedata.srm 190 221 219 221 255 255 255 255 8 0 filename: /home/web_user/savedata.srm len: 131072 Detected save type: FLASH 1MBit filename: home/web_user/savedata.sav

Then, My story... I've installed Retroarch on my android. Installed Mgba core, grabbed Pokemon Emerald (Trashman), patched it with Emerald Rogue 2.0.1, Played a solid bit of it. Tried to convert it over to pc to play on there as well with the same save. Made sure to save after disabling Sram compression. Nothing works when I try to plug it into vba-m. Game spews out "The save file has been erased due to corruption or damage." Followed by "The Internal Battery has run dry. The game can be played. However clock-based events will no longer occur." Here is a copy of my SRM in case you want a closer look at it for Hex Editor or what have you. Pokemon Emerald Rogue 2.0 (TrashMan).zip

Thysbelon commented 1 month ago

Thank you very much for going into detail and uploading your save!

I'm pretty sure this is a case of file format confusion. There are a lot of file formats that happen to be named ".srm", but are not the same format gbaconv is made for. I should probably stop calling gbaconv an "srm to sav converter".
I never programmed gbaconv to handle the situation of "the input is a standard save file, but it is named '.srm'", so it probably corrupted the output save, leading to that error message.

(note: "Libretro" is the library that the program RetroArch uses)

So, in order to use your Libretro mGBA Android save on VBA-M on your PC:

  1. Rename the ".srm" file created by Libretro mGBA to ".sav"
  2. If you're using the original VBA-M: you don't need to change anything else, just put the save file in the same folder as your .gba rom
    If you're using Libretro VBA-M: take your newly renamed .sav file and run it through gbaconv-web, then put the output .srm file in whatever folder your installation of RetroArch reads save files from.