Hatari - commandline autoload + save savestate

A forum about the Hatari ST/STE emulator - the current version is v2.0.0

Moderators: simonsunnyboy, thothy, Moderator Team

T_B
Atarian
Atarian
Posts: 6
Joined: Tue Dec 27, 2011 3:53 pm

Hatari - commandline autoload + save savestate

Postby T_B » Tue Dec 27, 2011 3:58 pm

Hi,
Is it possible with Hatari to start a games savestate from commandline and automatically save it after exit?
Goal is to create an easy to use desktoplink for kids for only one game.
T_B

Edit: figured it out myself -

1. check in the memory settings "load/save state at start-up/exit"
2. create a cfg file (in this case eliminator.cfg) for the individual games and change the szMemoryCaptureFileName and szAutoSaveFileName like:
[Memory]
nMemorySize = 1
bAutoSave = TRUE
szMemoryCaptureFileName = /home/t_b/.hatari/eliminator.sav
szAutoSaveFileName = /home/t_b/.hatari/eliminator.sav
3. start Hatari from command line or script with : hatari -c /home/t_b/.hatari/eliminator.cfg

Now I only need to figure out to exit Hatari without entering the gui. :)

Edit 2:

changed all [ShortcutsWithoutModifiers] in the cfg to 0 exept KeyQuit. Changed it to "keyQuit = 293"
F12 is quit and you need the alt tab to go to other options.

So with all these settings I have created 2 shortcuts on my desktop. Clicking on them starts one of the games and after playing pressing F12: exits and saves the state for the executed game. Very very nice :)

BTW. I have done above in Linux but should be possible in Windows as well I guess.

User avatar
dma
Atari Super Hero
Atari Super Hero
Posts: 817
Joined: Wed Nov 20, 2002 11:22 pm
Location: France
Contact:

Re: Hatari - commandline autoload + save savestate

Postby dma » Thu Dec 29, 2011 9:43 am

Nice tips, thanks for sharing this.

T_B
Atarian
Atarian
Posts: 6
Joined: Tue Dec 27, 2011 3:53 pm

Re: Hatari - commandline autoload + save savestate

Postby T_B » Wed Aug 31, 2016 4:01 pm

Hi - after all these years I tried my method of starting savestates from command line with Hatari 1.8 but it seems not to work anymore. I can start the savestate, but after exiting the savestate is not automatically saved. In the terminal the question is prompted '/home/t_b/.hatari/eliminator.sav exists, overwrite?'
Did something change in later versions of Hatari?
I assume by setting "szAutoSaveFileName = /home/t_b/.hatari/eliminator.sav" Hatari should not need a confirmation.

I am using Slackware 14.1.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4849
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Hatari - commandline autoload + save savestate

Postby simonsunnyboy » Wed Aug 31, 2016 4:22 pm

Yes, due to new features it is very possible that savestate information changes and is not really compatible anymore.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

T_B
Atarian
Atarian
Posts: 6
Joined: Tue Dec 27, 2011 3:53 pm

Re: Hatari - commandline autoload + save savestate

Postby T_B » Wed Aug 31, 2016 4:34 pm

Uhmm... okay thx. Any suggestion then how to get this working again? Most modern emulators have an option to autosave save states per game without being prompted every time. Pretty sure Hatari is still capable of doing this.
BTW my problem is not that old savestates are not working anymore.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1540
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari - commandline autoload + save savestate

Postby Eero Tamminen » Fri Sep 16, 2016 8:24 pm

Mailed about this on hatari mailing list week ago, but I'll mention it here too.

This has been broken after Hatari v1.4, until now. You were first person to notice (or at least comment about) it.

Problem is that confirmation dialog was added for overwriting the memory save file. While that works fine for memory saves invoked from Hatari config GUI, keyboard shortcuts and debugger, query dialogs return false when invoked while Hatari is exiting. Which is when autosave calls it...

I've fixed this in Hatari repo:
https://hg.tuxfamily.org/mercurialroot/ ... d4cc326d6a


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 1 guest