In which MAME folder should I need to extract it? "plugin" subfolder maybe?
Yes. Copy the "savestate" folder from the .zip file into the "\mame\plugins\" folder.
To enable the plugin, either:
1. Edit the plugin.ini file so savestate is 1 (enabled) instead of 0. (disabled)
or2. Launch MAME, press TAB to bring up the MAME menu system, go into the plugins menu, and switch savestate to ON.
Now that you've enabled the plugin, press Shift-F7 to save the current state or press F7 to restore an already-saved state.I tested the plugin in MAME0.262 with Asteroids (rev 4) and
sometimes it works, but it does not restore the pause status or pause after restoring -- the restore loads and you're off and running.
- If trying to save/restore a state with the plugin causes an error with line 38 or 39, press Enter or ESC to close the error window, press Alt-Enter to restore the display to full screen,
and try saving/restoring again close the savestate menu called by pausing, and press Shift-F7 to save or F7 to restore. The error appears to be
frequent but intermittent caused by the savestate menu shown below.
- IIRC LUA scripting has been updated several times since Headkaze wrote the plugin so not sure if that's causing the errors.
Looking in the init.lua file, the only reference I see to pause is this . . .
emu.register_pause(function()
emu.show_menu("SaveState")
end)
. . . which apparently causes the pause function to also bring up the savestate menu.
What I don't see in the script is the "emu.pause()" command that Headkaze mentioned, so you'll need to add it yourself if you want it.
I would like to save and load and the emulation stayed on pause. Or at least didint show any message of save sucefull or load sucefull. There is a option?
Yes, just add an "emu.pause()" statement after loading/saving the state.
Eg.
local function savestate_menu_callback(index, event)
if event == "select" then
local menu_item = savestate_menu[index][1]
if menu_item == "Load State" then manager:machine():load("auto")
elseif menu_item == "Save State" then manager:machine():save("auto")
end
emu.pause()
end
return false
end
Scott
EDIT: Did more testing in MAME v0.238 and v0.262. Errors happen whenever you try to use the savestate menu shown in the attachment to save or restore. The error
doesn't happen if you pause, close that savestate menu,
and then save using Shift-F7
or restore using F7.