Save state on exit

MAME Gurus come to your aide to help you. Please use the search before adding a topic. This will help cut down on having multiple topics with the same subject.
ShadowFlame
Gamer
Gamer
Posts: 13
Joined: July 10th, 2019, 9:53 pm

Save state on exit

Post by ShadowFlame » July 11th, 2019, 5:18 pm

Hello,

on Mame I'm having issues with a couple of games that are not saving State on exit though that has been selected in the Mame interface under default game options. twin Cobra and twin Cobra 2 are not saving State on exit. I have even set autosave 1 in the .ini file and it still does not work. all the other games seem to be working fine with saving state. I'm not sure why twin Cobra and twin Cobra 2 are not.

When I click on properties of nmk16.cpp and then go to the miscellaneous section the option for save state on exit is grayed out. All the other options are selectable just "save state on exit" is greyed out.

can someone help me figure out why I cannot get twin Cobra and twin Cobra 2 to save the state on exit.

Thank you.

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3478
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Save state on exit

Post by Hierophant » July 11th, 2019, 6:35 pm

Save state is not supported for all games in MAME. Have a look at the folders on the left of the GUI; All Games, Available etc. Further down is a folder called 'Savestate'. Open it to see two more folders, 'Supported' and 'Unsupported'. The Twin Cobra games show up in the 'Unsupported' folder for me.

You could look into Hiscore.dat. I'll do a test to see if that works for the Twin Cobra games.

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3478
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Save state on exit

Post by Hierophant » July 11th, 2019, 7:34 pm

Good news, both Twin Cobra games worked with Hiscore.dat to save my high scores. If you're not familiar with Hiscore.dat, I have further info here:

How to Save High Scores in MAME - viewtopic.php?p=3385#p3385

ShadowFlame
Gamer
Gamer
Posts: 13
Joined: July 10th, 2019, 9:53 pm

Re: Save state on exit

Post by ShadowFlame » July 11th, 2019, 10:11 pm

Thank you for the information. Where do I put the highscore.dat file and is there something I have to do in the Mame interface?

Thank you.

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3478
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Save state on exit

Post by Hierophant » July 12th, 2019, 1:11 am

That can vary depending on the MAME build and version. For some it may not work at all. In my video tutorial I demonstrate it for MAMEUIFX. Which MAME build and version number are you running?

ShadowFlame
Gamer
Gamer
Posts: 13
Joined: July 10th, 2019, 9:53 pm

Re: Save state on exit

Post by ShadowFlame » July 12th, 2019, 2:04 pm

Hello,

I will check that information tonight and post it here.

Thank you again.

ShadowFlame
Gamer
Gamer
Posts: 13
Joined: July 10th, 2019, 9:53 pm

Re: Save state on exit

Post by ShadowFlame » July 12th, 2019, 10:25 pm

It's called "Arcade32" Mame copyright 1997-2018
Version 0.196
Build time Mar 29 2018

"A 32 and 64-bit derivative of Mame based on the mameuifx source"

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3478
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Save state on exit

Post by Hierophant » July 13th, 2019, 1:32 am

Nice one! That happens to be one of the builds I'm using, just that I have a slightly earlier version number. It's also good for this job because the Hiscore function is kinda built-in.

Go Options > Default game options > Miscellaneous II.

Tick the 'Enable internal LUA plugins' checkbox.

Down from there is a 'Select a plugin' drop down menu.

(On mine that button is a bit odd because it looks greyed out, but it still works regardless. Coder error perhaps.)

Choose 'hiscore' from the menu and it will be entered into the 'Enabled plugins' field.
(You may also want to enable the 'cheat' plugin while you're in there.)

Once that's done, try a quick test with your Twin Cobra games. Register a high score, quit MAME then reopen the game to see if your high score sticks.

ShadowFlame
Gamer
Gamer
Posts: 13
Joined: July 10th, 2019, 9:53 pm

Re: Save state on exit

Post by ShadowFlame » July 13th, 2019, 3:00 am

I wish that worked. But, it still isn't keeping my hiscore. I checked inside the hiscore.dat file and I don't have an entry for Twin Cobra. I did have one for Twin Cobra 2 that says:

******Twin Cobra 2 (world) & (us)
tcobra2:
tcobra2u:
@:maincpu,program,4006e0,11a,0,01
@maincpu, program,4007d3,1,02,02

I am running the tcobra2 ROM. But it won't save high score still.

In my Mame directory there is a folder called plugins. Inside that folder are a bunch of folders one is called hiscore. Inside that high score folder there are files called:

hiscore.dat
init.lua
plugin.json
sort_hiscore.lua

I also tried copying all those files and paste them in different spots like into the main folder where the mame executable is but still nothing.

User avatar
Hierophant
Site Administrator
Site Administrator
Posts: 3478
Joined: December 11th, 2008, 8:41 pm
Favorite Game: Alien vs Predator
Location: LV-426 Acheron
Contact:

Re: Save state on exit

Post by Hierophant » July 13th, 2019, 5:10 am

Can you confirm that when you go to the Miscellaneous II section of Default game options that it now says hiscore in the Enabled plugins field and the Enable internal LUA plugins checkbox is ticked? Those are the requirements. Short of that being the problem then I don't know what the cause might be. The only recourse I can think of after that would be for us to both get on the latest version of Arcade32/64 and test that.

Copying the plugin items around to other locations won't make any difference. It already works with the default structure. At least it does for me. My high scores are being saved for both Twin Cobra games with the method I described.

Your current version is Arcade32 0.196. Mine is Arcade64 0.191. I would recommend using a 64bit version if applicable.

My plugins/hiscore folder has the same four items which you listed.

My hiscore.dat has an entry for Twin Cobra. Yours should, too. The ROM name is twincobr. It reads as follows:

Code: Select all

twincobr:
twincobru:
@:maincpu,program,315a2,16c,00,01
@:maincpu,program,317af,1,2d,2d
@:maincpu,program,317b1,1,2d,2d
@:maincpu,program,317b3,1,2d,2d
@:maincpu,program,317b5,1,03,03
@:maincpu,program,317b7,1,00,00
@:maincpu,program,317b9,1,00,00
@:maincpu,program,317bb,1,00,00
@:maincpu,program,317bd,1,00,00
The Twin Cobra II entry in my hiscore.dat is basically the same as yours, but I'll put it here for completeness:

Code: Select all

;*******Twin Cobra 2 (World) & (us)
tcobra2:
tcobra2u:
@:maincpu,program,4006e0,11a,0,01
@:maincpu,program,4007d3,1,02,02

Post Reply