agg23 / openfpga-SNES

SNES for the Analogue Pocket
GNU General Public License v3.0
382 stars 15 forks source link

Save does not stick if exiting game through the "Load SMC" menu #2

Closed MysticNTN closed 1 year ago

MysticNTN commented 1 year ago

If I do a quick reload of a snes rom through the "Load SMC" menu the save file will not be written properly. To get the save to stick I have to shutdown the pocket entirely.

agg23 commented 1 year ago

I cannot reproduce this. A fast test is opening SMW and waiting until the world map, then switching ROMs.

Additionally, it should definitely save when you quit the core. Turning off the Pocket should not be necessary.

MysticNTN commented 1 year ago

I just tested this with SMW and it does indeed retain the save. I should have given more information in the original post, my apologies.

The games I tested this with were -The Legend of Zelda A Link to the Past -Chrono Trigger

saving in both of those games respectively then switching roms resulted in a missing save when returning.

juraisa commented 1 year ago

Also can't reproduce so far.

I loaded Link To The Past, started game, performed a Save And Quit, waited for game to restart then used Core Options to Load SMC into Mystical Ninja. Load SMC'd back into Link To The Past, save is there as expected.

MysticNTN commented 1 year ago

Here is a video showing it for Link to the Past.

xportz commented 1 year ago

This just happened to me on SMW unfortunately. I made it past the first castle, saved, then loaded a new rom through the menu. When I came back to SMW, my saved game was not there. It showed 0 levels complete and when I started the game, I was back to the first level again.

EDIT: I'll play through the first few levels again, then film the saving process like MysticNTN.

Here's me losing a save file in SMW.

naveedster commented 1 year ago

Yeah, I guess I am used to the way that the Sd2SNES behaves.

MysticNTN commented 1 year ago

So this also seems to lose saves of games I have not loaded. Here's what I did:

agg23 commented 1 year ago

So this also seems to lose saves of games I have not loaded

That's a huge issue if true. Not something that can be caused by the core (unless you missed something in your description) as files can only be touched via a special configuration, and save files are linked by name and path to the ROM.


Actually, it's quite possible that it didn't save when you closed Chrono Trigger that first time. So you loaded the save, but then overwrote it with garbage.

MysticNTN commented 1 year ago

I will try to make a video for it.

And yeah i was just thinking that the first hard shutdown could have caused it. I will come back with more info.

xportz commented 1 year ago

I've played the first few levels of SMW as a test. Here's my findings:

Attempt 1: Saving then loading a new ROM from the menu. Result: Lost save file.

Attempt 2: Saving then quitting from the menu. Result: Successful save.

MysticNTN commented 1 year ago

That's a huge issue if true. Not something that can be caused by the core (unless you missed something in your description) as files can only be touched via a special configuration, and save files are linked by name and path to the ROM.

Actually, it's quite possible that it didn't save when you closed Chrono Trigger that first time. So you loaded the save, but then overwrote it with garbage.

Here is the video

xportz commented 1 year ago

So I played some more SMW, and saved after the first ghost house. I then quit and shut down. Once I loaded up the game again, my save was still there (showing 7 levels complete). Next, I used "Load SMC" from the menu, jumped into another game for a few seconds and came back to SMW. My save was deleted. It seems "Load SMC" is incredibly dangerous to save files.

agg23 commented 1 year ago

Looking through the configs, I don't think I did anything incorrectly. I will temporarily remove the option to change ROM

agg23 commented 1 year ago

@MysticNTN thank you greatly for the video. Could you try the process again, grabbing the Chrono Trigger save after each reboot, then the save at the very end? I would like to check to see if I can notice anything.

MysticNTN commented 1 year ago

@agg23 Yes I can. One moment.

MysticNTN commented 1 year ago

@agg23 Here you go. Let me know if this helps, EDIT: Copyrighted material removed Issue#2.zip

agg23 commented 1 year ago

Did you follow the same pattern from before? If so, can you send me the DKC save file (the original I guess and whatever is on your Pocket now after repeating the experiment again) and any Doom saves?.

The first two saves are identical, as we would expect. The third is much larger, and contains a bunch of garbage data (looks like the default state of the memory block honestly). I'm wondering if some of the first data in that final save correlates to data in either DKC or Doom, which may shed more light on what is going on.

MysticNTN commented 1 year ago

Yes, those saves are from the exact steps taken in the video. Do you want me to repeat those steps and send you the DKC save and whatever Doom spits out? (Im not too familiar with how the saving works in that game)

agg23 commented 1 year ago

No, you don't have to repeat it. I thought you had a pre-existing DKC save from a SuperNT or something, so I want that save and the final DKC save after things get messed up (which is what would be on your Pocket right now unless you copied over it already). And just the final Doom save (I'm assuming there was no starting Doom save).

MysticNTN commented 1 year ago

So I just went ahead and repeated it. Sorry! But as before, the end result was missing saves so this should help you out. openfpga-SNES-Issue#2-DKC-Doom.zip

agg23 commented 1 year ago

Ok, perfect. Thank you for being so helpful and repeating that over and over again. So the Doom save is actually your DKC save, which shows basically what I was thinking; that there's a firmware issue that is causing save corruption. That doesn't really explain what is happening to Chrono Trigger, but it's also just not possible from my end for Doom to get the DKC data.

I have referenced this discussion in the report to Analogue, and hopefully we have a fix soon. Thanks again for your help.

MysticNTN commented 1 year ago

You're very welcome. If you need any more help on this issue or other please let me know. I would love to continue to help on this project.

agg23 commented 1 year ago

Going to close this for now, as I think it should be mitigated. If this still occurs, please reopen.