libretro / opera-libretro

Port of 4DO/libfreedo to libretro.
66 stars 38 forks source link

After initial save and program closure, shared saves are not updated after program close #144

Closed Silanda closed 4 years ago

Silanda commented 4 years ago

I noticed this while playing Defcon 5.

Saves during the first run of the emulator work correctly and can be loaded after Retroarch is closed. However, new saves made after Retroarch is launched again will only persist until it is closed. They will appear to save correctly and will load correctly until Retroarch is closed, but 3DO.nvram will not be updated and therefore will only contain out of date saves the next time Retroarch is launched.

3DO.nvram.tmp is present alongside 3DO.nvram in Retroarch's System directory, and it's the updated save file that should be used. 3DO.nvram stays in the same state as it was after the initial save and program close.

What I suspect is happening is that 3DO.nvram.tmp is being created, but then can't be renamed due to 3DO.nvram already existing. This is on Windows by the way.

I've fixed this in my build by adding filestream_delete(fullpath); on line 71 of nvram.c, but I'm not a coder, and I don't know anything about the internals of libretro, so I'm not sure if that's the best approach.

obenguerah commented 4 years ago

I have the same issue here. As per game saves are broken as well.. this makes this core saves broken

obenguerah commented 4 years ago

@Silanda, would you mind sharing the core file you built in order to fix this issue? Thank you !

trapexit commented 4 years ago

And this is why this kind of thing would be better placed into the front end. Must be some issue with the differences between POSIX and Windows file expectations. I'll see if I can look into it today.

Silanda commented 4 years ago

This is the 64-bit core that I built. I'm uncertain whether there could be any side effects of this using this build, but I haven't observed any. On exiting it should just delete the old save file first so that it is replaced by the renamed temporary file.

opera_libretro.zip

trapexit commented 4 years ago

Once the build bot finishes this should be fixed.

Silanda commented 4 years ago

Tested and looks good here, so I'm closing the issue.

obenguerah commented 4 years ago

@Silanda , thank you for sharing your core, all good :)

Thank you @trapexit for correcting this, will wait the core updater new version to test it