Main > Software Forum

Mame 0187 save and load states and pause

<< < (3/4) > >>

Howard_Casto:
Well that's great.  Most emulator lua implementations have pause screwed up in some way.  Thanks for teaching me something yet again.  :)

Fenris891:
Hi Headkaze, Im interested in the same thing and this is the only post I found about this issue. Could you reupload your plugin please?

PL1:

--- Quote from: Fenris891 on August 03, 2024, 12:33:06 pm ---Could you reupload your plugin please?

--- End quote ---
It's been a while since he logged in here so here's a backup from archive.org.   :cheers:
https://web.archive.org/web/20220703081902/headsoft.com.au/download/mame/savestate_plugin.zip


Scott

Fenris891:
Thanks, I really appreciate it! In which MAME folder should I need to extract it? "plugin" subfolder maybe? Because there already are tons of init.lua files in different subfolders so I dunno where to put this one. Noob here  ;D

PL1:

--- Quote from: Fenris891 on August 04, 2024, 04:46:15 am ---In which MAME folder should I need to extract it? "plugin" subfolder maybe?

--- End quote ---
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)
    or
2. 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.   :dizzy:
- 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 . . .

--- Code: --- emu.register_pause(function()
emu.show_menu("SaveState")
end)

--- End code ---
. . . 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.

--- Quote from: headkaze on July 25, 2017, 05:13:20 pm ---
--- Quote from: evilsidius on July 24, 2017, 09:00:42 pm ---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?

--- End quote ---

Yes, just add an "emu.pause()" statement after loading/saving the state.

Eg.

--- Code: ---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
--- End code ---

--- End quote ---


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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version