thenick775 / gbajs3

Gbajs3 is a full Game Boy Advance emulator online in the browser supporting the mGBA WASM core. It is freely licensed and works in any modern browser.
38 stars 25 forks source link

Emulator not loading save files unless if its at the beginning of the game. #160

Closed preston7363 closed 1 month ago

preston7363 commented 1 month ago

I logged off of pokemon LeafGreen for the day and saved and downloaded the save. The next day I accidentally load the wrong save files and tried to change it, but when I did, it just told me to make a new playthrough. Only the save at the beginning of the game works. All others don't. Please help me. thanks

thenick775 commented 1 month ago

Curious on your workflow, did you only save in game?

Did you save your file system in the 'File System' modal?

If you downloaded your save, you'll need to upload it in the pre-game actions menu.

preston7363 commented 1 month ago

Yes I saved ingame and saved the file system aswell. I uploaded it in the pre-game actions aswell but it just asks me to start a new game.

preston7363 commented 1 month ago

Hey! I figured out the problem. Basically, since I had multiple save files with the same name, my computer would automatically add a number to the end of the file name each time I added a file with the same name. For some reason, the emulator can't read the file with the numbers. For example, it would be able to read: "LeafGreen.sav", and not: "LeafGreen (12).sav". Maybe this is a bug you could fix. Thanks!

thenick775 commented 1 month ago

Ahh yes! For mGBA you must have the same file name exactly the same as the ROM name but with .sav for it to be loaded automatically 😎

That's expected behavior at this time, as it's pretty core to how mGBA loads ROM/sav pairs together.

thenick775 commented 1 month ago

I don't know if I have the time to investigate doing something like that now, but since the gbaJS core (when it existed) was able to reconcile separate save names, I might be able to do the same.

If your ROM had the (1) etc. at the end things would have also loaded. This might be something to add when other cores are roped into the mix.

I think for now adding documentation/tour items to cover this would be best since this is pretty core to how mGBA works and is expected behavior at this time 😎

With the settings UI ticket (#151), I might be able to allow you to turn that off, and load a save file with a name of your choosing.

thenick775 commented 1 month ago

One thing to note, if you save in the file system menu item, you don't need to download your save and reupload it.

It will be stored in your browsers indexeddb, ready for you when you run the ROM the next time.

preston7363 commented 1 month ago

Alright thanks!

thenick775 commented 3 weeks ago

@preston7363 I've added some tour text covering this topic, see: #161 🚀