[idiot-proofing] GUI option to turn on prompt when loading

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
hima

[idiot-proofing] GUI option to turn on prompt when loading

Post by hima »

Dear ZSNES devs, I've been a user for the better part of this decade and truly appreciate the effort put in to this software!

Now this morning, I just had a very bad experience with savestates and thought I'd better put up a request for idiot-proofing it (yes, I'm the idiot :oops: ) in order to soothe the intense self-contempt I'm feeling right now.

This is the usecase:
1) Play Mario Picross
2) Save the state once while clearing one of the first puzzles
3) Continue playing the game for two months, clearing nearly all puzzles - but do not save the state again
4)One day when you're off to work, try to press 'alt-F4' in order to turn off the game, but slip with the finger on 'alt' ending up pressing only 'F4'

Result:
*BOOM!! You loose two months of clearing picross puzzles as the savestate is loaded and the .srm is instantly overwritten with the old data..

Request:
*Add a GUI option to show a confirmation prompt when loading a save state with shortcut keys.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

1) You're not supposed to use Alt+F4.

2) It's more like the save data was never written to at all, which is generally the case.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
neo_bahamut1985
-Burninated-
Posts: 871
Joined: Mon Sep 10, 2007 11:33 pm
Location: Unspecified

Post by neo_bahamut1985 »

Isn't there a feature that saves during certain intervals (i.e. every 10 min) or am I mistaken?
俺はテメエの倒す男だ! 宜しく! お前はもう死んでいる...
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

neo_bahamut1985 wrote:Isn't there a feature that saves during certain intervals (i.e. every 10 min) or am I mistaken?
Yes.. SRAM Check+Save saves every ~5 seconds.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

Deathlike2 wrote:1) You're not supposed to use Alt+F4.
Then this shortcut should be removed, right?
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
hima

Post by hima »

Deathlike2 wrote:1) You're not supposed to use Alt+F4.
Hrm, it doesn't make sense to tell Windows users not to use this shortcut. :roll:
2) It's more like the save data was never written to at all, which is generally the case.
What do you mean? How does this affect my usecase?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Deathlike2 wrote:
neo_bahamut1985 wrote:Isn't there a feature that saves during certain intervals (i.e. every 10 min) or am I mistaken?
Yes.. SRAM Check+Save saves every ~5 seconds.
No, saves ~5 seconds after the game writes something to SRAM.
Which could be all the time, depends the game. Usually isn't. And wouldn't be the solution to the problem here.

Anyway... @OP: we already have idiotproofing. Please use it.

If you have issues with (alt+)F4, remap load state to F12. Or Scroll Lock. Or whatever not close to F4.
Alternatively, you can configure zsnes to load states without overwriting the SRAM, but some games will not work properly with savestates anymore.
Finally, you might be interested in the auto-increment save slot feature.

The basics of a quicksave/load is NOT to get popup dialog boxen asking if you're sure.
The other basic is that you save early, and you save often. States aren't big, and you get a whole hundred per game without going out of your way with renaming files.

Lessons learnt the hard way build character.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

hima wrote:
Deathlike2 wrote:1) You're not supposed to use Alt+F4.
Hrm, it doesn't make sense to tell Windows users not to use this shortcut. :roll:
It's not a valid shortcut across all ports. This factors in DOS (unsure of SDL, but whatever).
2) It's more like the save data was never written to at all, which is generally the case.
What do you mean? How does this affect my usecase?
If ZSNES crashes and/or closes abnormally, save data isn't written/updated.

I agree with grinvader... it is a hard lesson learned.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Another mention against the alt-f4 closing method: it has the nasty tendency to overkill an app, which makes it skip pretty much all the 'composed' exit sequence, which usually includes flushing/saving files (config, SRM, whatever) and freeing buffers.

'Save config now' prevents config from being trashed, and 'SRAM check & save' does a rather good job at cancelling SRM fuckup.

But as I already said, this was not the source of the issue and shouldn't matter.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

But the Alt+F4 shortcut is just a normal keyboard event; programs can reroute it to the main exit point / ignore it / etc.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
BCprogger
Hazed
Posts: 57
Joined: Thu Aug 03, 2006 1:11 am
Location: Nanaimo B.C

Post by BCprogger »

Alt-F4 as far as I know sends a WM_CLOSE message to the foreground window. It can be recognized independently, but the main thing is ZSNES should simply reroute the message pump case for WM_CLOSE to the proper cleanup procedures before exiting.
Verdauga Greeneyes
Regular
Posts: 347
Joined: Tue Mar 07, 2006 10:32 am
Location: The Netherlands

Post by Verdauga Greeneyes »

Perhaps it would be worthwhile to make a 'save current data before loading quicksave' option.. that way you would at least have an undo button. I always forget which button means save and which means load (even when I use a program often.. I much prefer the system Snes9x uses, but that's just me) so this has happened to me many times in different emulators.
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Feature already in, VG. It's called rewind.

@BCProgger: We use atexit(). It should do everything that's needed when the program closes. Obviously from many reports of people closing it with alt-f4 it doesn't.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Post Reply