Problem with Changing things in Cheat for MAME

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
User avatar
Gaius_4
Posts: 138
Joined: Sun Oct 26, 2003 2:27 pm

Problem with Changing things in Cheat for MAME

Post by Gaius_4 »

Here's my problem. :oops: I've tried to add some cheats to a game while playing it in MAME. I will then quit the game (when I'm finished). When I play that same game again the cheats I added last time are missing. Also it seems like some Cheats are rewriting themselves or doubling at the bottom or somewhere in the middle. :x I've tried setting the 'Auto Save Cheats' in the options to ON. But it doesn't seem to work or save anything. Help a Noob out won't ya? :cry:
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

"Auto-save Cheats" will automatically save all new/edited cheats when exiting the emulator. In the "Edit Cheats" window, press S to save an individual cheat.
User avatar
Gaius_4
Posts: 138
Joined: Sun Oct 26, 2003 2:27 pm

Post by Gaius_4 »

Ah. Use 'S'. That worked. Thanks. But now I'm (still) getting copies of some of them. I had "Auto Save Cheats" turned on when I left the emulator. I also changed a few of the cheats; (renamed some, and added one) and pressed 'S' after each one I changed. For example: one I changed from "Infinite head (Enemy)" to "Infinite Helmet (Enemy)", used 'S' after changing it, and later when I restarted the emulator I had both of these in the cheat menu, instead of just one. Along with just about everything else had doubled.:-? I'll try deleting these extra entries, close the emulator, and check them out again.

Thanks for moving this. I really need to become more familiar with this forum. :oops:
kelvSYC
Posts: 1121
Joined: Thu Sep 27, 2001 1:00 am
Location: Calgary, AB, Canada
Been thanked: 1 time

Post by kelvSYC »

When you save an entry, it is appended to the bottom of the file.

With my experiences (I have to admit I haven't been playing MAME much lately, this may have been fixed), if you use "auto save cheats", if a line changes, the modified line is appended to the bottom of the file, while the original line remains untouched (I don't know its implications on multiline cheats).

Example:
Say this was a line in your cheat file

Code: Select all

:game0001:00000000:1234:00000001:00000001:Cheat 1
You modify it so that the address now says 1235 and save it. (either from pressing S or autosaving). Your cheat file should now look like this:

Code: Select all

:game0001:00000000:1234:00000001:00000001:Cheat 1
:game0001:00000000:1235:00000001:00000001:Cheat 1
When in fact you wanted the second line to replace the first.

As you can see, because of the various save issues, I always hardcode my cheats.
kelvSYC's Guide to the Cheat Engine - http://members.shaw.ca/kelvsyc/cheatguide.html

The New Move List Cheat Collection - http://mamecheat.co.uk/forums/viewtopic.php?p=6469

Underscore Command - What better game is there?
User avatar
Gaius_4
Posts: 138
Joined: Sun Oct 26, 2003 2:27 pm

Post by Gaius_4 »

Okay, I've deleted all those extra lines at the bottom of the Cheat.dat. Now, is there a way to arrange them in the order that I'd like to have them appear in the Cheat menu (during the game)? Or will any new thing I add/change always be at the bottom? :-?

I'm thinking -yes. :cry:
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

It's impossible to modify cheats that already exist in the file without rewriting the entire file, so this behavior is necessary. It's the main negative side effect of having a pure text format.
User avatar
Gaius_4
Posts: 138
Joined: Sun Oct 26, 2003 2:27 pm

Post by Gaius_4 »

I thought I'd go ahead and ask here instead of opening a new topic.

I was looking for a particular cheat yesterday, on about 5 different occasions I got 3 different "cheats" or Results that were added to the list. But as far as I can tell - they don't do anything. I'm guessing it's possible to find things that don't do anything - right?

edit: :P I think I've found out that if at first these 'cheats' don't appear to do anything - set them to be watched. That way whenever something happens that you're looking for - you can see it change in the watch field. Or mess with that number i.e. 0F (15) and change it to see if something changes that way. -right?

If so, I'll probably have to go back and watch those 3 other things the Cheat engine found to see if those are anything useful.
User avatar
Gaius_4
Posts: 138
Joined: Sun Oct 26, 2003 2:27 pm

concerning the new cheat dat...

Post by Gaius_4 »

I changed a cheat line in my fav. game. I changed a word from 'head' to 'helmet'. So we can change stuff now in the cheat.dat? :-? What about the order in which cheats are listed?
As always, your patients is appreciated. :cool:
Slade
Posts: 34
Joined: Sat Mar 02, 2002 6:19 pm
Location: The Land Down Under
Contact:

Post by Slade »

Gaius:

You can modify the cheat.dat as much as you like. It's a plain text file. If you want to change the order cheats appear in the cheat menu in mame, then just change their order in the cheat.dat and resave it.

eg, if you have lines in the cheat.dat that look like this

Code: Select all

; [ 005 ]
005:0:C80B:99:000:Infinite Credits
005:0:E383:0A:000:Infinite Lives PL2
005:0:E382:0A:000:Infinite Lives PL1
And you want PL1 before PL2, then just move the line you want, so it looks like this :

Code: Select all

; [ 005 ]
005:0:C80B:99:000:Infinite Credits
005:0:E382:0A:000:Infinite Lives PL1
005:0:E383:0A:000:Infinite Lives PL2
And then resave the file. Make sure you move whole lines only. Or you could do damage to the structure of the file.

Hope that helps.
kelvSYC
Posts: 1121
Joined: Thu Sep 27, 2001 1:00 am
Location: Calgary, AB, Canada
Been thanked: 1 time

Post by kelvSYC »

Even if you move whole lines, you could suffer from linkage problems:

Code: Select all

:game0001:00000000:1234:05:FF:Cheat 1
:game0001:00010000:1235:06:FF:Cheat 1 (2/2)
is different from

Code: Select all

:game0001:00010000:1235:06:FF:Cheat 1
:game0001:00000000:1234:05:FF:Cheat 1 (2/2)
In the second case, the cheat engine will either stop loading the cheat file after the first line or skip the first line (I forget which).
kelvSYC's Guide to the Cheat Engine - http://members.shaw.ca/kelvsyc/cheatguide.html

The New Move List Cheat Collection - http://mamecheat.co.uk/forums/viewtopic.php?p=6469

Underscore Command - What better game is there?
Post Reply