Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Mame 0187 save and load states and pause  (Read 6414 times)

0 Members and 1 Guest are viewing this topic.

evilsidius

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:December 03, 2017, 10:53:31 pm
  • I want to build my own arcade controls!
Mame 0187 save and load states and pause
« on: July 17, 2017, 06:35:38 pm »
Hello guys, i am new to all this, so sorry if this is a noob question.

Well, for now i use my pc for play. In the future i am thinking to build a arcade. But for now i use my windows 10 with a xbox controller.
I have 3 questions.

1 - What i want is to make the save state and load state more simple using only one button, is that possible? I just want to use position 1. So there is a way to assign one button for save in position 1 and another button to load from position 1?

2 - I want Pause the emulation and save or load and i still want the emulation paused. There is a way?
Let me explain this better, those that use the fusion emulator for mega drive, if you pause emulation and load a state you can notice that the emulation will still be on pause. After you press pause again that the emulation will start on the loaded file. I dont know if i make myself clear. English isnt my first language.

Anyway, hope you can help me, thanks you all.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Mame 0187 save and load states and pause
« Reply #1 on: July 17, 2017, 09:52:16 pm »
You could achive what you want using MAME's Lua plugin system.

I created a basic load/save state plugin you can use a guide.

savestate_plugin.zip

KenToad

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1500
  • Last login:April 15, 2024, 02:14:24 pm
  • Flap Flap Flap
Re: Mame 0187 save and load states and pause
« Reply #2 on: July 17, 2017, 10:07:24 pm »
Doesn't MAME support this natively? It seems to me like I have paused emulation, hit the save state button, then when I load state, it remembers that it was paused. I'm thinking of an older version of MAME.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Mame 0187 save and load states and pause
« Reply #3 on: July 17, 2017, 10:08:51 pm »
Doesn't MAME support this natively? It seems to me like I have paused emulation, hit the save state button, then when I load state, it remembers that it was paused. I'm thinking of an older version of MAME.

You could be right. I just knocked up a plugin as proof-of-concept.

evilsidius

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:December 03, 2017, 10:53:31 pm
  • I want to build my own arcade controls!
Re: Mame 0187 save and load states and pause
« Reply #4 on: July 21, 2017, 09:49:44 pm »
Thanks, when i get home at weekend i will try.
About the pause, when i load here the game starts. Maybe ita a option somewhere?

evilsidius

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 11
  • Last login:December 03, 2017, 10:53:31 pm
  • I want to build my own arcade controls!
Re: Mame 0187 save and load states and pause
« Reply #5 on: July 24, 2017, 09:00:42 pm »
Doesn't MAME support this natively? It seems to me like I have paused emulation, hit the save state button, then when I load state, it remembers that it was paused. I'm thinking of an older version of MAME.

You could be right. I just knocked up a plugin as proof-of-concept.

Headkaze, your plugin worked. Thanks a lot.
But still, when i pause (P) the emulation and used your plugin to save, automatically the emulation started with the message that save was sucefull in front of the game.

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?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Mame 0187 save and load states and pause
« Reply #6 on: July 25, 2017, 04:06:48 pm »
Mame, unfortunately, isn't made with the user in mind.  The only reason we got save states at all is the fact that they make it easier for devs to troubleshoot bugs. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Mame 0187 save and load states and pause
« Reply #7 on: July 25, 2017, 05:13:20 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?

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

Eg.
Code: [Select]
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

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Mame 0187 save and load states and pause
« Reply #8 on: July 25, 2017, 08:28:13 pm »
Isn't emu.pause a toggle?

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: Mame 0187 save and load states and pause
« Reply #9 on: July 26, 2017, 04:45:04 pm »
Isn't emu.pause a toggle?

Nope, as per luaengine.cpp source it's:

Code: [Select]
* emu.pause() - pause emulation
 * emu.unpause() - unpause emulation

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Mame 0187 save and load states and pause
« Reply #10 on: July 26, 2017, 10:52:32 pm »
Well that's great.  Most emulator lua implementations have pause screwed up in some way.  Thanks for teaching me something yet again.  :)