lesserkuma / GBA_MultiMenu

GNU General Public License v3.0
69 stars 2 forks source link

ROM with its save file #6

Open rafaliyo opened 2 months ago

rafaliyo commented 2 months ago

Is it possible to create put a ROM with its save file so when you boot the game you already have a save?

lesserkuma commented 2 months ago

If your cartridge has a battery, you can boot into a game, power off the system. Then just write the save data into SRAM and it’ll be imported on the next start of the menu. If your cartridge has no battery, you would have to inject your save data into the batteryless-SRAM-patched ROM yourself.

rafaliyo commented 2 months ago

Thanks for the reply. It has no battery is a 369 in 1 cartridge. So I would have to open the ROM and patch the save file on it?

lesserkuma commented 2 months ago

Yes, in case of batteryless cartridges, the save data has to be all handled by the game ROM itself and the menu doesn’t touch anything.

Also see https://github.com/metroid-maniac/gba-auto-batteryless-patcher

rafaliyo commented 2 months ago

Ok I am a bit lost (sorry to be a noob), I open and patch the ROM with GBata and I patch it but how inject the save exactly? If I run the batterylss patcher should I drag the new rom (patched) and the save file?

lesserkuma commented 2 months ago

If you run the gba-auto-batteryless-patcher, it says something like

Found a reference to the IRQ handler address at 234, patching
Found a reference to the IRQ handler address at 7ca04, patching
Installing payload at offset f7f7bc, save file stored at f80000

So, first open your save data file in HxD and press Ctrl+A and Ctrl+C. Take a note of the "length" displayed at the bottom. Then also open your already patched ROM file in HxD. Press Ctrl+G and go to address as indicated above (f80000). Then mark a block using Ctrl+E and enter the length of your save data that you took a note of. Now press Ctrl+V to paste your save data into the ROM file and save.

rafaliyo commented 2 months ago

Is the ROM patched with the batteryless-patcher which I have to modify or do I run just first the program to see where is the save file stored?

I say this because I have tried what you said with the ROM patched with GBata and batteryless patcher with no luck. If I run it (supposedly with the save file injected) in mGBA emulator it runs the ROM with no save data

I am doing something wrong surely

lesserkuma commented 2 months ago

The sequence is: Clean ROM → Patch with GBATA → Patch with gba-auto-batteryless-patcher → Edit with HxD. Try with a simple game like Super Mario Advance first. If it still doesn't work, I'm afraid I'm out of ideas.

rafaliyo commented 2 months ago

Ok I will try with another ROM. I have to say when I say I run the patched ROM with the save "injected" in mGBA I have not used the Gba_Multimenu

RetroTrainer15 commented 2 months ago

I'm trying to do this on an e-reader ROM, since I would like to put the Pokémon card minigames on a 369 in 1 cartridge with the multimenu.

I have tried doing it with a single sav to see if it would detect it when I turned on the game, but I can't do it. I have only tested it in the VBA for PC. Is it possible that it only works on a physical cartridge?

In a few hours I'll get home and try it again on a cartridge, but it's to remove doubts about whether I'm doing it right, but maybe it doesn't work in the emulator.

Thank you for all lesserkuma!! (If you want to try, here's the link to the minigames)

https://pokemon-project.com/descargas/down/e821b6c9b884b46f0da8ab905f6a8934/140/90b2326b99b76556adb9b9c78fa6821c/2/e251e23cb20bb4a1a46909be3c5aba66/US/99bc428a5103e4056b4327777d8c278a/7z/2891564

RetroTrainer15 commented 2 months ago

Nevermind, I have already followed the steps and it has worked for me both in the emulator and in the 369 in 1 GBA cartridges with the Multimenu. Thank you very much for everything!