Autosave

bry111
Posts: 26
Joined: Tue Jul 21, 2020 12:31 am
Has thanked: 1 time
Been thanked: 2 times

Re: Autosave

Unread post by bry111 »

There are definitely SNES games that cartridge SRAM as work RAM. At least a few special chip games.

SD2SNES / FXPak Pro explicitly checksums ROMS (since firmware 1.9.0) to detect whether it's known to use part of its SRAM as work RAM, and if so only checks for changes to a game-specific subset of SRAM to determine whether there are changes worth saving.

The current list of games it checks for (across various revisions/regions, even a couple translation hacks) is
  • Yoshi's Island
  • Super Mario RPG
  • Kirby Super Star
  • Kirby's Dreamland 3
  • Marvelous
It's not ideal to have game-specific handling, but maybe they figured it would be only a little extra work to reduce SD card wear for some fairly popular games.
retrorepair
Posts: 257
Joined: Sun May 24, 2020 9:06 pm
Has thanked: 64 times
Been thanked: 13 times

Re: Autosave

Unread post by retrorepair »

I may work on a list then. It will likely require a fair bit of testing so may take a while.

If I can find the time, I will also add the exact memory vector to be used only for save for these games, if possible.

My bet is though that these exceptions will be in the vast minority.
User avatar
jlancaster86
Posts: 147
Joined: Sat Jun 27, 2020 1:33 pm
Has thanked: 129 times
Been thanked: 35 times

Re: Autosave

Unread post by jlancaster86 »

If it does come down to adding game-specific overrides, maybe it would be best to keep those contained in an XML file (or even a basic text file listing file hashes) to prevent the overrides from having to be coded into the cores themselves.
AtomicShroom
Posts: 170
Joined: Sun Mar 07, 2021 12:28 pm
Has thanked: 31 times
Been thanked: 48 times

Re: Autosave

Unread post by AtomicShroom »

It would be really nice if this feature came to be.

I really should never have to worry about losing progress. Nothing worse than losing progress because power went out after a lengthy session where the game itself saved multiple times but I didn’t return to the OSD during that time. Nintendo’s own SNES Classic handles this perfectly, so it’s definitely possible. Whenever a game saves, it saves. It doesn’t matter if I pull the plug after or whatever, I don’t have to do any manual steps for it to save and I know my progress will be there next time I boot it up. This is how MiSTer (or any system) should work as well.
AtomicShroom
Posts: 170
Joined: Sun Mar 07, 2021 12:28 pm
Has thanked: 31 times
Been thanked: 48 times

Re: Autosave

Unread post by AtomicShroom »

bry111 wrote: Fri Jul 24, 2020 12:44 am There are definitely SNES games that cartridge SRAM as work RAM. At least a few special chip games.

SD2SNES / FXPak Pro explicitly checksums ROMS (since firmware 1.9.0) to detect whether it's known to use part of its SRAM as work RAM, and if so only checks for changes to a game-specific subset of SRAM to determine whether there are changes worth saving.

The current list of games it checks for (across various revisions/regions, even a couple translation hacks) is
  • Yoshi's Island
  • Super Mario RPG
  • Kirby Super Star
  • Kirby's Dreamland 3
  • Marvelous
It's not ideal to have game-specific handling, but maybe they figured it would be only a little extra work to reduce SD card wear for some fairly popular games.
This seems to be how Nintendo’s SNES Classic works as well. If you hack it and add “regular” games to it, normally the SRAM saves fine, however if you add a SA-1 game that it wasn’t programmed to recognize, like Marvelous, the SRAM never saves.
MisterGlock
Posts: 6
Joined: Sun May 09, 2021 10:25 am

Re: Autosave

Unread post by MisterGlock »

AtomicShroom wrote: Mon Mar 08, 2021 4:43 pm
bry111 wrote: Fri Jul 24, 2020 12:44 am There are definitely SNES games that cartridge SRAM as work RAM. At least a few special chip games.

SD2SNES / FXPak Pro explicitly checksums ROMS (since firmware 1.9.0) to detect whether it's known to use part of its SRAM as work RAM, and if so only checks for changes to a game-specific subset of SRAM to determine whether there are changes worth saving.

The current list of games it checks for (across various revisions/regions, even a couple translation hacks) is
  • Yoshi's Island
  • Super Mario RPG
  • Kirby Super Star
  • Kirby's Dreamland 3
  • Marvelous
It's not ideal to have game-specific handling, but maybe they figured it would be only a little extra work to reduce SD card wear for some fairly popular games.
This seems to be how Nintendo’s SNES Classic works as well. If you hack it and add “regular” games to it, normally the SRAM saves fine, however if you add a SA-1 game that it wasn’t programmed to recognize, like Marvelous, the SRAM never saves.
Would this be the reason a modified rom only saves my level progression but not my lives (SMB rom)?
AtomicShroom
Posts: 170
Joined: Sun Mar 07, 2021 12:28 pm
Has thanked: 31 times
Been thanked: 48 times

Re: Autosave

Unread post by AtomicShroom »

MisterGlock wrote: Sun May 23, 2021 4:59 am
AtomicShroom wrote: Mon Mar 08, 2021 4:43 pm
bry111 wrote: Fri Jul 24, 2020 12:44 am There are definitely SNES games that cartridge SRAM as work RAM. At least a few special chip games.

SD2SNES / FXPak Pro explicitly checksums ROMS (since firmware 1.9.0) to detect whether it's known to use part of its SRAM as work RAM, and if so only checks for changes to a game-specific subset of SRAM to determine whether there are changes worth saving.

The current list of games it checks for (across various revisions/regions, even a couple translation hacks) is
  • Yoshi's Island
  • Super Mario RPG
  • Kirby Super Star
  • Kirby's Dreamland 3
  • Marvelous
It's not ideal to have game-specific handling, but maybe they figured it would be only a little extra work to reduce SD card wear for some fairly popular games.
This seems to be how Nintendo’s SNES Classic works as well. If you hack it and add “regular” games to it, normally the SRAM saves fine, however if you add a SA-1 game that it wasn’t programmed to recognize, like Marvelous, the SRAM never saves.
Would this be the reason a modified rom only saves my level progression but not my lives (SMB rom)?
On the SNES Classic? Afaik this only affects games that use SRAM as work ram, like aforementioned SA-1 games. SMB (in Mario All-Stars you mean?) should work fine. Are you sure this isn’t normal behaviour of the original?
MisterGlock
Posts: 6
Joined: Sun May 09, 2021 10:25 am

Re: Autosave

Unread post by MisterGlock »

Yeah I guess it’s an SA1 game. It’s SMB around the world
Zagreatandini
Posts: 1
Joined: Tue Dec 14, 2021 2:08 pm
Has thanked: 1 time

Re: Autosave

Unread post by Zagreatandini »

I ran uodate_all and it gave me new nes and snes cores (prob others too) that wouldn’t run games and the auto save feature was greyed out. Nes now boots the disc drive menu for some reasons (fixed it by removing the boot.rom in the folder) and the snes wouldn’t play games like chrono cross, dk1-2, star fox ect. Luckily I had a backup of my original sd mister card so I copied over the “_consoles” folder and overwrote what update_all script just totally screwed me over on. Lost all my save states too.

Anyway long story short, to fix the snes auto save feature I booted up star fox 2 to make sure I have the old snes core and it booted up perfectly (same with dk1-2 and chrono cross). Once it ran star fox 2 I hit f12 to access the snes core menu and auto save was selectable and I turned it on and hit save backup ram. Then I booted up SMW and bam! I was no longer greyed out and I played though until the save option in SMW came up and hit save then turned off the mister, turned back on and went back into the snes core and loaded up SMW and there it was 😃 my save file. Although I did lose all my other saves 🤦‍♂️

I’m not sure if uodate_all screwed this all up but that’s all I did and then I had all these issues. I also had the “thyspion” enabled in update_all so I disabled that in case that’s what caused the issue but last time I ran update_all it completely screwed up my megacd and tg16 cdrom cores to the point where it wouldn’t load games and just selecting megacd would put it into this odd loop and tg16 cdrom would Just refuse to load anything up. Not sure I want to hit update_all every again tbh.
User avatar
FeelsDuckMan
Posts: 48
Joined: Wed Oct 07, 2020 12:30 am
Has thanked: 2 times
Been thanked: 11 times

Re: Autosave

Unread post by FeelsDuckMan »

How difficult would it be to modify the FPGA source files to auto save the SRAM on write? Would this be a major change? I don't know any FPGA programming, I'm familiar with C but this is out of my scope. If this is a simple thing to do, would someone please supply the changes necessary so it would be possible to compile a custom core that has this feature? Thanks.
Raph_friend
Posts: 2
Joined: Sun May 24, 2020 11:47 pm
Has thanked: 2 times

Re: Autosave

Unread post by Raph_friend »

FeelsDuckMan wrote: Sun Dec 19, 2021 10:07 pm How difficult would it be to modify the FPGA source files to auto save the SRAM on write? Would this be a major change? I don't know any FPGA programming, I'm familiar with C but this is out of my scope. If this is a simple thing to do, would someone please supply the changes necessary so it would be possible to compile a custom core that has this feature? Thanks.
I honestly don't know why none dev want look on this issue. Odd.
softtest9
Posts: 158
Joined: Thu May 28, 2020 7:13 pm
Has thanked: 3 times
Been thanked: 21 times

Re: Autosave

Unread post by softtest9 »

What if the core would place a limit on how many times the SRAM can be flushed to disk per second? So initially, saving would be instantaneous, but if the game is saving at an unreasonable rate, flushing to disk would then be intentionally delayed to something like once every 5 seconds. The game's behavior would be observed in real-time, negating the need for a database.
Raph_friend
Posts: 2
Joined: Sun May 24, 2020 11:47 pm
Has thanked: 2 times

Re: Autosave

Unread post by Raph_friend »

There's something on SD2SNES code that can be used on MiSTer about saves?
dyne
Posts: 24
Joined: Wed Jan 12, 2022 11:26 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Autosave

Unread post by dyne »

Zagreatandini wrote: Tue Dec 14, 2021 2:20 pm I ran uodate_all and it gave me new nes and snes cores (prob others too) that wouldn’t run games and the auto save feature was greyed out. Nes now boots the disc drive menu for some reasons (fixed it by removing the boot.rom in the folder) and the snes wouldn’t play games like chrono cross, dk1-2, star fox ect. Luckily I had a backup of my original sd mister card so I copied over the “_consoles” folder and overwrote what update_all script just totally screwed me over on. Lost all my save states too.

Anyway long story short, to fix the snes auto save feature I booted up star fox 2 to make sure I have the old snes core and it booted up perfectly (same with dk1-2 and chrono cross). Once it ran star fox 2 I hit f12 to access the snes core menu and auto save was selectable and I turned it on and hit save backup ram. Then I booted up SMW and bam! I was no longer greyed out and I played though until the save option in SMW came up and hit save then turned off the mister, turned back on and went back into the snes core and loaded up SMW and there it was 😃 my save file. Although I did lose all my other saves 🤦‍♂️

I’m not sure if uodate_all screwed this all up but that’s all I did and then I had all these issues. I also had the “thyspion” enabled in update_all so I disabled that in case that’s what caused the issue but last time I ran update_all it completely screwed up my megacd and tg16 cdrom cores to the point where it wouldn’t load games and just selecting megacd would put it into this odd loop and tg16 cdrom would Just refuse to load anything up. Not sure I want to hit update_all every again tbh.
I've had my own issues with update_all. First was that it changed my Neo Geo configuration somehow. After update_all I had a controller error and couldn't do anything. Not even with my wireless keyboard. Copied over the Neo Geo folder I had from a backup and it's fine now. Haven't played SNES in a couple of days and just noticed this morning that saving is now greyed out. I try to watch the updates and I don't remember seeing either core grab one but there you go.
User avatar
FeelsDuckMan
Posts: 48
Joined: Wed Oct 07, 2020 12:30 am
Has thanked: 2 times
Been thanked: 11 times

Re: Autosave

Unread post by FeelsDuckMan »

Does anyone know how I could manually add the feature to just auto save to the SD card when SRAM is written to? Just about every console flashcart does this automatically and I've never had an issue with cards and they're so cheap at this point I really don't care as I don't believe it's even an issue. I'd just like this ability myself but unsure of how to add it. I remember reading a post that someone made the modification but never stated how. Is there a fork somewhere of this feature?

Post Reply