News:

11 March 2016 - Forum Rules

Main Menu

Possible to patch a save file to a rom?

Started by vozycozyx, May 08, 2018, 03:34:50 PM

Previous topic - Next topic

vozycozyx

I want to patch Earthbound with a .srm file so that the game starts off at a certain part of the game without needing the .srm file to take me there. Sorry if this is the wrong board. Hope I'm being clear about what I need.

KingMike

You could write an ASM hack to replace the code that initializes SRAM. But it's probably not going to be a copy-paste insertion.
That's probably the only way.
"My watch says 30 chickens" Google, 2018

VicVergil

The .srm file is a representation of the game's SRAM memory the emulator keeps for when it's no longer running, just like real SNES cartridges are battery powered to preserve the save.

I guess one way to do it is to follow the tutorial for adding an intro, but instead of all the graphical programming to display an intro screen, it instead just:

  • Checks if the game's SRAM is empty or not, in other terms if you played the game for the first time or not. If it's not empty it skips the rest of the programming. This is in fact needed unless you want the game to erase any progress made on future playthroughs whenever it's booted and returning it to that initial state.
  • Copy 64kb (or whatever size the game's SRAM is) from the ROM, from an address where you hex edited in the contents of your *.srm file with the mid-game save, to the SRAM.
  • Continues to the original entry point of the ROM that launches the game as normal.

And yes, you'll need to know ASM to write that program. It's fortunately simple enough, in fact the method could be repurposed for other games, providing there is space for the .srm file in the ROM.

nesrocks

Having the entire sram save file on the ROM is a waste of space, certainly. The game doesn't need all that data, just a few specific bytes. It would be "correct" to just add assembly code to initialize those specific values.

Jorpho

Quote from: vozycozyx on May 08, 2018, 03:34:50 PM
I want to patch Earthbound with a .srm file so that the game starts off at a certain part of the game without needing the .srm file to take me there. Sorry if this is the wrong board. Hope I'm being clear about what I need.
I'm not completely sure what you're going for, but you are aware there's a well-documented debug mode that can warp you all around the game, right?  In theory, you can even access it shortly after starting the game, without even using a Game Genie.
http://tasvideos.org/3406S.html
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!