Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto-save state on exit

It would be nice to be able to set an option for auto-saving state on exit. So if you exit with the (X) window button, or press Esc, it would auto-save the state. There should be options to specify which slot to auto-save (and an option to auto-save to the current slot). Similarly, there should be a command line switch to auto-load last saved state for the specified game. This way if you are using an external launcher to start your game, you could have the choice to auto-save/load from the last spot you left.
I don't think it is hard to do it, as everything needed for this is already implemented, it is a matter of adjusting the GUI for the new options, and binding the save/load events in the right time.

Something related, could you make the Esc key quit the whole emulator when it is in "-fullscreen -nogui" mode. Right now it only close the fullscreen without quitting the emulator (which I have to do from task manager as I don't see the GUI). Thanks.

Any thoughts?

Sponsored links

It might seem simple but it usually isn't really. I think this is pretty minor but maybe some dev will pick it up, you never know. No idea about the command line arguments, have never used them myself Tongue
[Image: newsig.jpg]
As a programmer I don't see it anything but simple. Emulating a game system, this is HARD (beyond that actually). Binding window close event or key presses to functions that already exists (1. Save state, it is there already Smile, 2. Carry on the close event, also already there). GUI options part, it is all about mapping a drop down menu (with slots, one of them is "current slot") and one checkboxe (for enabling auto-save) and mapping them to variables that will be checked when exiting (and then do 1 and 2 above). Yes, I understand that the devs are busy with other important stuff, and I do appreciate their work. I am just suggesting a simple feature that would benefit the emulator because I like it.

You well need command line arguments if you are running the application from external launchers, like in your living room from your HTPC (you don't have tech-savy people to do it, so a launcher make it easier for them) Wink. You can also have shortcuts/bat files to run your game with the config/controller/memory..etc in one click using the help of command line and it's argument don't you agree Wink

Please take it under consideration, it is a "good to have", not a must Smile
Well you're not taking into account that the PCSX2 GUI runs on a separate thread, and states also use a separate thread to speed them up, so threading comes into play and that makes it much more complex. Still you are free to give it a try, the source is open and all help is welcome Smile
[Image: newsig.jpg]
Haha well played Bositman Smile I hope you realize I wasn't simplifying it to say you are wrong Smile

Yeah threading is a pain, I know (especially in performance-critical situations like here), but I don't understand how a key press that save state is easy (F1), but close button or (ESC) is hard to save as well as close.

I didn't say it will be easy for me, as I am not familiar with the structure/convention/libs used in your project, and it would need me to study the source first (an overhead), as opposed to those who are already working with it, and memorize the code sections by the look of it (they just know where everything without reading line by line) Smile

Not that I might not take a look and see (I was always considered emulator a work of magic, probably a rewarding one when it works), so I might see for myself.

Anyway, this is just a chit-chat, not a way to complain/justify Smile
Thanks man for your time
Is everything I need to compile the source included in the SVN (i.e. I don't need to have any other libs/SDKs to compile the source successfully)?
Also some pointers to the location of save/load state methods/functions and how they are triggered in code would be appreciated (or forget it if you don't feel to Smile)
found it
extern void StateCopy_LoadFromSlot( uint slot, bool isFromBackup = false );
extern void StateCopy_SaveToSlot( uint num );
Everything should compile using Visual Studio 08 or 10 (pro, as Express could be a little more involved).
One of our state saving functions is 'States_FreezeCurrentSlot()' but you may want to traverse the code a little
to see which fits your idea best.
The actual problem I see with your idea is starting / resuming a game right before the emulator closes / right after a game initializes.
You can make sure that the state saving thread is done before fully closing down the PS2 VM but we had issues before
when quickly loading a savestate right after starting up a game.

Oh, and adding all those options to the GUI and the inis is kinda a hassle (translations and all) Tongue2
Thanks rama. Now I see the problem, it is sort of like a race conditioin, so you don't want to close before you finish saving. I thought the save routine was synchronous as it blocked the game when saving, so thought there is no problem with saving, then closing right away as it will not be closed before it unblock from saving. If what I said is correct, then now I see why it is said to be not easy (it might be unreliable as well).

As for the GUI, I hear you, sometimes it is annoying to make changes. But if it only were this, then you could have a ini flag (for advanced user) and/or command line paramter instead of going the GUI route.

Thanks rama. I think the discussion is going a little bit too technical and off topic.
Nah, don't give up yet Tongue2
State saving is indeed threaded and non-blocking but Jake added some safety to it.
(Look for savestate pending or some such.)

Users browsing this thread: 1 Guest(s)