Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: qqplayer on August 26, 2019, 10:12:44 AM
-
This plugin allows you to launch your retroarch savestates directly from AM.
(https://i.imgur.com/YlhOuNB.png)
Inspiration:
https://retropie.org.uk/forum/topic/15029/savestate-loading-from-es-like-on-snesmini-with-screenshot
First of all Im not responsable for .cfg corrupted filed, lost savestates...
Use the plugin under your own responsability.
Be aware that the plugin deletes the main auto savestate file from your retroarch folder.
As always I must thank all the community for the help (specially keilmillerjr).
So, Ill try to explain how it works.All paths and config files should be precisely created, otherwise the plugin doesnt work propertlly.
Steps:
retroarch.cfg (emulator main .cfg file)
savestate_auto_index = "false"
savestate_auto_load = "true"
savestate_auto_save = "false"
savestate_directory = ":\states"
savestate_thumbnail_enable = "true"
savestates_in_content_dir = "false"
auto_overrides_enable = "false"
(https://i.imgur.com/IxMlPF6.png)
emulator.cfg (AM emulator example .cfg file to understand where you need to create your appendconfig_emulator.cfg file)
# Generated by Attract-Mode v2.2.1
#
executable cmd
args /c cd "Y:\Attrack Mode\systems\RetroArch" & start /wait retroarch -L cores\emulator.dll "[romfilename]" --appendconfig "Y:\Attrack Mode\systems\RetroArch\config\AutoSavestate\appendconfig_emulator.cfg"
Every emulator (AM) needs an 'appendconfig_emulator.cfg'
appendconfig_emulator.cfg
savestate_directory = ":\states\emulator"
I'm using 'emulator' as the main name, should be 'Atari 5200','Game Boy'...
Inside your retroarch installation should be a states folder.
A hard link shell shortcut needs to be created from the emulator to the plugin folder.
(https://i.imgur.com/REQ73Fh.png)
This program can make it and its free.
http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html
atract.cfg (AM main .cfg file)
plugin SavestateLoader
enabled yes
param command SavestateLoader.bat
param extension_1 .state1
param extension_2 .state2
param extension_3 .state3
param slash /
To launch your savestates you need to asign three 'signal_str' , I've chosen this ones.
input_map
toggle_rotate_right T
toggle_flip Y
toggle_rotate_left U
input_map
toggle_rotate_right T ("savestate_1")
toggle_flip Y ("savestate_2")
toggle_rotate_left U ("savestate_3")
https://github.com/mickelson/attract/blob/master/Layouts.md#add_signal_handler
plugin.nut (plugin main .nut file)
show_statesnap ---> fe.get_input_state ("G")
hide_statesnap ---> fe.get_input_state ("H")
Default keys to show or hide your savestates.
(https://i.imgur.com/YlhOuNB.png)
(https://i.imgur.com/HZLk4vi.png)
And that's it ;)
EXTRA: SavestateClear.bat THIS FILE DELETES THE .STATE.AUTO FILE WHEN YOU RETURN FROM THE GAME.
It doesnt matter because its a copy of your .state1, .state2 or .state3 file.
But I advise you to test the plugin propertly creating and launching your savestates before putting this file alongside your plugin.nut
-
very good.....great project.
-
I forgot to mention I've attached a beta version on the first post.
All seems to work fine.