How to convert old dat file cheats to newer xml format?

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
Shane777
Posts: 4
Joined: Wed Sep 23, 2015 2:57 am

How to convert old dat file cheats to newer xml format?

Post by Shane777 »

Hello. I'm wondering if there's a way to convert from the classic style to the newer xml style myself? Is there a tool that can accomplish this task, or is there perhaps a set of guidelines I can follow to manually make the changes by hand? I've experimented with this and had some success with some codes, but I can't seem to get them all to work. I'm not sure what the differences are when it comes to things like 39900000 and 39910000, and how to convert those numbers to the correct maincpu/user1/etc... and .mb/mw/etc... Sometimes I can get them right by guessing, but there must be a better way. Right now the main problem I'm having is with the 39910000 number, and which format to convert that part of the code to for xml.

The most recent codes I am trying to find xml conversions for are for Mortal Kombat: the code to change the "you have defeated Reptile" message to "Fatality" while playing as Reptile... and also the code to make the game display "Reptile Wins" while playing as Reptile.

Code: Select all

:mk:39900000:0959C0:00002020:FFFFFFFF:Fatality Message:Turn "You have defeated Reptile" message in "Fatality!!"
:mk:39910000:0959C2:00002020:FFFFFFFF:Fatality Message (2/14)
:mk:39910000:0959C4:00002020:FFFFFFFF:Fatality Message (3/14)
:mk:39910000:0959C6:00004146:FFFFFFFF:Fatality Message (4/14)
:mk:39910000:0959C8:00004154:FFFFFFFF:Fatality Message (5/14)
:mk:39910000:0959CA:0000494C:FFFFFFFF:Fatality Message (6/14)
:mk:39910000:0959CC:00005954:FFFFFFFF:Fatality Message (7/14)
:mk:39910000:0959CE:00002120:FFFFFFFF:Fatality Message (8/14)
:mk:39910000:0959D0:00002021:FFFFFFFF:Fatality Message (9/14)
:mk:39910000:0959D2:00002020:FFFFFFFF:Fatality Message (10/14)
:mk:39910000:0959D4:00002020:FFFFFFFF:Fatality Message (11/14)
:mk:39910000:0959D6:00002020:FFFFFFFF:Fatality Message (12/14)
:mk:39910000:0959D8:00002020:FFFFFFFF:Fatality Message (14/14)
:mk:39910000:0959DA:00002020:FFFFFFFF:Fatality Message (14/14)

Code: Select all

:mk:39900000:095BA2:00004552:FFFFFFFF:Reptile Wins appears when Scorpion Win:Use with "Turn CPU Scorpion into Reptile", "Player Can Look Like Reptile" and "Have Reptile's Speed to play as Reptile.
:mk:39910000:095BA4:00005450:FFFFFFFF:Reptile Wins (2/7)
:mk:39910000:095BA6:00004C49:FFFFFFFF:Reptile Wins (3/7)
:mk:39910000:095BA8:00002045:FFFFFFFF:Reptile Wins (4/7)
:mk:39910000:095BAA:00004957:FFFFFFFF:Reptile Wins (5/7)
:mk:39910000:095BAC:0000534E:FFFFFFFF:Reptile Wins (6/7)
:mk:39910000:095BAE:00000020:FFFFFFFF:Reptile Wins (7/7)
Any help would be appreciated in converting those, and also letting me know how I can go about the conversions myself for future codes I find.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: How to convert old dat file cheats to newer xml format?

Post by Pugsy »

Code: Select all

:mk:39900000:0959C0:00002020:FFFFFFFF:
would become

Code: Select all

<action>maincpu.mw@00959C0=2020</action>

The difference between 39900000 and 39910000 is purely that it's a linked cheat so when you enable the 39900000 it will automatically enable all the xxx1xxxx cheats below it until it encounters a cheat that is not part of the linked list. The old cheat engine type field was BIT based and you should be able to find information about it on the main site or by downloading an old cheat dat file (pre 0.127) and looking at the cheat.txt.

There is no public tool to convert cheat.dat format cheats into xml, I made my own tool several years ago to do it which I still use to convert my own 'super cheat.dat' into xmls for each release but it's usefulness for others would be minimal as it will only work with my own specific format and many mk series cheats would need pre-converting first. If you have a batch of cheats that need converting I can always run them through the conversion process the next time I use it.
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
Shane777
Posts: 4
Joined: Wed Sep 23, 2015 2:57 am

Re: How to convert old dat file cheats to newer xml format?

Post by Shane777 »

Thank you for the info. I was able to get the "you have defeated reptile" cheat working but for some reason I had to divide it up into 2 different cheats because it had so many lines. The first cheat would only work up until "temp9" but as soon as it tried to read the "temp10" line it would cause an "unknown symbol" error while initializing the cheat file. So, I just divided it up and the cheat file loaded fine once I got rid of the need for temp10 and above.

Once I got it working, I had some fun with it and modified it to say "!!! F**king Murdered !!!" instead. (uncensored of course lol) I'm not sure if I did it as perfectly as possible, but here is the code I ended up with after changing the message:

Code: Select all

  <cheat desc="You Have Defeated Reptile message becomes !!! F'ing Murdered !!! message">
    <script state="on">
      <action>temp0 =maincpu.mw@0959C0</action> 
      <action>temp1 =maincpu.mw@0959C2</action> 
      <action>temp2 =maincpu.mw@0959C4</action> 
      <action>temp3 =maincpu.mw@0959C6</action> 
      <action>temp4 =maincpu.mw@0959C8</action> 
      <action>temp5 =maincpu.mw@0959CA</action> 
      <action>temp6 =maincpu.mw@0959CC</action> 
      <action>temp7 =maincpu.mw@0959CE</action> 
      <action>temp8 =maincpu.mw@0959D0</action> 
      <action>temp9 =maincpu.mw@0959D2</action> 
    </script>
    <script state="run">
      <action>maincpu.mw@0959C0=2121</action>
      <action>maincpu.mw@0959C2=2021</action>
      <action>maincpu.mw@0959C4=5546</action>
      <action>maincpu.mw@0959C6=4B43</action>
      <action>maincpu.mw@0959C8=4E49</action>
      <action>maincpu.mw@0959CA=2047</action>
      <action>maincpu.mw@0959CC=554D</action>
      <action>maincpu.mw@0959CE=4452</action>
      <action>maincpu.mw@0959D0=5245</action>
      <action>maincpu.mw@0959D2=4445</action>
    </script>
    <script state="off">
      <action>maincpu.mw@0959C0=temp0 </action>
      <action>maincpu.mw@0959C2=temp1 </action>
      <action>maincpu.mw@0959C4=temp2 </action>
      <action>maincpu.mw@0959C6=temp3 </action>
      <action>maincpu.mw@0959C8=temp4 </action>
      <action>maincpu.mw@0959CA=temp5 </action>
      <action>maincpu.mw@0959CC=temp6 </action>
      <action>maincpu.mw@0959CE=temp7 </action>
      <action>maincpu.mw@0959D0=temp8 </action>
      <action>maincpu.mw@0959D2=temp9 </action>
    </script>
  </cheat>

  <cheat desc="Part 2 of above fix *REQUIRED*">
    <script state="on">
      <action>temp0 =maincpu.mw@0959D4</action> 
      <action>temp1 =maincpu.mw@0959D6</action> 
      <action>temp2 =maincpu.mw@0959D8</action> 
      <action>temp3 =maincpu.mw@0959DA</action> 
    </script>
    <script state="run">
      <action>maincpu.mw@0959D4=2120</action>
      <action>maincpu.mw@0959D6=2121</action>
      <action>maincpu.mw@0959D8=2020</action>
      <action>maincpu.mw@0959DA=2020</action>
    </script>
    <script state="off">
      <action>maincpu.mw@0959D4=temp0 </action>
      <action>maincpu.mw@0959D6=temp1 </action>
      <action>maincpu.mw@0959D8=temp2 </action>
      <action>maincpu.mw@0959DA=temp3 </action>
    </script>
  </cheat>
Is there a better way for such a large code? Maybe a way to get temp10 and above to load in just one cheat instead of dividing them up?

Also, if you think people might enjoy how I modified the message, they are welcome to use it. I'm not sure if I need special board permissions to share modifications. I also would hope to not offend the users who originally cracked the code I modified. I'm just doing this all for fun and not looking to steal credit.

Thanks for the help. This is a great forum with a lot of useful (and fun) information.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: How to convert old dat file cheats to newer xml format?

Post by Pugsy »

You need to increase the temp variables using tempvariables command, there are multiple cheats in the cheat file that use it ; find one as an example .Alternatively take a look at syndromtr's excellent Holy Cheat! from the guides section of the cheat site and search for tempvariables as I'm sure there will be an example in there. I'm on my mobile at the moment or I'd have given an example.
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
Shane777
Posts: 4
Joined: Wed Sep 23, 2015 2:57 am

Re: How to convert old dat file cheats to newer xml format?

Post by Shane777 »

Thanks for the suggestion. I have downloaded the guide and am reading it now. So far I haven't actually used the debugger or anything else. I have mostly just figured things out the hard way by loading up some test chests and trying them one by one. I managed to find where to edit "Raiden Wins" by doing that, and have been giving him some new/funny names. Hopefully with this guide I'll be able to really up my game and learn how to do more of this stuff on my own. Some of the guide seems a bit confusing so I might have some questions soon, if that's ok, but first I'm going to finish reading through it and trying out some of the examples to see if it clicks on its own. Thanks again!
Post Reply