Solution for extracting Pokemon Emerald cartridge saves with Memories
For most games that I have created Memories save states for, I end up with a .sav file and a .sta file. However, Pokemon Emerald (as well as Ruby and Sapphire) currently doesn't create a .sav file when using Memories on a cartidge version, making it difficult to extract the save data to play in a GBA core or to merely preserve it.
Thankfully, after doing a bit of digging, I found a pretty easy way to create a .sav file from the .sta file:
- Save your game normally, then create a Memories save state
- Close the game, plug your SD card into your computer (or use developer tools to mount SD to USB), and find the
.stafile for Emerald in theMemoriesfolder - Using a hex editor of your choice (I just used hexed.it), copy the data from address
0x60F4Ato0x80F49(inclusive) into a new file and name it[name of your emerald rom before ".gba"].sav - If you want to play with this save in a GBA core on your Pocket, copy it to the appropriate
Savesdirectory on your SD card for whatever core you're using
And voila! Why the Pocket doesn't create the .sav file for Emerald like other games in the first place is beyond me, but luckily it's still easy enough to create from the Memories data. Have fun in Hoenn!
Edit: The memory addresses listed work for the USA version of Emerald. As u/VerusVerenus noted below, the addresses vary depending on the region of the game you're making a memory of. In the case of the German version, the start address is 0x60CF6 and the end address is 0x80CF5.
Basically what you're looking for in the .sta file is a string of repeating A0003001000C0000A0003001000C0001 characters. The first 00 byte after the final instance of that repeated string is the start byte of the .sav file, and the byte located at the address 0x1FFFF greater than the start byte is the final byte of the .sav file.
Posted Jan 13, 2023, 5:51 AM UTC · edited
Thanks! Also another way is to get that .sta file into openFPGA, load GBA core with emerald and load the .sta file, then save game normally and you should have the .sav file in the sd ready to move.
i actually tried this! unfortunately i was never able to load the sta file — i would always get a “loading failed” error and the game would white screen. hence what sent me down this rabbit hole lol
Weird. Maybe the rom and the cart are slightly different revisions of the game? Or did you dump the rom from the cart?