Page 1 of 1

[tmkombat] Mortal Kombat (handheld)

Posted: Sun May 03, 2020 10:47 pm
by Leonis
Hi, this is my first contribution to the code database, so any comments or recommendations are welcome.

File: tmkombat.xml

Code: Select all

<mamecheat version="1">

  <cheat desc="Infinite Time">
    <script state="on">
      <action>temp0 =maincpu.dw@0000103B</action>
    </script>
    <script state="run">
      <action>maincpu.dw@0000103B=0909</action>
    </script>
    <script state="off">
      <action>maincpu.dw@0000103B=temp0 </action>
    </script>
  </cheat>

  <cheat desc="Left Player Infinite Health"> <comment>Sub-Zero, Kano, Rayden, Scorpion.</comment>
    <script state="on">
      <action>temp0 =maincpu.dw@00001001</action>
    </script>
    <script state="run">
      <action>maincpu.dw@00001001=0505</action>
    </script>
    <script state="off">
      <action>maincpu.dw@00001001=temp0 </action>
    </script>
  </cheat>

  <cheat desc="Right Player Infinite Health"> <comment>Liu Kang, Sonya, Johnny Cage, Goro, Shang Tsung.</comment>
    <script state="on">
      <action>temp0 =maincpu.dw@00001011</action>
    </script>
    <script state="run">
      <action>maincpu.dw@00001011=0505</action>
    </script>
    <script state="off">
      <action>maincpu.dw@00001011=temp0 </action>
    </script>
  </cheat>

  <cheat desc="Left Player Drain All Energy Now!"> <comment>Sub-Zero, Kano, Rayden, Scorpion.</comment>
    <script state="on">
      <action>maincpu.dw@00001001=0000</action>
    </script>
  </cheat>

  <cheat desc="Right Player Drain All Energy Now!"> <comment>Liu Kang, Sonya, Johnny Cage, Goro.</comment>
    <script state="on">
      <action>maincpu.dw@00001011=0000</action>
    </script>
  </cheat>

  <cheat desc="P1 Select Character"> <comment>This code makes sense to activate before the game.</comment>
    <parameter>
      <item value="0x00">Sub-Zero</item>
      <item value="0x01">Kano</item>
      <item value="0x02">Rayden</item>
      <item value="0x03">Scorpion</item>
      <item value="0x04">Liu Kang</item>
      <item value="0x05">Sonya Blade</item>
      <item value="0x06">Johnny Cage</item>
      <item value="0x07">#Goro</item>
    </parameter>
    <script state="on">
      <action>temp0 =maincpu.db@00001022</action>
    </script>
    <script state="run">
      <action>maincpu.db@00001022=param</action>
    </script>
    <script state="off">
      <action>maincpu.db@00001022=temp0 </action>
    </script>
  </cheat>

  <cheat desc="Select Opponent Character"> <comment>This code makes sense to activate before the game. Choose from opposite team.</comment>
    <parameter>
      <item value="0x00">Sub-Zero</item>
      <item value="0x01">Kano</item>
      <item value="0x02">Rayden</item>
      <item value="0x03">Scorpion</item>
      <item value="0x04">Liu Kang</item>
      <item value="0x05">Sonya Blade</item>
      <item value="0x06">Johnny Cage</item>
      <item value="0x07">#Goro</item>
    </parameter>
    <script state="on">
      <action>temp0 =maincpu.db@00001023</action>
    </script>
    <script state="run">
      <action>maincpu.db@00001023=param</action>
    </script>
    <script state="off">
      <action>maincpu.db@00001023=temp0 </action>
    </script>
  </cheat>

  <cheat desc="Status Display">
    <parameter>
      <item value="0x00">Time/Score</item>
      <item value="0x02">Score only</item>
      <item value="0x08">Time only</item>
    </parameter>
    <script state="run">
      <action>maincpu.db@00001000=param</action>
    </script>
    <script state="off">
      <action>maincpu.db@00001000=0 </action>
    </script>
  </cheat>

  <cheat desc="Set Maximal Score">
    <script state="on">
      <action>maincpu.db@00001028=09</action>
      <action>maincpu.dw@00001029=0909</action>
    </script>
  </cheat>

</mamecheat>
<!-- Cheat file downloaded from http://www.mamecheat.co.uk, see cheat.txt for list of contributors. -->

Re: [tmkombat] Mortal Kombat (handheld)

Posted: Mon May 04, 2020 12:11 am
by Pugsy
Thanks, I appreciate it. Added.

Moved cheats to the "Software List" forum (which is used for any MAME non-arcade game cheats) as it's not an arcade game.

Good job, the cheats work though I have a couple of observations though as you asked (thanks for that as people don't normally bother).

The data region is only 128 bytes big so all addresses should be under 0x80 (eg. so 00001028 should be 28, no need to go mad on the preceding zeros either).
Generally temp variables in ON and OFF scripts are only used for ROM or program code cheats
You also used "health" in two cheat names when it should be energy.

Does the "Set Maximal Score" do anything special? Generally we don't bother with score related cheats if they are cosmetic only.

Re: [tmkombat] Mortal Kombat (handheld)

Posted: Mon May 04, 2020 7:52 am
by Leonis
Pugsy wrote: Mon May 04, 2020 12:11 am eg. so 00001028 should be 28
You probably meant 1028?
Pugsy wrote: Mon May 04, 2020 12:11 am Does the "Set Maximal Score" do anything special?
No, preservation of records in the game is not provided. I rather did this for myself, in order to remember why this piece of memory is needed.

Do I need to simplify the codes, or have they already been fixed in DB?

Re: [tmkombat] Mortal Kombat (handheld)

Posted: Mon May 04, 2020 9:25 am
by Pugsy

You probably meant 1028?
No, the data region that is being poked by all those cheats is only 128 bytes big. So 1028 doesnt exist. The write is working because it'll be ignoring the 1000 part.

No, preservation of records in the game is not provided. I rather did this for myself, in order to remember why this piece of memory is needed.

Do I need to simplify the codes, or have they already been fixed in DB?
Fair enough but the address is something that belongs to hiscore.dat.

I've fixed them in the db so no need to do anything.